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

This commit is contained in:
Brokkonaut 2021-03-20 09:01:18 +11:00 committed by md_5
parent 9c32a8794c
commit 7eb35643e2
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -1,5 +1,14 @@
--- a/net/minecraft/world/level/block/BlockBamboo.java --- a/net/minecraft/world/level/block/BlockBamboo.java
+++ b/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 @@ @@ -195,14 +195,18 @@
BlockPosition blockposition1 = blockposition.down(2); BlockPosition blockposition1 = blockposition.down(2);
IBlockData iblockdata2 = world.getType(blockposition1); IBlockData iblockdata2 = world.getType(blockposition1);