summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemWorldMap.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-26 12:00:00 +1000
committermd_5 <git@md-5.net>2018-08-26 12:00:00 +1000
commitce1af0c348a8477f9ec58d79e6267e9226dc5dba (patch)
tree369972a692f450001c06a13e202d916f9c1bb5a8 /nms-patches/ItemWorldMap.patch
parent162bda93ff76fe96a6138a14176807f21a6ddef4 (diff)
downloadcraftbukkit-ce1af0c348a8477f9ec58d79e6267e9226dc5dba.tar
craftbukkit-ce1af0c348a8477f9ec58d79e6267e9226dc5dba.tar.gz
craftbukkit-ce1af0c348a8477f9ec58d79e6267e9226dc5dba.tar.lz
craftbukkit-ce1af0c348a8477f9ec58d79e6267e9226dc5dba.tar.xz
craftbukkit-ce1af0c348a8477f9ec58d79e6267e9226dc5dba.zip
Update to Minecraft 1.13.1
Diffstat (limited to 'nms-patches/ItemWorldMap.patch')
-rw-r--r--nms-patches/ItemWorldMap.patch30
1 files changed, 15 insertions, 15 deletions
diff --git a/nms-patches/ItemWorldMap.patch b/nms-patches/ItemWorldMap.patch
index 237da62e..f7257b1d 100644
--- a/nms-patches/ItemWorldMap.patch
+++ b/nms-patches/ItemWorldMap.patch
@@ -16,7 +16,7 @@
public static ItemStack a(World world, int i, int j, byte b0, boolean flag, boolean flag1) {
ItemStack itemstack = new ItemStack(Items.FILLED_MAP);
-- a(itemstack, world, i, j, b0, flag, flag1, world.worldProvider.getDimensionManager().getDimensionID());
+- a(itemstack, world, i, j, b0, flag, flag1, world.worldProvider.getDimensionManager());
+ a(itemstack, world, i, j, b0, flag, flag1, ((WorldServer) world).dimension); // CraftBukkit - fixes Bukkit multiworld maps
return itemstack;
}
@@ -25,7 +25,7 @@
WorldMap worldmap = a((GeneratorAccess) world, "map_" + e(itemstack));
if (worldmap == null && !world.isClientSide) {
-- worldmap = a(itemstack, world, world.getWorldData().b(), world.getWorldData().d(), 3, false, false, world.worldProvider.getDimensionManager().getDimensionID());
+- worldmap = a(itemstack, world, world.getWorldData().b(), world.getWorldData().d(), 3, false, false, world.worldProvider.getDimensionManager());
+ worldmap = a(itemstack, world, world.getWorldData().b(), world.getWorldData().d(), 3, false, false, ((WorldServer) world).dimension); // CraftBukkit - fixes Bukkit multiworld maps
}
@@ -38,16 +38,16 @@
+ return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
}
- private static WorldMap a(ItemStack itemstack, World world, int i, int j, int k, boolean flag, boolean flag1, int l) {
-- int i1 = world.b("map");
-+ World worldMain = world.getServer().getServer().worlds.get(0); // CraftBukkit - store reference to primary world
-+ int i1 = worldMain.b("map"); // CraftBukkit - use primary world for maps
- WorldMap worldmap = new WorldMap("map_" + i1);
+ private static WorldMap a(ItemStack itemstack, World world, int i, int j, int k, boolean flag, boolean flag1, DimensionManager dimensionmanager) {
+- int l = world.a(DimensionManager.OVERWORLD, "map");
++ World worldMain = world.getServer().getServer().getWorldServer(DimensionManager.OVERWORLD); // CraftBukkit - store reference to primary world
++ int l = worldMain.a(DimensionManager.OVERWORLD, "map"); // CraftBukkit - use primary world for maps
+ WorldMap worldmap = new WorldMap("map_" + l);
- worldmap.a(i, j, k, flag, flag1, l);
-- world.a(worldmap.getId(), (PersistentBase) worldmap);
-+ worldMain.a(worldmap.getId(), (PersistentBase) worldmap); // CraftBukkit - use primary world for maps
- itemstack.getOrCreateTag().setInt("map", i1);
+ worldmap.a(i, j, k, flag, flag1, dimensionmanager);
+- world.a(DimensionManager.OVERWORLD, worldmap.getId(), (PersistentBase) worldmap);
++ worldMain.a(DimensionManager.OVERWORLD, worldmap.getId(), (PersistentBase) worldmap); // CraftBukkit - use primary world for maps
+ itemstack.getOrCreateTag().setInt("map", l);
+
+ // CraftBukkit start
+ MapInitializeEvent event = new MapInitializeEvent(worldmap.mapView);
@@ -58,9 +58,9 @@
@Nullable
public static WorldMap a(GeneratorAccess generatoraccess, String s) {
-- return (WorldMap) generatoraccess.a(WorldMap::new, s);
+- return (WorldMap) generatoraccess.a(DimensionManager.OVERWORLD, WorldMap::new, s);
+ // CraftBukkit start - use primary world for maps and call event
-+ WorldMap worldmap = (WorldMap) MinecraftServer.getServer().worlds.get(0).a((id) -> {
++ WorldMap worldmap = (WorldMap) MinecraftServer.getServer().getWorldServer(DimensionManager.OVERWORLD).a(DimensionManager.OVERWORLD, (id) -> {
+ // We only get here when the data file exists, but is not a valid map
+ WorldMap newMap = new WorldMap(id);
+ MapInitializeEvent event = new MapInitializeEvent(newMap.mapView);
@@ -72,7 +72,7 @@
}
public void a(World world, Entity entity, WorldMap worldmap) {
-- if (world.worldProvider.getDimensionManager().getDimensionID() == worldmap.map && entity instanceof EntityHuman) {
+- if (world.worldProvider.getDimensionManager() == worldmap.map && entity instanceof EntityHuman) {
+ // CraftBukkit - world.worldProvider -> ((WorldServer) world)
+ if (((WorldServer) world).dimension == worldmap.map && entity instanceof EntityHuman) {
int i = 1 << worldmap.scale;
@@ -82,7 +82,7 @@
WorldMap worldmap = getSavedMap(itemstack, world);
if (worldmap != null) {
-- if (world.worldProvider.getDimensionManager().getDimensionID() == worldmap.map) {
+- if (world.worldProvider.getDimensionManager() == worldmap.map) {
+ // CraftBukkit - world.worldProvider -> ((WorldServer) world)
+ if (((WorldServer) world).dimension == worldmap.map) {
int i = 1 << worldmap.scale;