Add data values to EntityChangeBlockEvent. Adds BUKKIT-3077, BUKKIT-3076

This change affects Endermen and Silverfish, adding a data value for the block change event.
This commit is contained in:
Wesley Wolfe
2012-11-30 11:53:31 -06:00
parent 9bd02495df
commit 1a6a828156
3 changed files with 17 additions and 17 deletions

View File

@@ -120,9 +120,7 @@ public class EntityEnderman extends EntityMonster {
if (l == 0 && i1 > 0 && Block.byId[i1].b()) {
// CraftBukkit start - place event
org.bukkit.block.Block bblock = this.world.getWorld().getBlockAt(i, j, k);
if (!CraftEventFactory.callEntityChangeBlockEvent(this, bblock, this.getCarriedId()).isCancelled()) {
if (!CraftEventFactory.callEntityChangeBlockEvent(this, i, j, k, this.getCarriedId(), this.getCarriedData()).isCancelled()) {
this.world.setTypeIdAndData(i, j, k, this.getCarriedId(), this.getCarriedData());
this.setCarriedId(0);
}

View File

@@ -94,7 +94,7 @@ public class EntitySilverfish extends EntityMonster {
if (k1 == Block.MONSTER_EGGS.id) {
// CraftBukkit start
if (CraftEventFactory.callEntityChangeBlockEvent(this, i + i1, j + l, k + j1, 0).isCancelled()) {
if (CraftEventFactory.callEntityChangeBlockEvent(this, i + i1, j + l, k + j1, 0, 0).isCancelled()) {
continue;
}
// CraftBukkit end
@@ -122,7 +122,7 @@ public class EntitySilverfish extends EntityMonster {
l = this.world.getTypeId(i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1]);
if (BlockMonsterEggs.e(l)) {
// CraftBukkit start
if (CraftEventFactory.callEntityChangeBlockEvent(this, i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1], Block.MONSTER_EGGS.id).isCancelled()) {
if (CraftEventFactory.callEntityChangeBlockEvent(this, i + Facing.b[l1], j + Facing.c[l1], k + Facing.d[l1], Block.MONSTER_EGGS.id, BlockMonsterEggs.f(l)).isCancelled()) {
return;
}
// CraftBukkit end