001 package org.bukkit.event.entity;
002
003 import org.bukkit.DyeColor;
004 import org.bukkit.entity.Sheep;
005 import org.bukkit.event.Cancellable;
006 import org.bukkit.event.HandlerList;
007
008 /**
009 * Called when a sheep's wool is dyed
010 */
011 public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
012 private static final HandlerList handlers = new HandlerList();
013 private boolean cancel;
014 private DyeColor color;
015
016 public SheepDyeWoolEvent(final Sheep sheep, final DyeColor color) {
017 super(sheep);
018 this.cancel = false;
019 this.color = color;
020 }
021
022 public boolean isCancelled() {
023 return cancel;
024 }
025
026 public void setCancelled(boolean cancel) {
027 this.cancel = cancel;
028 }
029
030 @Override
031 public Sheep getEntity() {
032 return (Sheep) entity;
033 }
034
035 /**
036 * Gets the DyeColor the sheep is being dyed
037 *
038 * @return the DyeColor the sheep is being dyed
039 */
040 public DyeColor getColor() {
041 return color;
042 }
043
044 /**
045 * Sets the DyeColor the sheep is being dyed
046 *
047 * @param color the DyeColor the sheep will be dyed
048 */
049 public void setColor(DyeColor color) {
050 this.color = color;
051 }
052
053 @Override
054 public HandlerList getHandlers() {
055 return handlers;
056 }
057
058 public static HandlerList getHandlerList() {
059 return handlers;
060 }
061
062 }