summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-12-26 21:29:47 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-12-26 21:29:47 +0000
commit4cd80238528284059c15b9877fb540eec893c3ed (patch)
tree2c4a7706d76eb04e23e37bbe9073a94fa66719c5
parentb3893963b707498eaa9986daab5b48467cc98816 (diff)
downloadcraftbukkit-4cd80238528284059c15b9877fb540eec893c3ed.tar
craftbukkit-4cd80238528284059c15b9877fb540eec893c3ed.tar.gz
craftbukkit-4cd80238528284059c15b9877fb540eec893c3ed.tar.lz
craftbukkit-4cd80238528284059c15b9877fb540eec893c3ed.tar.xz
craftbukkit-4cd80238528284059c15b9877fb540eec893c3ed.zip
SPIGOT-276: Force load chunks in Location2D fixes /spreadplayers
-rw-r--r--nms-patches/Location2D.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/nms-patches/Location2D.patch b/nms-patches/Location2D.patch
new file mode 100644
index 00000000..42149687
--- /dev/null
+++ b/nms-patches/Location2D.patch
@@ -0,0 +1,32 @@
+--- ../work/decompile-8eb82bde//net/minecraft/server/Location2D.java 2014-12-26 21:29:07.829484981 +0000
++++ src/main/java/net/minecraft/server/Location2D.java 2014-12-26 21:29:07.829484981 +0000
+@@ -68,7 +68,7 @@
+ }
+
+ blockposition = blockposition.down();
+- } while (world.getType(blockposition).getBlock().getMaterial() == Material.AIR);
++ } while (getType(world, blockposition).getBlock().getMaterial() == Material.AIR); // CraftBukkit
+
+ return blockposition.getY() + 1;
+ }
+@@ -84,7 +84,7 @@
+ }
+
+ blockposition = blockposition.down();
+- material = world.getType(blockposition).getBlock().getMaterial();
++ material = getType(world, blockposition).getBlock().getMaterial(); // CraftBukkit
+ } while (material == Material.AIR);
+
+ return !material.isLiquid() && material != Material.FIRE;
+@@ -94,4 +94,11 @@
+ this.a = MathHelper.a(random, d0, d2);
+ this.b = MathHelper.a(random, d1, d3);
+ }
++
++ // CraftBukkit start - add a version of getType which force loads chunks
++ private static IBlockData getType(World world, BlockPosition position) {
++ ((ChunkProviderServer) world.chunkProvider).getChunkAt(position.getX() >> 4, position.getZ() >> 4);
++ return world.getType(position);
++ }
++ // CraftBukkit end
+ }