From 4bc446e306ca6398dcb05232760f8e71ed49cfa8 Mon Sep 17 00:00:00 2001 From: Bestle Date: Thu, 17 Oct 2013 21:05:29 +0100 Subject: [PATCH] Add missing ignoreCancelled checks If a plugin cancels a piston retract or extend event, mcMMO still considers that block or blocks to have moved. This allow players to gain xp and double drops from blocks that they shouldn't. Checking for cancelled events fixes this. --- src/main/java/com/gmail/nossr50/listeners/BlockListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 5dfc3d9e2..ea6ad8286 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -54,7 +54,7 @@ public class BlockListener implements Listener { * * @param event The event to monitor */ - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockPistonExtend(BlockPistonExtendEvent event) { List blocks = event.getBlocks(); BlockFace direction = event.getDirection(); @@ -84,7 +84,7 @@ public class BlockListener implements Listener { * * @param event The event to watch */ - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockPistonRetract(BlockPistonRetractEvent event) { if (event.isSticky()) { // Needed only because under some circumstances Minecraft doesn't move the block