Narrowed down the return type of most EntityEvent subclasses for convenience. Addresses BUKKIT-809

This commit is contained in:
TomyLobo
2012-02-28 04:59:09 -06:00
committed by EvilSeph
parent 6c7fb871c5
commit 2e12e3ec8a
18 changed files with 139 additions and 52 deletions

View File

@@ -2,7 +2,7 @@ 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;
@@ -17,13 +17,18 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private final Material to;
public EntityChangeBlockEvent(final Entity what, final Block block, final Material to) {
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
super(what);
this.block = block;
this.cancel = false;
this.to = to;
}
@Override
public LivingEntity getEntity() {
return (LivingEntity) entity;
}
/**
* Gets the block the entity is changing
*