2019-04-26 06:56:59 +02:00
|
|
|
--- a/net/minecraft/server/BlockBamboo.java
|
|
|
|
+++ b/net/minecraft/server/BlockBamboo.java
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -168,14 +168,18 @@
|
2019-04-26 06:56:59 +02:00
|
|
|
BlockPosition blockposition1 = blockposition.down(2);
|
|
|
|
IBlockData iblockdata2 = world.getType(blockposition1);
|
|
|
|
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
|
|
|
|
+ boolean shouldUpdateOthers = false; // CraftBukkit
|
|
|
|
|
|
|
|
if (i >= 1) {
|
2020-06-25 02:00:00 +02:00
|
|
|
if (iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.e) != BlockPropertyBambooSize.NONE) {
|
|
|
|
if (iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.e) != BlockPropertyBambooSize.NONE) {
|
2019-04-26 06:56:59 +02:00
|
|
|
blockpropertybamboosize = BlockPropertyBambooSize.LARGE;
|
2020-06-25 02:00:00 +02:00
|
|
|
if (iblockdata2.a(Blocks.BAMBOO)) {
|
2019-04-26 06:56:59 +02:00
|
|
|
- world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3);
|
|
|
|
- world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3);
|
|
|
|
+ // CraftBukkit start - moved down
|
|
|
|
+ // world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3);
|
|
|
|
+ // world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3);
|
|
|
|
+ shouldUpdateOthers = true;
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -186,7 +190,14 @@
|
|
|
|
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
|
2019-04-26 06:56:59 +02:00
|
|
|
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
|
|
|
|
|
|
|
- world.setTypeAndData(blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3)) {
|
|
|
|
+ if (shouldUpdateOthers) {
|
|
|
|
+ world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.e, BlockPropertyBambooSize.SMALL), 3);
|
|
|
|
+ world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.e, BlockPropertyBambooSize.NONE), 3);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
|
|
|
protected int a(IBlockAccess iblockaccess, BlockPosition blockposition) {
|