@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/net/minecraft/server/EntityEnderman.java
|
||||
@@ -44,7 +44,17 @@
|
||||
}
|
||||
@@ -51,7 +51,17 @@
|
||||
|
||||
@Override
|
||||
public void setGoalTarget(@Nullable EntityLiving entityliving) {
|
||||
- super.setGoalTarget(entityliving);
|
||||
+ // CraftBukkit start - fire event
|
||||
@@ -19,33 +19,33 @@
|
||||
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
|
||||
if (entityliving == null) {
|
||||
@@ -58,6 +68,7 @@
|
||||
attributeinstance.b(EntityEnderman.b);
|
||||
@@ -65,6 +75,7 @@
|
||||
attributeinstance.b(EntityEnderman.c);
|
||||
}
|
||||
}
|
||||
+ return true;
|
||||
|
||||
}
|
||||
|
||||
@@ -276,8 +287,12 @@
|
||||
boolean flag = movingobjectposition != null && movingobjectposition.getBlockPosition().equals(blockposition);
|
||||
@@ -294,8 +305,12 @@
|
||||
boolean flag = movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && movingobjectpositionblock.getBlockPosition().equals(blockposition);
|
||||
|
||||
if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
||||
- this.enderman.setCarried(iblockdata);
|
||||
- world.setAir(blockposition);
|
||||
- world.a(blockposition, false);
|
||||
+ // CraftBukkit start - Pickup event
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
+ this.enderman.setCarried(iblockdata);
|
||||
+ world.setAir(blockposition);
|
||||
+ world.a(blockposition, false);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -307,8 +322,12 @@
|
||||
@@ -328,8 +343,12 @@
|
||||
IBlockData iblockdata2 = this.a.getCarried();
|
||||
|
||||
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1)) {
|
||||
if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||
+ // CraftBukkit start - Place event
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.a, blockposition, iblockdata2).isCancelled()) {
|
||||
world.setTypeAndData(blockposition, iblockdata2, 3);
|
||||
|
||||
Reference in New Issue
Block a user