From 0e02355cca7db7a4d4a5728f9fa6380a663d4a4f Mon Sep 17 00:00:00 2001 From: Sn0wStorm Date: Sat, 31 Oct 2020 14:32:37 +0100 Subject: [PATCH] Use better Piston Retract Barrel check --- src/com/dre/brewery/listeners/BlockListener.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/dre/brewery/listeners/BlockListener.java b/src/com/dre/brewery/listeners/BlockListener.java index 59db3210..e0c0e274 100644 --- a/src/com/dre/brewery/listeners/BlockListener.java +++ b/src/com/dre/brewery/listeners/BlockListener.java @@ -70,10 +70,11 @@ public void onBlockBurn(BlockBurnEvent event) { @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPistonRetract(BlockPistonRetractEvent event) { if (event.isSticky()) { - Block block = event.getRetractLocation().getBlock(); - - if (Barrel.get(block) != null) { - event.setCancelled(true); + for (Block block : event.getBlocks()) { + if (Barrel.get(block) != null) { + event.setCancelled(true); + return; + } } } }