소스 검색

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.
Bestle 11 년 전
부모
커밋
4bc446e306
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/main/java/com/gmail/nossr50/listeners/BlockListener.java

+ 2 - 2
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<Block> 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