001    package org.bukkit.event.player;
002    
003    import org.bukkit.entity.Entity;
004    import org.bukkit.entity.Player;
005    import org.bukkit.event.Cancellable;
006    import org.bukkit.event.HandlerList;
007    
008    /**
009     * Called when a player shears an entity
010     */
011    public class PlayerShearEntityEvent extends PlayerEvent implements Cancellable {
012        private static final HandlerList handlers = new HandlerList();
013        private boolean cancel;
014        private final Entity what;
015    
016        public PlayerShearEntityEvent(final Player who, final Entity what) {
017            super(who);
018            this.cancel = false;
019            this.what = what;
020        }
021    
022        public boolean isCancelled() {
023            return cancel;
024        }
025    
026        public void setCancelled(boolean cancel) {
027            this.cancel = cancel;
028        }
029    
030        /**
031         * Gets the entity the player is shearing
032         *
033         * @return the entity the player is shearing
034         */
035        public Entity getEntity() {
036            return what;
037        }
038    
039        @Override
040        public HandlerList getHandlers() {
041            return handlers;
042        }
043    
044        public static HandlerList getHandlerList() {
045            return handlers;
046        }
047    
048    }