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,7 +1,7 @@
package org.bukkit.event.entity;
import org.bukkit.DyeColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Sheep;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
@@ -13,8 +13,8 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private DyeColor color;
public SheepDyeWoolEvent(final Entity what, final DyeColor color) {
super(what);
public SheepDyeWoolEvent(final Sheep sheep, final DyeColor color) {
super(sheep);
this.cancel = false;
this.color = color;
}
@@ -27,6 +27,11 @@ public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
this.cancel = cancel;
}
@Override
public Sheep getEntity() {
return (Sheep) entity;
}
/**
* Gets the DyeColor the sheep is being dyed
*