SPIGOT-6398: Fix crash when bonemealing bamboo and the BlockSpreadEvent is cancelled

By: Brokkonaut <hannos17@gmx.de>
This commit is contained in:
CraftBukkit/Spigot 2021-03-20 09:01:18 +11:00
parent cdb7cb852f
commit 90df44b39a

View file

@ -1,5 +1,14 @@
--- a/net/minecraft/world/level/block/BlockBamboo.java
+++ b/net/minecraft/world/level/block/BlockBamboo.java
@@ -174,7 +174,7 @@
BlockPosition blockposition1 = blockposition.up(i);
IBlockData iblockdata1 = worldserver.getType(blockposition1);
- if (k >= 16 || (Integer) iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) {
+ if (k >= 16 || !iblockdata1.a(Blocks.BAMBOO) || (Integer) iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) { // CraftBukkit - If the BlockSpreadEvent was cancelled, we have no bamboo here
return;
}
@@ -195,14 +195,18 @@
BlockPosition blockposition1 = blockposition.down(2);
IBlockData iblockdata2 = world.getType(blockposition1);