mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 12:41:50 +01:00
SPIGOT-1605: Fix EntityChangeBlockEvent.setCancelled(Z)V
This commit is contained in:
parent
b0411e8799
commit
2fe69605ec
1 changed files with 5 additions and 3 deletions
|
@ -18,11 +18,13 @@
|
|||
this.world.setAir(blockposition);
|
||||
} else if (!this.world.isClientSide) {
|
||||
this.die();
|
||||
@@ -94,6 +96,12 @@
|
||||
@@ -93,7 +95,13 @@
|
||||
if (iblockdata.getBlock() != Blocks.PISTON_EXTENSION) {
|
||||
this.die();
|
||||
if (!this.f) {
|
||||
if (this.world.a(block, blockposition, true, EnumDirection.UP, (Entity) null, (ItemStack) null) && !BlockFalling.i(this.world.getType(blockposition.down())) && this.world.setTypeAndData(blockposition, this.block, 3)) {
|
||||
+ // CraftBukkit start
|
||||
- if (this.world.a(block, blockposition, true, EnumDirection.UP, (Entity) null, (ItemStack) null) && !BlockFalling.i(this.world.getType(blockposition.down())) && this.world.setTypeAndData(blockposition, this.block, 3)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (this.world.a(block, blockposition, true, EnumDirection.UP, (Entity) null, (ItemStack) null) && !BlockFalling.i(this.world.getType(blockposition.down()))) {
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this.block.getBlock(), this.block.getBlock().toLegacyData(this.block)).isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
|
|
Loading…
Reference in a new issue