SPIGOT-6798: EntityChangeBlockEvent called with incorrect location

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-21 11:18:06 +11:00
parent 68ead41759
commit 99916e6058

View File

@@ -27,7 +27,7 @@
if (this.level.getType(blockposition1).a(Blocks.GRASS_BLOCK)) { if (this.level.getType(blockposition1).a(Blocks.GRASS_BLOCK)) {
- if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { - if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+ // CraftBukkit + // CraftBukkit
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.getBlockData(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) { + if (!CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.AIR.getBlockData(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)).isCancelled()) {
this.level.triggerEffect(2001, blockposition1, Block.getCombinedId(Blocks.GRASS_BLOCK.getBlockData())); this.level.triggerEffect(2001, blockposition1, Block.getCombinedId(Blocks.GRASS_BLOCK.getBlockData()));
this.level.setTypeAndData(blockposition1, Blocks.DIRT.getBlockData(), 2); this.level.setTypeAndData(blockposition1, Blocks.DIRT.getBlockData(), 2);
} }