Unicopia/src/main/java/com/minelittlepony/unicopia/entity/EntityFakeServerPlayer.java
Sollace ea39dd0f98 Fixed various disguise bugs
- Fixed changeligns playing hurt sounds when flying whilst disguised as a player
 - Fixed invisible disguised changelings
 - Fixed disguised changelings not showing all the hat layer parts
 - Changeling disguises will work better with falling blocks and shulkers
2019-02-11 17:41:24 +02:00

57 lines
1.4 KiB
Java

package com.minelittlepony.unicopia.entity;
import com.minelittlepony.unicopia.UClient;
import com.minelittlepony.unicopia.player.IOwned;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.util.FakePlayer;
public class EntityFakeServerPlayer extends FakePlayer implements IOwned<EntityPlayer> {
private EntityPlayer owner;
public EntityFakeServerPlayer(WorldServer world, GameProfile profile) {
super(world, profile);
}
@Override
public boolean isPlayer() {
return false;
}
@Override
protected void playEquipSound(ItemStack stack) {
/*noop*/
}
@Override
public EntityPlayer getOwner() {
return owner;
}
@Override
public void setOwner(EntityPlayer owner) {
this.owner = owner;
}
@Override
public boolean getAlwaysRenderNameTag() {
return !UClient.instance().isClientPlayer(getOwner());
}
@Override
public boolean getAlwaysRenderNameTagForRender() {
return getAlwaysRenderNameTag();
}
@Override
public ITextComponent getDisplayName() {
ITextComponent name = super.getDisplayName();
name.getStyle().setItalic(true);
return name;
}
}