mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 18:27:41 +01:00
b3a8254758
By: md_5 <git@md-5.net>
49 lines
3.3 KiB
Diff
49 lines
3.3 KiB
Diff
--- a/net/minecraft/world/level/block/BlockBamboo.java
|
|
+++ b/net/minecraft/world/level/block/BlockBamboo.java
|
|
@@ -187,7 +187,7 @@
|
|
BlockPosition blockposition1 = blockposition.up(i);
|
|
IBlockData iblockdata1 = worldserver.getType(blockposition1);
|
|
|
|
- if (k >= 16 || (Integer) iblockdata1.get(BlockBamboo.STAGE) == 1 || !worldserver.isEmpty(blockposition1.up())) {
|
|
+ if (k >= 16 || !iblockdata1.a(Blocks.BAMBOO) || (Integer) iblockdata1.get(BlockBamboo.STAGE) == 1 || !worldserver.isEmpty(blockposition1.up())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here
|
|
return;
|
|
}
|
|
|
|
@@ -208,14 +208,18 @@
|
|
BlockPosition blockposition1 = blockposition.down(2);
|
|
IBlockData iblockdata2 = world.getType(blockposition1);
|
|
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
|
|
+ boolean shouldUpdateOthers = false; // CraftBukkit
|
|
|
|
if (i >= 1) {
|
|
if (iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.LEAVES) != BlockPropertyBambooSize.NONE) {
|
|
if (iblockdata1.a(Blocks.BAMBOO) && iblockdata1.get(BlockBamboo.LEAVES) != BlockPropertyBambooSize.NONE) {
|
|
blockpropertybamboosize = BlockPropertyBambooSize.LARGE;
|
|
if (iblockdata2.a(Blocks.BAMBOO)) {
|
|
- world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.LEAVES, BlockPropertyBambooSize.SMALL), 3);
|
|
- world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.LEAVES, 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 {
|
|
@@ -226,7 +230,14 @@
|
|
int j = (Integer) iblockdata.get(BlockBamboo.AGE) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
|
|
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
|
|
|
- world.setTypeAndData(blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.AGE, j)).set(BlockBamboo.LEAVES, blockpropertybamboosize)).set(BlockBamboo.STAGE, k), 3);
|
|
+ // CraftBukkit start
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.AGE, j)).set(BlockBamboo.LEAVES, blockpropertybamboosize)).set(BlockBamboo.STAGE, k), 3)) {
|
|
+ if (shouldUpdateOthers) {
|
|
+ world.setTypeAndData(blockposition.down(), (IBlockData) iblockdata1.set(BlockBamboo.LEAVES, BlockPropertyBambooSize.SMALL), 3);
|
|
+ world.setTypeAndData(blockposition1, (IBlockData) iblockdata2.set(BlockBamboo.LEAVES, BlockPropertyBambooSize.NONE), 3);
|
|
+ }
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|
|
|
|
protected int a(IBlockAccess iblockaccess, BlockPosition blockposition) {
|