aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-11-04 14:11:55 -0700
committerGitHub <[email protected]>2023-11-04 14:11:55 -0700
commit0cdce89d595a2c1c097c9e2a5ff96687977b3b25 (patch)
treede63d6aa8112811f93b5d6afebbb069b9980870f /patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch
parent15a0de2eefb70ea8162cbb31056920adf80265fa (diff)
downloadPaper-0cdce89d595a2c1c097c9e2a5ff96687977b3b25.tar.gz
Paper-0cdce89d595a2c1c097c9e2a5ff96687977b3b25.zip
Fix a bunch of stuff with player spawn locations (#9887)
If a playerdata doesn't contain a valid, loaded world, reset to the main world spawn point
Diffstat (limited to 'patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch')
-rw-r--r--patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch b/patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch
new file mode 100644
index 0000000000..9780023a35
--- /dev/null
+++ b/patches/server/0878-fix-MC-252817-green-map-markers-do-not-disappear.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: braindead <[email protected]>
+Date: Sat, 5 Nov 2022 17:47:26 -0400
+Subject: [PATCH] fix MC-252817 (green map markers do not disappear).
+
+this bug is caused by the fact that the itemframe's item is set to empty before the green marker is requested to be removed. this is fixed by getting the mapid from this method's parameter, rather than the air block now stored by the item frame.
+
+diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+index b42c060a5d8d68b5773a8a5e38c59707a277d9bb..dcf245387f59ce730cb2cfb5fc0e837a20d3dfe5 100644
+--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
++++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+@@ -296,7 +296,9 @@ public class ItemFrame extends HangingEntity {
+ // Paper end
+
+ private void removeFramedMap(ItemStack itemstack) {
+- this.getFramedMapId().ifPresent((i) -> {
++ // Paper start - fix MC-252817 (green map markers do not disappear)
++ this.getFramedMapIdFromItem(itemstack).ifPresent((i) -> {
++ // Paper end
+ MapItemSavedData worldmap = MapItem.getSavedData(i, this.level());
+
+ if (worldmap != null) {
+@@ -314,7 +316,12 @@ public class ItemFrame extends HangingEntity {
+
+ public OptionalInt getFramedMapId() {
+ ItemStack itemstack = this.getItem();
++ // Paper start - fix MC-252817 (green map markers do not disappear)
++ return this.getFramedMapIdFromItem(itemstack);
++ }
+
++ public OptionalInt getFramedMapIdFromItem(ItemStack itemstack) {
++ // Paper end
+ if (itemstack.is(Items.FILLED_MAP)) {
+ Integer integer = MapItem.getMapId(itemstack);
+