13
0
geforkt von Mirrors/Paper

Quick tweaks to logical flow of getMapData

Dieser Commit ist enthalten in:
Shane Freeder 2023-10-04 16:25:26 +01:00
Ursprung a09f1713bf
Commit 13884a0748

Datei anzeigen

@ -20,12 +20,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (existing == null && !storage.cache.containsKey(id)) {
+ final net.minecraft.world.level.saveddata.SavedData.Factory<MapItemSavedData> factory = MapItemSavedData.factory();
+ final MapItemSavedData map = storage.readSavedData(factory.deserializer(), factory.type(), id);
+ storage.cache.put(id, map);
+ if (map != null) {
+ map.id = id;
+ new MapInitializeEvent(map.mapView).callEvent();
+ return map;
+ }
+
+ storage.cache.put(id, map);
+ }
+
+ return existing instanceof MapItemSavedData data ? data : null;