Fix some inconsistency issues with empty map items (#6304)

This commit is contained in:
Shane Freeder
2021-08-01 16:55:25 +01:00
parent 3a17437d6f
commit b3f290d877
2 changed files with 31 additions and 13 deletions

View File

@@ -59,19 +59,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return entityitem;
}
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -0,0 +0,0 @@ public class MapItem extends ComplexItem {
@Nullable
public static MapItemSavedData getSavedData(@Nullable Integer id, Level world) {
- return id == null ? null : world.getMapData(MapItem.makeKey(id));
+ return id == null || id < 0 ? null : world.getMapData(MapItem.makeKey(id)); // Paper - map ids under 0 are invalid
}
@Nullable
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java