1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
--- a/net/minecraft/server/EntityEnderman.java
+++ b/net/minecraft/server/EntityEnderman.java
@@ -306,8 +306,12 @@
boolean flag = movingobjectposition != null && movingobjectposition.a().equals(blockposition);
if (EntityEnderman.c.contains(block) && flag) {
- this.enderman.setCarried(iblockdata);
- world.setAir(blockposition);
+ // CraftBukkit start - Pickup event
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, this.enderman.world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), org.bukkit.Material.AIR).isCancelled()) {
+ this.enderman.setCarried(iblockdata);
+ world.setAir(blockposition);
+ }
+ // CraftBukkit end
}
}
@@ -337,8 +341,12 @@
IBlockData iblockdata2 = this.a.getCarried();
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2.getBlock(), iblockdata, iblockdata1)) {
+ // CraftBukkit start - Place event
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this.a.getCarried().getBlock(), this.a.getCarried().getBlock().toLegacyData(this.a.getCarried())).isCancelled()) {
world.setTypeAndData(blockposition, iblockdata2, 3);
this.a.setCarried((IBlockData) null);
+ }
+ // CraftBukkit end
}
}
|