mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Give BlockPistonRetractEvent a list of pulled blocks for sticky pistons
This commit is contained in:
parent
685a7d4b66
commit
cd94e3c9b0
1 changed files with 15 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
package org.bukkit.event.block;
|
package org.bukkit.event.block;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
|
@ -10,7 +11,9 @@ import org.bukkit.event.HandlerList;
|
||||||
*/
|
*/
|
||||||
public class BlockPistonRetractEvent extends BlockPistonEvent {
|
public class BlockPistonRetractEvent extends BlockPistonEvent {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
public BlockPistonRetractEvent(final Block block, final BlockFace direction) {
|
private List<Block> blocks;
|
||||||
|
|
||||||
|
public BlockPistonRetractEvent(final Block block, final List<Block> blocks, final BlockFace direction) {
|
||||||
super(block, direction);
|
super(block, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,10 +23,21 @@ public class BlockPistonRetractEvent extends BlockPistonEvent {
|
||||||
*
|
*
|
||||||
* @return The possible location of the possibly moving block.
|
* @return The possible location of the possibly moving block.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public Location getRetractLocation() {
|
public Location getRetractLocation() {
|
||||||
return getBlock().getRelative(getDirection(), 2).getLocation();
|
return getBlock().getRelative(getDirection(), 2).getLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an immutable list of the blocks which will be moved by the
|
||||||
|
* extending.
|
||||||
|
*
|
||||||
|
* @return Immutable list of the moved blocks.
|
||||||
|
*/
|
||||||
|
public List<Block> getBlocks() {
|
||||||
|
return blocks;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
|
|
Loading…
Add table
Reference in a new issue