From c4a55b2540bb79cf087040721fd3146a3fe9ae92 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 9 May 2021 13:27:17 +0900 Subject: patch playernames showing on private islands. --- .../party/playerpreview/FeatureViewPlayerOnJoin.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main/java/kr/syeyoung/dungeonsguide') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java index 3cd52d52..f487f2fb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java @@ -60,10 +60,14 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.resources.DefaultPlayerSkin; import net.minecraft.client.resources.SkinManager; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.HoverEvent; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.client.event.ClientChatReceivedEvent; @@ -537,6 +541,21 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen public ItemStack[] getInventory() { return this.inventory.armorInventory; } + + @Override + public boolean isInvisibleToPlayer(EntityPlayer player) { + return true; + } + + @Override + public Team getTeam() { + return new ScorePlayerTeam(null, null) { + @Override + public EnumVisible getNameTagVisibility() { + return EnumVisible.NEVER; + } + }; + } } -- cgit