Archiviert
13
0

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

Dieser Commit ist enthalten in:
feildmaster 2013-10-30 13:23:24 -05:00 committet von EvilSeph
Ursprung 7aabcb2ab3
Commit 1c7698fab2
2 geänderte Dateien mit 9 neuen und 5 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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