3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00

Quick tweaks to logical flow of getMapData

Dieser Commit ist enthalten in:
Shane Freeder 2023-10-04 16:25:26 +01:00
Ursprung f36bb59739
Commit 5eec4ec3bf
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix missing map initialize event call
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f502b01b564bd33c449cbe621966ef4076a38cca..868951dc21aff541765b1f58f08cdf3c47446d25 100644
index f502b01b564bd33c449cbe621966ef4076a38cca..51d282b524b5249438f7744f7f0b1cc27b76470e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2099,7 +2099,23 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -20,12 +20,12 @@ index f502b01b564bd33c449cbe621966ef4076a38cca..868951dc21aff541765b1f58f08cdf3c
+ 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;