summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-09-25 14:34:05 +1000
committermd_5 <git@md-5.net>2018-09-25 14:34:05 +1000
commit020b495274c324208721de841671298060d93987 (patch)
treeec1d435b6dc422b022b16291dac73969dacf8e9b /nms-patches
parentc1ecaa2ff772cb60bc8842267d3649564c21738c (diff)
downloadcraftbukkit-020b495274c324208721de841671298060d93987.tar
craftbukkit-020b495274c324208721de841671298060d93987.tar.gz
craftbukkit-020b495274c324208721de841671298060d93987.tar.lz
craftbukkit-020b495274c324208721de841671298060d93987.tar.xz
craftbukkit-020b495274c324208721de841671298060d93987.zip
SPIGOT-4392: Stem updates even if BlockGrowEvent cancelled
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/BlockStem.patch10
1 files changed, 7 insertions, 3 deletions
diff --git a/nms-patches/BlockStem.patch b/nms-patches/BlockStem.patch
index cc24741d..6b2a498b 100644
--- a/nms-patches/BlockStem.patch
+++ b/nms-patches/BlockStem.patch
@@ -9,7 +9,7 @@
public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.W;
-@@ -33,14 +35,14 @@
+@@ -33,14 +35,18 @@
if (i < 7) {
iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, Integer.valueOf(i + 1));
@@ -22,11 +22,15 @@
if (world.getType(blockposition1).isAir() && (block == Blocks.FARMLAND || block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL || block == Blocks.GRASS_BLOCK)) {
- world.setTypeUpdate(blockposition1, this.blockFruit.getBlockData());
-+ CraftEventFactory.handleBlockGrowEvent(world, blockposition1, this.blockFruit.getBlockData()); // CraftBukkit
++ // CraftBukkit start
++ if (!CraftEventFactory.handleBlockGrowEvent(world, blockposition1, this.blockFruit.getBlockData())) {
++ return;
++ }
++ // CraftBukkit end
world.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.e().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection));
}
}
-@@ -94,7 +96,7 @@
+@@ -94,7 +100,7 @@
int i = Math.min(7, ((Integer) iblockdata.get(BlockStem.AGE)).intValue() + MathHelper.nextInt(world.random, 2, 5));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, Integer.valueOf(i));