summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-12-13 14:28:34 +1100
committermd_5 <git@md-5.net>2018-12-13 14:28:34 +1100
commitb446cb5d744836d3de6288da0ef5761dc127a78a (patch)
treef67ab8c93f8eabe7e5a283e235810e79ee935764
parent6ec8ea5cf4f8db20562abdead706982d4e842943 (diff)
downloadcraftbukkit-b446cb5d744836d3de6288da0ef5761dc127a78a.tar
craftbukkit-b446cb5d744836d3de6288da0ef5761dc127a78a.tar.gz
craftbukkit-b446cb5d744836d3de6288da0ef5761dc127a78a.tar.lz
craftbukkit-b446cb5d744836d3de6288da0ef5761dc127a78a.tar.xz
craftbukkit-b446cb5d744836d3de6288da0ef5761dc127a78a.zip
SPIGOT-4527: Fix sponges with waterlogged blocks
-rw-r--r--nms-patches/BlockSponge.patch16
1 files changed, 11 insertions, 5 deletions
diff --git a/nms-patches/BlockSponge.patch b/nms-patches/BlockSponge.patch
index a2e22a37..f6f58628 100644
--- a/nms-patches/BlockSponge.patch
+++ b/nms-patches/BlockSponge.patch
@@ -46,12 +46,12 @@
++i;
if (j < 6) {
linkedlist.add(new Tuple(blockposition2, j + 1));
-@@ -75,6 +82,31 @@
+@@ -75,6 +82,37 @@
break;
}
}
+ // CraftBukkit start
-+ List<CraftBlockState> blocks = blockList.getList();
++ List<CraftBlockState> blocks = blockList.getList(); // Is a clone
+ if (!blocks.isEmpty()) {
+ final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+
@@ -65,12 +65,18 @@
+ for (CraftBlockState block : blocks) {
+ BlockPosition blockposition2 = new BlockPosition(block.getX(), block.getY(), block.getZ());
+ IBlockData iblockdata = world.getType(blockposition2);
++ Fluid fluid = world.getFluid(blockposition2);
+ Material material = iblockdata.getMaterial();
+
-+ if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
-+ iblockdata.a(world, blockposition2, 0);
++ if (fluid.a(TagsFluid.WATER)) {
++ if (iblockdata.getBlock() instanceof IFluidSource && ((IFluidSource) iblockdata.getBlock()).a(blockList, blockposition2, iblockdata) != FluidTypes.a) {
++ // NOP
++ } else if (iblockdata.getBlock() instanceof BlockFluids) {
++ // NOP
++ } else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
++ iblockdata.a(world, blockposition2, 0);
++ }
+ }
-+
+ world.setTypeAndData(blockposition2, block.getHandle(), block.getFlag());
+ }
+ }