Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
SheepDyeWoolEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.DyeColor;
4 import org.bukkit.entity.Sheep;
7 
8 /**
9  * Called when a sheep's wool is dyed
10  */
11 public class SheepDyeWoolEvent extends EntityEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancel;
14  private DyeColor color;
15 
16  public SheepDyeWoolEvent(final Sheep sheep, final DyeColor color) {
17  super(sheep);
18  this.cancel = false;
19  this.color = color;
20  }
21 
22  public boolean isCancelled() {
23  return cancel;
24  }
25 
26  public void setCancelled(boolean cancel) {
27  this.cancel = cancel;
28  }
29 
30  @Override
31  public Sheep getEntity() {
32  return (Sheep) entity;
33  }
34 
35  /**
36  * Gets the DyeColor the sheep is being dyed
37  *
38  * @return the DyeColor the sheep is being dyed
39  */
40  public DyeColor getColor() {
41  return color;
42  }
43 
44  /**
45  * Sets the DyeColor the sheep is being dyed
46  *
47  * @param color the DyeColor the sheep will be dyed
48  */
49  public void setColor(DyeColor color) {
50  this.color = color;
51  }
52 
53  @Override
54  public HandlerList getHandlers() {
55  return handlers;
56  }
57 
58  public static HandlerList getHandlerList() {
59  return handlers;
60  }
61 
62 }