SPIGOT-6798: EntityChangeBlockEvent called with incorrect location
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user