001 package org.bukkit.event.block;
002
003 import org.bukkit.Location;
004 import org.bukkit.block.Block;
005 import org.bukkit.block.BlockFace;
006 import org.bukkit.event.HandlerList;
007
008 /**
009 * Called when a piston retracts
010 */
011 public class BlockPistonRetractEvent extends BlockPistonEvent {
012 private static final HandlerList handlers = new HandlerList();
013 public BlockPistonRetractEvent(final Block block, final BlockFace direction) {
014 super(block, direction);
015 }
016
017 /**
018 * Gets the location where the possible moving block might be if the
019 * retracting piston is sticky.
020 *
021 * @return The possible location of the possibly moving block.
022 */
023 public Location getRetractLocation() {
024 return getBlock().getRelative(getDirection(), 2).getLocation();
025 }
026
027 @Override
028 public HandlerList getHandlers() {
029 return handlers;
030 }
031
032 public static HandlerList getHandlerList() {
033 return handlers;
034 }
035 }