Browse Source

We only need the block in here.

GJ 12 năm trước cách đây
mục cha
commit
6c6ab4c96e

+ 2 - 7
src/main/java/com/gmail/nossr50/listeners/PlayerListener.java

@@ -326,17 +326,12 @@ public class PlayerListener implements Listener {
             return;
         }
 
-        Block block = event.getClickedBlock();
-        BlockState blockState = null;
-
-        if (block != null) {
-            blockState = block.getState();
-        }
-
         ItemStack heldItem = player.getItemInHand();
 
         switch (event.getAction()) {
         case RIGHT_CLICK_BLOCK:
+            Block block = event.getClickedBlock();
+            BlockState blockState = block.getState();
 
             /* ACTIVATION & ITEM CHECKS */
             if (BlockChecks.canActivateAbilities(blockState)) {