From 7aabcb2ab3cfeb6d98ecbd8bc14cc5fad6ffa345 Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Wed, 30 Oct 2013 04:22:00 -0500 Subject: [PATCH] Don't share WorldMapCollection. Fixes BUKKIT-4871 WorldMapCollection stores scoreboard, map (item), structure, and village information. Scoreboards are explicitly handled globally, while villages and structures are erroneously shared. This commit separates the WorldMapCollections to not be shared among custom worlds. Maps are special-cased to maintain the previous shared behavior. --- src/main/java/net/minecraft/server/ItemWorldMap.java | 2 +- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java index cf6ebd11c8..be1b13a6a1 100644 --- a/src/main/java/net/minecraft/server/ItemWorldMap.java +++ b/src/main/java/net/minecraft/server/ItemWorldMap.java @@ -14,7 +14,7 @@ public class ItemWorldMap extends ItemWorldMapBase { public WorldMap getSavedMap(ItemStack itemstack, World world) { String s = "map_" + itemstack.getData(); - WorldMap worldmap = (WorldMap) world.a(WorldMap.class, s); + WorldMap worldmap = (WorldMap) world.getServer().getServer().worlds.get(0).a(WorldMap.class, s); // CraftBukkit - use primary world for maps if (worldmap == null && !world.isStatic) { itemstack.setData(world.b("map")); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 85be77ebec..d140c4f8c7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -730,7 +730,6 @@ public final class CraftServer implements Server { return null; } - internal.worldMaps = console.worlds.get(0).worldMaps; internal.scoreboard = getScoreboardManager().getMainScoreboard().getHandle(); internal.tracker = new EntityTracker(internal);