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.
This commit is contained in:
Bestle 2013-10-17 21:05:29 +01:00
parent 7f2f15d88e
commit 4bc446e306

View File

@ -54,7 +54,7 @@ public class BlockListener implements Listener {
* *
* @param event The event to monitor * @param event The event to monitor
*/ */
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPistonExtend(BlockPistonExtendEvent event) { public void onBlockPistonExtend(BlockPistonExtendEvent event) {
List<Block> blocks = event.getBlocks(); List<Block> blocks = event.getBlocks();
BlockFace direction = event.getDirection(); BlockFace direction = event.getDirection();
@ -84,7 +84,7 @@ public class BlockListener implements Listener {
* *
* @param event The event to watch * @param event The event to watch
*/ */
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockPistonRetract(BlockPistonRetractEvent event) { public void onBlockPistonRetract(BlockPistonRetractEvent event) {
if (event.isSticky()) { if (event.isSticky()) {
// Needed only because under some circumstances Minecraft doesn't move the block // Needed only because under some circumstances Minecraft doesn't move the block