From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jmp <jasonpenilla2@me.com>
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 a34772e329df62d9176b0aa392197e2771c69da4..b6f2270aae3422f5ee5bae0f955f5807f5cadf59 100644
--- a/src/main/java/net/minecraft/server/ItemNameTag.java
+++ b/src/main/java/net/minecraft/server/ItemNameTag.java
@@ -20,6 +20,11 @@ public class ItemNameTag extends Item {
                 if (!event.callEvent()) return EnumInteractionResult.PASS;
                 EntityLiving newEntityLiving = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getEntity()).getHandle();
                 newEntityLiving.setCustomName(event.getName() != null ? PaperAdventure.asVanilla(event.getName()) : null);
+                // Purpur start
+                if (entityhuman.world.purpurConfig.armorstandFixNametags && newEntityLiving instanceof EntityArmorStand) {
+                    newEntityLiving.setCustomNameVisible(true);
+                }
+                // Purpur end
                 if (event.isPersistent() && newEntityLiving instanceof EntityInsentient) {
                     ((EntityInsentient) newEntityLiving).setPersistent();
                 }
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 7915a0204597a3711c1f177cf504a1c3c603e91e..9a419e2e591113015bd122202aba2a8aa8494f63 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);
     }
 
