summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/ItemMapEmpty.java5
-rw-r--r--src/main/java/net/minecraft/server/ItemWorldMap.java9
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());