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

@@ -1,6 +1,6 @@
package org.bukkit.event.entity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
@@ -12,14 +12,19 @@ public class FoodLevelChangeEvent extends EntityEvent implements Cancellable {
private boolean cancel = false;
private int level;
public FoodLevelChangeEvent(final Entity what, final int level) {
public FoodLevelChangeEvent(final HumanEntity what, final int level) {
super(what);
this.level = level;
}
@Override
public HumanEntity getEntity() {
return (HumanEntity) entity;
}
/**
* Gets the resultant food level that the entity involved in this event should be set to.
* <br /><br />
* <p />
* Where 20 is a full food bar and 0 is an empty one.
*
* @return The resultant food level