From 84a19565d4893165d8d226c3d8dda1a296cbcc61 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Sat, 10 Dec 2011 12:36:19 -0500 Subject: [PATCH] Fixed (Bukkit multiworld) maps as described in BUKKIT-142. --- src/main/java/net/minecraft/server/ItemWorldMap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java index 5cc8ceb792..c93ab32ce0 100644 --- a/src/main/java/net/minecraft/server/ItemWorldMap.java +++ b/src/main/java/net/minecraft/server/ItemWorldMap.java @@ -24,7 +24,7 @@ public class ItemWorldMap extends ItemWorldMapBase { worldmap.centerX = world.getWorldData().c(); worldmap.centerZ = world.getWorldData().e(); worldmap.scale = 3; - worldmap.map = (byte) world.worldProvider.dimension; + worldmap.map = (byte) ((WorldServer) world).dimension; // CraftBukkit - fixes Bukkit multiworld maps. worldmap.a(); world.a(s, (WorldMapBase) worldmap); @@ -72,6 +72,7 @@ public class ItemWorldMap extends ItemWorldMapBase { byte b2 = 0; int[] aint = new int[256]; Chunk chunk = world.getChunkAtWorldCoords(i3, j3); + if (chunk.isEmpty()) continue; // CraftBukkit - fixes maps erasing themselves on low chunk visibility. int k3 = i3 & 15; int l3 = j3 & 15; int i4 = 0; @@ -232,7 +233,7 @@ public class ItemWorldMap extends ItemWorldMapBase { worldmap.centerX = MathHelper.floor(entityhuman.locX); worldmap.centerZ = MathHelper.floor(entityhuman.locZ); worldmap.scale = 3; - worldmap.map = (byte) world.worldProvider.dimension; + worldmap.map = (byte) ((WorldServer) world).dimension; // CraftBukkit - fixes Bukkit multiworld maps. worldmap.a(); }