diff --git a/patches/server/1034-Fix-missing-map-initialize-event-call.patch b/patches/server/1034-Fix-missing-map-initialize-event-call.patch index c31e783240..5f84bbfe02 100644 --- a/patches/server/1034-Fix-missing-map-initialize-event-call.patch +++ b/patches/server/1034-Fix-missing-map-initialize-event-call.patch @@ -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 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;