From 0b63ec04614b2e2fbc0a8ea074b2bed4da9d9ca8 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 19 Jan 2015 23:28:15 +0000 Subject: [PATCH] Give BlockPistonRetractEvent a list of pulled blocks for sticky pistons By: Thinkofdeath --- .../event/block/BlockPistonRetractEvent.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/paper-api/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java index 0190c4c424..da875f7a71 100644 --- a/paper-api/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java @@ -1,5 +1,6 @@ package org.bukkit.event.block; +import java.util.List; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -10,7 +11,9 @@ import org.bukkit.event.HandlerList; */ public class BlockPistonRetractEvent extends BlockPistonEvent { private static final HandlerList handlers = new HandlerList(); - public BlockPistonRetractEvent(final Block block, final BlockFace direction) { + private List blocks; + + public BlockPistonRetractEvent(final Block block, final List blocks, final BlockFace direction) { super(block, direction); } @@ -20,9 +23,20 @@ public class BlockPistonRetractEvent extends BlockPistonEvent { * * @return The possible location of the possibly moving block. */ + @Deprecated public Location getRetractLocation() { 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 getBlocks() { + return blocks; + } @Override public HandlerList getHandlers() {