mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
Quick tweaks to logical flow of getMapData
This commit is contained in:
@@ -20,12 +20,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ if (existing == null && !storage.cache.containsKey(id)) {
|
+ if (existing == null && !storage.cache.containsKey(id)) {
|
||||||
+ final net.minecraft.world.level.saveddata.SavedData.Factory<MapItemSavedData> factory = MapItemSavedData.factory();
|
+ final net.minecraft.world.level.saveddata.SavedData.Factory<MapItemSavedData> factory = MapItemSavedData.factory();
|
||||||
+ final MapItemSavedData map = storage.readSavedData(factory.deserializer(), factory.type(), id);
|
+ final MapItemSavedData map = storage.readSavedData(factory.deserializer(), factory.type(), id);
|
||||||
|
+ storage.cache.put(id, map);
|
||||||
+ if (map != null) {
|
+ if (map != null) {
|
||||||
+ map.id = id;
|
+ map.id = id;
|
||||||
+ new MapInitializeEvent(map.mapView).callEvent();
|
+ new MapInitializeEvent(map.mapView).callEvent();
|
||||||
|
+ return map;
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+ storage.cache.put(id, map);
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ return existing instanceof MapItemSavedData data ? data : null;
|
+ return existing instanceof MapItemSavedData data ? data : null;
|
||||||
|
Reference in New Issue
Block a user