mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Set name visible when using a Name Tag on an Armor Stand
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user