From 79e93edfefbf8d02ac912ea53c77ae29251e2892 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Mon, 21 May 2012 02:19:45 -0400 Subject: [PATCH] Switch order of sticky check and placeStore check. sticky check is much less expensive than placeStore, so it's better to ensure that the piston is sticky before doing a placeStore check --- src/main/java/com/gmail/nossr50/listeners/BlockListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index 52bc29cee..1efd70d28 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -80,7 +80,7 @@ public class BlockListener implements Listener { public void onBlockPistonRetract(BlockPistonRetractEvent event) { Block block = event.getRetractLocation().getBlock(); - if (mcMMO.placeStore.isTrue(block) && event.isSticky()) { + if (event.isSticky() && mcMMO.placeStore.isTrue(block)) { mcMMO.placeStore.setFalse(block); mcMMO.placeStore.setTrue(event.getBlock().getRelative(event.getDirection())); }