diff options
author | Jake Potrebic <[email protected]> | 2024-05-19 17:15:44 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-19 17:15:44 -0700 |
commit | b3b340617e38bf428b5c18f7b497f914f54c22ef (patch) | |
tree | 7d5fbe7231dfd0f63105243ddb1ce0d7f91ef6b4 | |
parent | 0ad09de75bfb1db2a84bb760cdee09b06d609bb3 (diff) | |
download | Paper-b3b340617e38bf428b5c18f7b497f914f54c22ef.tar.gz Paper-b3b340617e38bf428b5c18f7b497f914f54c22ef.zip |
fix CompassMeta not being correct (#10737)
-rw-r--r-- | patches/server/1039-General-ItemMeta-fixes.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/server/1039-General-ItemMeta-fixes.patch b/patches/server/1039-General-ItemMeta-fixes.patch index a91feb64de..d39c8fd518 100644 --- a/patches/server/1039-General-ItemMeta-fixes.patch +++ b/patches/server/1039-General-ItemMeta-fixes.patch @@ -194,6 +194,43 @@ index 3f78a0935d738854182254b345064e3c225dcd5f..218df87c596d47b431dbbf2aa42822ef } if (this.resolved) { +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java +index bbca26f5debb263b04516e68f6e49f68a38fa5b1..aacc4d010f4dfa4d9d11332b802205a6f35b6de3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaCompass.java +@@ -36,7 +36,7 @@ public class CraftMetaCompass extends CraftMetaItem implements CompassMeta { + private int lodestoneX; + private int lodestoneY; + private int lodestoneZ; +- private boolean tracked = true; ++ private Boolean tracked = null; // Paper - tri-state + + CraftMetaCompass(CraftMetaItem meta) { + super(meta); +@@ -80,7 +80,7 @@ public class CraftMetaCompass extends CraftMetaItem implements CompassMeta { + this.setLodestone(lodestone); + } + } +- this.tracked = SerializableMeta.getBoolean(map, CraftMetaCompass.LODESTONE_TRACKED.BUKKIT); ++ this.tracked = SerializableMeta.getObjectOptionally(Boolean.class, map, CraftMetaCompass.LODESTONE_TRACKED.BUKKIT, true).orElse(null); // Paper - tri-state + } + + @Override +@@ -146,12 +146,12 @@ public class CraftMetaCompass extends CraftMetaItem implements CompassMeta { + } + + boolean hasLodestoneTracked() { +- return !this.tracked; ++ return this.tracked != null; // Paper - tri-state + } + + @Override + public boolean isLodestoneTracked() { +- return this.tracked; ++ return this.tracked != null && this.tracked; // Paper - tri-state + } + + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java index 8e0dd4b7a7a25a8beb27b507047bc48d8227627c..cf5d27ccc2225bac3aa57912f444f95d2f37e32e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java |