From a2723163012f53cd5bfd2ec4f6093fa81adc939c Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 4 Apr 2013 08:05:48 -0400 Subject: [PATCH] Don't even bother running these checks if we don't watch the block. --- .../java/com/gmail/nossr50/listeners/BlockListener.java | 9 +++++++-- 1 file changed, 7 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 a6af7e72d..69cafb923 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -129,6 +129,12 @@ public class BlockListener implements Listener { return; } + BlockState blockState = event.getBlock().getState(); + + if (!BlockUtils.shouldBeWatched(blockState)) { + return; + } + Player player = event.getPlayer(); if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) { @@ -136,7 +142,6 @@ public class BlockListener implements Listener { } McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); - BlockState blockState = event.getBlock().getState(); ItemStack heldItem = player.getItemInHand(); /* HERBALISM */ @@ -186,7 +191,7 @@ public class BlockListener implements Listener { } /* Remove metadata from placed watched blocks */ - if (BlockUtils.shouldBeWatched(blockState) && mcMMO.placeStore.isTrue(blockState)) { + if (mcMMO.placeStore.isTrue(blockState)) { mcMMO.placeStore.setFalse(blockState); } }