2022-11-12 20:16:25 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: braindead <totsuka.sama@gmail.com>
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
2024-03-23 22:26:17 +01:00
index bfb9694087821de206fafe867f207e07a4a6a988..e875196824ef9618a52ca3f172f202d5584990df 100644
2022-11-12 20:16:25 +01:00
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
2023-12-06 17:21:56 +01:00
@@ -291,7 +291,9 @@ public class ItemFrame extends HangingEntity {
2023-07-15 22:28:28 +02:00
// Paper end
2022-11-12 20:16:25 +01:00
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) -> {
2024-01-16 12:41:40 +01:00
+ // Paper end - fix MC-252817
2023-06-08 10:47:19 +02:00
MapItemSavedData worldmap = MapItem.getSavedData(i, this.level());
2022-11-12 20:16:25 +01:00
if (worldmap != null) {
2023-12-06 17:21:56 +01:00
@@ -309,7 +311,12 @@ public class ItemFrame extends HangingEntity {
2022-11-12 20:16:25 +01:00
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) {
2024-01-16 12:41:40 +01:00
+ // Paper end - fix MC-252817
2022-11-12 20:16:25 +01:00
if (itemstack.is(Items.FILLED_MAP)) {
Integer integer = MapItem.getMapId(itemstack);