Ensure maps are stored only in the main world. Fixes BUKKIT-4872

This commit is contained in:
feildmaster
2013-10-30 13:23:24 -05:00
committed by EvilSeph
parent 7aabcb2ab3
commit 1c7698fab2
2 changed files with 9 additions and 5 deletions

View File

@@ -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);