From 56569681b43e3fec3426cca43271b04eaf93f100 Mon Sep 17 00:00:00 2001 From: jmp Date: Tue, 17 Nov 2020 13:51:29 -0800 Subject: [PATCH] Set name visible when using a Name Tag on an Armor Stand --- ...-when-using-a-Name-Tag-on-an-Armor-S.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 patches/server/0144-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch diff --git a/patches/server/0144-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch b/patches/server/0144-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch new file mode 100644 index 000000000..17e82197f --- /dev/null +++ b/patches/server/0144-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: jmp +Date: Tue, 17 Nov 2020 13:12:09 -0800 +Subject: [PATCH] Set name visible when using a Name Tag on an Armor Stand + + +diff --git a/src/main/java/net/minecraft/server/ItemNameTag.java b/src/main/java/net/minecraft/server/ItemNameTag.java +index 01163ce38..a7efce973 100644 +--- a/src/main/java/net/minecraft/server/ItemNameTag.java ++++ b/src/main/java/net/minecraft/server/ItemNameTag.java +@@ -11,6 +11,11 @@ public class ItemNameTag extends Item { + if (itemstack.hasName() && !(entityliving instanceof EntityHuman)) { + if (!entityhuman.world.isClientSide && entityliving.isAlive()) { + entityliving.setCustomName(itemstack.getName()); ++ // Purpur start ++ if (entityhuman.world.purpurConfig.armorstandFixNametags && entityliving instanceof EntityArmorStand) { ++ entityliving.setCustomNameVisible(true); ++ } ++ // Purpur end + if (entityliving instanceof EntityInsentient) { + ((EntityInsentient) entityliving).setPersistent(); + } +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index 48e8e2e34..fad502179 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -84,9 +84,11 @@ public class PurpurWorldConfig { + } + + public boolean armorstandSetNameVisible = false; ++ public boolean armorstandFixNametags = false; + public float armorstandStepHeight = 0.0F; + private void armorstandSettings() { + armorstandSetNameVisible = getBoolean("gameplay-mechanics.armorstand.set-name-visible-when-placing-with-custom-name", armorstandSetNameVisible); ++ armorstandFixNametags = getBoolean("gameplay-mechanics.armorstand.fix-nametags", armorstandFixNametags); + armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight); + } +