Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerShearEntityEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Entity;
4 import org.bukkit.entity.Player;
7 
8 /**
9  * Called when a player shears an entity
10  */
11 public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancel;
14  private final Entity what;
15 
16  public PlayerShearEntityEvent(final Player who, final Entity what) {
17  super(who);
18  this.cancel = false;
19  this.what = what;
20  }
21 
22  public boolean isCancelled() {
23  return cancel;
24  }
25 
26  public void setCancelled(boolean cancel) {
27  this.cancel = cancel;
28  }
29 
30  /**
31  * Gets the entity the player is shearing
32  *
33  * @return the entity the player is shearing
34  */
35  public Entity getEntity() {
36  return what;
37  }
38 
39  @Override
40  public HandlerList getHandlers() {
41  return handlers;
42  }
43 
44  public static HandlerList getHandlerList() {
45  return handlers;
46  }
47 
48 }