diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java index 5bcc2941..35f4148b 100644 --- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java +++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java @@ -1,5 +1,6 @@ package org.bukkit.event.entity; +import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.Projectile; import org.bukkit.event.HandlerList; @@ -10,14 +11,24 @@ import org.bukkit.event.HandlerList; public class ProjectileHitEvent extends EntityEvent { private static final HandlerList handlers = new HandlerList(); private final Entity hitEntity; + private final Block hitBlock; public ProjectileHitEvent(final Projectile projectile) { - this(projectile, null); + this(projectile, null, null); } public ProjectileHitEvent(final Projectile projectile, Entity hitEntity) { + this(projectile, hitEntity, null); + } + + public ProjectileHitEvent(final Projectile projectile, Block hitBlock) { + this(projectile, null, hitBlock); + } + + public ProjectileHitEvent(final Projectile projectile, Entity hitEntity, Block hitBlock) { super(projectile); this.hitEntity = hitEntity; + this.hitBlock = hitBlock; } @Override @@ -26,6 +37,15 @@ public class ProjectileHitEvent extends EntityEvent { } /** + * Gets the block that was hit, if it was a block that was hit. + * + * @return hit block or else null + */ + public Block getHitBlock() { + return hitBlock; + } + + /** * Gets the entity that was hit, if it was an entity that was hit. * * @return hit entity or else null |