Restore original formatting for MC-252817 patch

This commit is contained in:
Noah van der Aa 2024-04-24 23:26:18 +02:00
parent 060e370a08
commit 44a5402713

View File

@ -14,11 +14,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private void removeFramedMap(ItemStack stack) {
- MapId mapid = this.getFramedMapId();
-
+ MapId mapid = this.getFramedMapIdForItem(stack); // Paper - fix MC-252817 (green map markers do not disappear)
if (mapid != null) {
MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level());
@@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity {
@Nullable
@ -26,14 +25,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- return (MapId) this.getItem().get(DataComponents.MAP_ID);
+ // Paper start
+ return this.getFramedMapIdForItem(this.getItem());
}
+ }
+
+ @Nullable
+ public MapId getFramedMapIdForItem(ItemStack item) {
+ return (MapId) item.get(DataComponents.MAP_ID);
+ }
+ // Paper end
+
public boolean hasFramedMap() {
return this.getItem().has(DataComponents.MAP_ID);
+ // Paper end
}
public boolean hasFramedMap() {