mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 20:21:41 +01:00
Quick tweaks to logical flow of getMapData
This commit is contained in:
parent
a09f1713bf
commit
13884a0748
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user