diff options
author | feildmaster <admin@feildmaster.com> | 2013-10-30 13:23:24 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2013-10-30 17:00:41 -0400 |
commit | 1c7698fab2c35d18c0edb16ff325d30ddab1f8e9 (patch) | |
tree | fb52978226894c6cd08867023407838849540507 /src | |
parent | 7aabcb2ab3cfeb6d98ecbd8bc14cc5fad6ffa345 (diff) | |
download | craftbukkit-1c7698fab2c35d18c0edb16ff325d30ddab1f8e9.tar craftbukkit-1c7698fab2c35d18c0edb16ff325d30ddab1f8e9.tar.gz craftbukkit-1c7698fab2c35d18c0edb16ff325d30ddab1f8e9.tar.lz craftbukkit-1c7698fab2c35d18c0edb16ff325d30ddab1f8e9.tar.xz craftbukkit-1c7698fab2c35d18c0edb16ff325d30ddab1f8e9.zip |
Ensure maps are stored only in the main world. Fixes BUKKIT-4872
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemMapEmpty.java | 5 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/ItemWorldMap.java | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/net/minecraft/server/ItemMapEmpty.java b/src/main/java/net/minecraft/server/ItemMapEmpty.java index b7755b03..f7745924 100644 --- a/src/main/java/net/minecraft/server/ItemMapEmpty.java +++ b/src/main/java/net/minecraft/server/ItemMapEmpty.java @@ -8,11 +8,12 @@ public class ItemMapEmpty extends ItemWorldMapBase { } public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) { - ItemStack itemstack1 = new ItemStack(Item.MAP, 1, world.b("map")); + World worldMain = world.getServer().getServer().worlds.get(0); // CraftBukkit - store reference to primary world + ItemStack itemstack1 = new ItemStack(Item.MAP, 1, worldMain.b("map")); // CraftBukkit - use primary world for maps String s = "map_" + itemstack1.getData(); WorldMap worldmap = new WorldMap(s); - world.a(s, (WorldMapBase) worldmap); + worldMain.a(s, (WorldMapBase) worldmap); // CraftBukkit - use primary world for maps worldmap.scale = 0; int i = 128 * (1 << worldmap.scale); diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java index be1b13a6..3866c1bb 100644 --- a/src/main/java/net/minecraft/server/ItemWorldMap.java +++ b/src/main/java/net/minecraft/server/ItemWorldMap.java @@ -13,11 +13,12 @@ public class ItemWorldMap extends ItemWorldMapBase { } public WorldMap getSavedMap(ItemStack itemstack, World world) { + World worldMain = world.getServer().getServer().worlds.get(0); // CraftBukkit - store reference to primary world String s = "map_" + itemstack.getData(); - WorldMap worldmap = (WorldMap) world.getServer().getServer().worlds.get(0).a(WorldMap.class, s); // CraftBukkit - use primary world for maps + WorldMap worldmap = (WorldMap) worldMain.a(WorldMap.class, s); // CraftBukkit - use primary world for maps if (worldmap == null && !world.isStatic) { - itemstack.setData(world.b("map")); + itemstack.setData(worldMain.b("map")); // CraftBukkit - use primary world for maps s = "map_" + itemstack.getData(); worldmap = new WorldMap(s); worldmap.scale = 3; @@ -27,7 +28,7 @@ public class ItemWorldMap extends ItemWorldMapBase { worldmap.centerZ = Math.round((float) (world.getWorldData().e() / i)) * i; worldmap.map = (byte) ((WorldServer) world).dimension; // CraftBukkit - fixes Bukkit multiworld maps worldmap.c(); - world.a(s, (WorldMapBase) worldmap); + worldMain.a(s, (WorldMapBase) worldmap); // CraftBukkit - use primary world for maps // CraftBukkit start MapInitializeEvent event = new MapInitializeEvent(worldmap.mapView); @@ -237,6 +238,8 @@ public class ItemWorldMap extends ItemWorldMapBase { if (itemstack.hasTag() && itemstack.getTag().getBoolean("map_is_scaling")) { WorldMap worldmap = Item.MAP.getSavedMap(itemstack, world); + world = world.getServer().getServer().worlds.get(0); // CraftBukkit - use primary world for maps + itemstack.setData(world.b("map")); WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData()); |