@@ -27,31 +27,31 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -470,9 +481,13 @@
|
||||
@@ -474,9 +485,13 @@
|
||||
if (iblockdata2 != null) {
|
||||
iblockdata2 = Block.updateFromNeighbourShapes(iblockdata2, this.enderman.level, blockposition);
|
||||
if (this.canPlaceBlock(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||
+ // CraftBukkit start - Place event
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, iblockdata2).isCancelled()) {
|
||||
world.setBlock(blockposition, iblockdata2, 3);
|
||||
world.gameEvent(this.enderman, GameEvent.BLOCK_PLACE, blockposition);
|
||||
world.gameEvent(GameEvent.BLOCK_PLACE, blockposition, GameEvent.a.of(this.enderman, iblockdata2));
|
||||
this.enderman.setCarriedBlock((IBlockData) null);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -511,9 +526,13 @@
|
||||
@@ -515,9 +530,13 @@
|
||||
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
|
||||
|
||||
if (iblockdata.is(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
||||
- world.removeBlock(blockposition, false);
|
||||
- world.gameEvent(this.enderman, GameEvent.BLOCK_DESTROY, blockposition);
|
||||
- world.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.a.of(this.enderman, iblockdata));
|
||||
- this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());
|
||||
+ // CraftBukkit start - Pickup event
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
||||
+ world.removeBlock(blockposition, false);
|
||||
+ world.gameEvent(this.enderman, GameEvent.BLOCK_DESTROY, blockposition);
|
||||
+ world.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.a.of(this.enderman, iblockdata));
|
||||
+ this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
Reference in New Issue
Block a user