Ensure maps are stored only in the main world. Fixes BUKKIT-4872
Dieser Commit ist enthalten in:
Ursprung
7aabcb2ab3
Commit
1c7698fab2
@ -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);
|
||||
|
||||
|
@ -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());
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren