diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java | 7 | ||||
-rw-r--r-- | src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java | 27 |
2 files changed, 24 insertions, 10 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java b/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java index 8e39c03c..263837a6 100644 --- a/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java @@ -12,6 +12,11 @@ import org.bukkit.entity.LivingEntity; */ public class EntityBreakDoorEvent extends EntityChangeBlockEvent { public EntityBreakDoorEvent(final LivingEntity entity, final Block targetBlock) { - super(entity, targetBlock, Material.AIR); + super(entity, targetBlock, Material.AIR, (byte) 0); + } + + @Override + public LivingEntity getEntity() { + return (LivingEntity) entity; } } diff --git a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java index d2b03f48..a18d11f9 100644 --- a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java @@ -2,14 +2,13 @@ package org.bukkit.event.entity; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; /** - * Called when a LivingEntity changes a block - * - * This event specifically excludes player entities + * Called when any Entity, excluding players, changes a block. */ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); @@ -18,11 +17,26 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { private final Material to; private final byte data; + /** + * + * @param what the LivingEntity causing the change + * @param block the block (before the change) + * @param to the future material being changed to + * @deprecated Provided as a backward compatibility before the data byte was provided, and type increased to all entities + */ + @Deprecated public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) { this (what, block, to, (byte) 0); } - public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to, final byte data) { + /** + * + * @param what the Entity causing the change + * @param block the block (before the change) + * @param to the future material being changed to + * @param data the future block data + */ + public EntityChangeBlockEvent(final Entity what, final Block block, final Material to, final byte data) { super(what); this.block = block; this.cancel = false; @@ -30,11 +44,6 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable { this.data = data; } - @Override - public LivingEntity getEntity() { - return (LivingEntity) entity; - } - /** * Gets the block the entity is changing * |