Fix new block data for EntityChangeBlockEvent
Also standardizes how to handle EntityChangeBlockEvent before a removeBlock or destroyBlock call. Always use 'state.getFluidState().createLegacyBlock()' to get the new state instead of just using the 'air' state. Also fixes the new block data for EntityBreakDoorEvent (a sub-event from EntityChangeBlockEvent) Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
|
||||
if (WitherBoss.canDestroy(iblockdata)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) {
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state
|
||||
+ continue;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
Reference in New Issue
Block a user