Skip to content

Commit

Permalink
only show armorstand name if it's custom, fixes #1514
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed May 13, 2024
1 parent 4418fbf commit be47af0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Apply display names from item forms of entities to entities


diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 5abbc0caf90cafc1a06dfff158c158b1538f827c..8b25bb80a913cd002cdaeadf076d811172f10488 100644
index ebf1d6e3431e36811f14ed09d3b891a074fbdaf2..67eb7ddb77e781bf9d140133e0ad9f16c1ca0f0e 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -613,6 +613,7 @@ public class ArmorStand extends LivingEntity {
Expand Down Expand Up @@ -75,7 +75,7 @@ index 0b23e05f936cab7a9867828c2d69417cfde1d2ce..105e2b7d7cd7c64a9164e4114476e44f

public static enum Type implements StringRepresentable {
diff --git a/src/main/java/net/minecraft/world/item/ArmorStandItem.java b/src/main/java/net/minecraft/world/item/ArmorStandItem.java
index 1634a7d5ff06583408cf2f02f2b5f90931b1e02a..dfe8473a880cbddfc3ac6a9c97f1a500624eeb38 100644
index 1634a7d5ff06583408cf2f02f2b5f90931b1e02a..fd83261f64c6469aebde8ab13a6777b9b269cea2 100644
--- a/src/main/java/net/minecraft/world/item/ArmorStandItem.java
+++ b/src/main/java/net/minecraft/world/item/ArmorStandItem.java
@@ -58,6 +58,14 @@ public class ArmorStandItem extends Item {
Expand All @@ -86,7 +86,7 @@ index 1634a7d5ff06583408cf2f02f2b5f90931b1e02a..dfe8473a880cbddfc3ac6a9c97f1a500
+ if (!world.purpurConfig.persistentDroppableEntityDisplayNames) {
+ entityarmorstand.setCustomName(null);
+ }
+ if (world.purpurConfig.armorstandSetNameVisible) {
+ if (world.purpurConfig.armorstandSetNameVisible && entityarmorstand.getCustomName() != null) {
+ entityarmorstand.setCustomNameVisible(true);
+ }
+ // Purpur end
Expand Down Expand Up @@ -126,14 +126,14 @@ index 530167ce8e5bb72a418f8ec61411e38a5892fd72..35dc7546793dba34bf6debad3f214f61

if (((HangingEntity) object).survives()) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 8ba5fc8813ef1cb34f7df801f6d7b2ed42b1c052..1f5cfaf07e0fd86a530b57fd0198ade2b1d0d999 100644
index 8ba5fc8813ef1cb34f7df801f6d7b2ed42b1c052..8a0eb8281364cd0b140381474a46d02a6c4ad3ba 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -97,8 +97,10 @@ public class PurpurWorldConfig {
}

public float armorstandStepHeight = 0.0F;
+ public boolean armorstandSetNameVisible = true;
+ public boolean armorstandSetNameVisible = 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ index 774c982f28b4f127fc3f036c19dfb47fb9ae3264..d49b60e7e643498b49c03593dc0da2f8
// Paper end - Add PlayerNameEntityEvent
mob.setPersistenceRequired();
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 1f5cfaf07e0fd86a530b57fd0198ade2b1d0d999..548ad445ed73c5009c93cadb0ee8e39acdbd737c 100644
index 8a0eb8281364cd0b140381474a46d02a6c4ad3ba..5b1c6815967d5006fbc466e3368398cc4d1f0c18 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -98,9 +98,11 @@ public class PurpurWorldConfig {

public float armorstandStepHeight = 0.0F;
public boolean armorstandSetNameVisible = true;
public boolean armorstandSetNameVisible = false;
+ public boolean armorstandFixNametags = false;
private void armorstandSettings() {
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0122-Movement-options-for-armor-stands.patch
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ index 67eb7ddb77e781bf9d140133e0ad9f16c1ca0f0e..d22ce9181e3b403328b8510bc73f8e6b
+ // Purpur end
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 91f204f313ee4b5a1f16416670e855d4e7177e51..c0f62102bb2147d08666013c5ca5360a5bcf8e8b 100644
index 5694476f17d56f0db1c9fdfbafa1fc935cb84b3e..8c36c55ba6230bd254f1416e0a6446737fc1d911 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -99,10 +99,16 @@ public class PurpurWorldConfig {
public float armorstandStepHeight = 0.0F;
public boolean armorstandSetNameVisible = true;
public boolean armorstandSetNameVisible = false;
public boolean armorstandFixNametags = false;
+ public boolean armorstandMovement = true;
+ public boolean armorstandWaterMovement = true;
Expand Down

0 comments on commit be47af0

Please sign in to comment.