diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-11-30 11:53:31 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-11-30 11:59:29 -0600 |
commit | 1a6a828156ceea6ac404006851790cf6af18fb95 (patch) | |
tree | 84c5c0511d414bb54ebb268db609e76cfef1aa13 /src/main/java/org | |
parent | 9bd02495dfbd1d5cff9487c3b116ff0ef75c229d (diff) | |
download | craftbukkit-1a6a828156ceea6ac404006851790cf6af18fb95.tar craftbukkit-1a6a828156ceea6ac404006851790cf6af18fb95.tar.gz craftbukkit-1a6a828156ceea6ac404006851790cf6af18fb95.tar.lz craftbukkit-1a6a828156ceea6ac404006851790cf6af18fb95.tar.xz craftbukkit-1a6a828156ceea6ac404006851790cf6af18fb95.zip |
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.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 73945848..a840111f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -441,29 +441,31 @@ public class CraftEventFactory { return event; } - public static EntityChangeBlockEvent callEntityChangeBlockEvent(org.bukkit.entity.Entity entity, Block block, Material material) { - EntityChangeBlockEvent event = new EntityChangeBlockEvent((LivingEntity) entity, block, material); - entity.getServer().getPluginManager().callEvent(event); - return event; - } - public static PigZapEvent callPigZapEvent(Entity pig, Entity lightning, Entity pigzombie) { PigZapEvent event = new PigZapEvent((Pig) pig.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), (PigZombie) pigzombie.getBukkitEntity()); pig.getBukkitEntity().getServer().getPluginManager().callEvent(event); return event; } + public static EntityChangeBlockEvent callEntityChangeBlockEvent(org.bukkit.entity.Entity entity, Block block, Material material) { + return callEntityChangeBlockEvent(entity, block, material, 0); + } + public static EntityChangeBlockEvent callEntityChangeBlockEvent(Entity entity, Block block, Material material) { - EntityChangeBlockEvent event = new EntityChangeBlockEvent((LivingEntity) entity.getBukkitEntity(), block, material); - entity.getBukkitEntity().getServer().getPluginManager().callEvent(event); - return event; + return callEntityChangeBlockEvent(entity.getBukkitEntity(), block, material, 0); } - public static EntityChangeBlockEvent callEntityChangeBlockEvent(Entity entity, int x, int y, int z, int type) { + public static EntityChangeBlockEvent callEntityChangeBlockEvent(Entity entity, int x, int y, int z, int type, int data) { Block block = entity.world.getWorld().getBlockAt(x, y, z); Material material = Material.getMaterial(type); - return callEntityChangeBlockEvent(entity, block, material); + return callEntityChangeBlockEvent(entity.getBukkitEntity(), block, material, data); + } + + public static EntityChangeBlockEvent callEntityChangeBlockEvent(org.bukkit.entity.Entity entity, Block block, Material material, int data) { + EntityChangeBlockEvent event = new EntityChangeBlockEvent((LivingEntity) entity, block, material, (byte) data); + entity.getServer().getPluginManager().callEvent(event); + return event; } public static CreeperPowerEvent callCreeperPowerEvent(Entity creeper, Entity lightning, CreeperPowerEvent.PowerCause cause) { |