summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java
blob: d57fc6b75c71a8741ccff01349d01596a09189dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.bukkit.event.block;

import org.bukkit.Location;
import org.bukkit.block.Block;

public class BlockPistonRetractEvent extends BlockPistonEvent {
    public BlockPistonRetractEvent(Block block) {
        super(Type.BLOCK_PISTON_RETRACT, block);
    }

    /**
     * Gets the location where the possible moving block might be if the retracting
     * piston is sticky.
     *
     * @return The possible location of the possibly moving block.
     */
    public Location getRetractLocation() {
        return getBlock().getRelative(getDirection(), 2).getLocation();
    }
}