summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemWorldMap.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-11-17 12:41:03 +1100
committermd_5 <git@md-5.net>2016-11-17 12:41:03 +1100
commitc25ddf063a808e3adb749e22017661f403c5fb7e (patch)
treeb2efcff512be12fd3e38cf8c36386148ce6ab4ae /nms-patches/ItemWorldMap.patch
parent51263e97187a84338f89698eef187284055a682a (diff)
downloadcraftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.gz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.lz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.tar.xz
craftbukkit-c25ddf063a808e3adb749e22017661f403c5fb7e.zip
Update to Minecraft 1.11
Diffstat (limited to 'nms-patches/ItemWorldMap.patch')
-rw-r--r--nms-patches/ItemWorldMap.patch64
1 files changed, 44 insertions, 20 deletions
diff --git a/nms-patches/ItemWorldMap.patch b/nms-patches/ItemWorldMap.patch
index dde295a5..42baeba5 100644
--- a/nms-patches/ItemWorldMap.patch
+++ b/nms-patches/ItemWorldMap.patch
@@ -12,9 +12,30 @@
public class ItemWorldMap extends ItemWorldMapBase {
protected ItemWorldMap() {
-@@ -12,25 +17,32 @@
+@@ -12,41 +17,50 @@
}
+ public static ItemStack a(World world, double d0, double d1, byte b0, boolean flag, boolean flag1) {
+- ItemStack itemstack = new ItemStack(Items.FILLED_MAP, 1, world.b("map"));
++ World worldMain = world.getServer().getServer().worlds.get(0); // CraftBukkit - store reference to primary world
++ ItemStack itemstack = new ItemStack(Items.FILLED_MAP, 1, worldMain.b("map")); // CraftBukkit - use primary world for maps
+ String s = "map_" + itemstack.getData();
+ WorldMap worldmap = new WorldMap(s);
+
+- world.a(s, (PersistentBase) worldmap);
++ worldMain.a(s, (PersistentBase) worldmap); // CraftBukkit
+ worldmap.scale = b0;
+ worldmap.a(d0, d1, worldmap.scale);
+- worldmap.map = (byte) world.worldProvider.getDimensionManager().getDimensionID();
++ worldmap.map = (byte) ((WorldServer) world).dimension; // CraftBukkit - use bukkit dimension
+ worldmap.track = flag;
+ worldmap.unlimitedTracking = flag1;
+ worldmap.c();
++ org.bukkit.craftbukkit.event.CraftEventFactory.callEvent(new org.bukkit.event.server.MapInitializeEvent(worldmap.mapView)); // CraftBukkit
+ return itemstack;
+ }
+
+ @Nullable
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();
@@ -50,7 +71,7 @@
int i = 1 << worldmap.scale;
int j = worldmap.centerX;
int k = worldmap.centerZ;
-@@ -197,6 +209,7 @@
+@@ -308,6 +322,7 @@
protected static void a(ItemStack itemstack, World world, int i) {
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, world);
@@ -58,16 +79,18 @@
itemstack.setData(world.b("map"));
WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData());
-@@ -206,11 +219,16 @@
- worldmap1.map = worldmap.map;
- worldmap1.c();
- world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1);
-+ // CraftBukkit start
-+ MapInitializeEvent event = new MapInitializeEvent(worldmap1.mapView);
-+ Bukkit.getServer().getPluginManager().callEvent(event);
-+ // CraftBukkit end
- }
+@@ -318,6 +333,10 @@
+ worldmap1.map = worldmap.map;
+ worldmap1.c();
+ world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1);
++ // CraftBukkit start
++ MapInitializeEvent event = new MapInitializeEvent(worldmap1.mapView);
++ Bukkit.getServer().getPluginManager().callEvent(event);
++ // CraftBukkit end
+ }
+ }
+@@ -325,6 +344,7 @@
protected static void b(ItemStack itemstack, World world) {
WorldMap worldmap = Items.FILLED_MAP.getSavedMap(itemstack, world);
@@ -75,13 +98,14 @@
itemstack.setData(world.b("map"));
WorldMap worldmap1 = new WorldMap("map_" + itemstack.getData());
-@@ -221,5 +239,9 @@
- worldmap1.map = worldmap.map;
- worldmap1.c();
- world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1);
-+ // CraftBukkit start
-+ MapInitializeEvent event = new MapInitializeEvent(worldmap1.mapView);
-+ Bukkit.getServer().getPluginManager().callEvent(event);
-+ // CraftBukkit end
+@@ -336,6 +356,10 @@
+ worldmap1.map = worldmap.map;
+ worldmap1.c();
+ world.a("map_" + itemstack.getData(), (PersistentBase) worldmap1);
++ // CraftBukkit start
++ MapInitializeEvent event = new MapInitializeEvent(worldmap1.mapView);
++ Bukkit.getServer().getPluginManager().callEvent(event);
++ // CraftBukkit end
+ }
+
}
- }