mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 22:07:59 +01:00
ea39dd0f98
- 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
57 lines
1.4 KiB
Java
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;
|
|
}
|
|
}
|