mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Set name visible when using a Name Tag on an Armor Stand
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
--- a/net/minecraft/world/item/NameTagItem.java
|
||||
+++ b/net/minecraft/world/item/NameTagItem.java
|
||||
@@ -24,6 +_,7 @@
|
||||
|
||||
LivingEntity newEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getEntity()).getHandle();
|
||||
newEntity.setCustomName(event.getName() != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(event.getName()) : null);
|
||||
+ if (player.level().purpurConfig.armorstandFixNametags && target instanceof net.minecraft.world.entity.decoration.ArmorStand) target.setCustomNameVisible(true); // Purpur - Set name visible when using a Name Tag on an Armor Stand
|
||||
if (event.isPersistent() && newEntity instanceof Mob mob) {
|
||||
// Paper end - Add PlayerNameEntityEvent
|
||||
mob.setPersistenceRequired();
|
||||
@@ -90,9 +90,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public float armorstandStepHeight = 0.0F;
|
||||
public boolean armorstandSetNameVisible = false;
|
||||
public boolean armorstandFixNametags = false;
|
||||
private void armorstandSettings() {
|
||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
armorstandSetNameVisible = getBoolean("gameplay-mechanics.armorstand.set-name-visible-when-placing-with-custom-name", armorstandSetNameVisible);
|
||||
armorstandFixNametags = getBoolean("gameplay-mechanics.armorstand.fix-nametags", armorstandFixNametags);
|
||||
}
|
||||
|
||||
public boolean arrowMovementResetsDespawnCounter = true;
|
||||
|
||||
Reference in New Issue
Block a user