Skip to content

Commit

Permalink
re-order checks in Torches module
Browse files Browse the repository at this point in the history
block#getType is likely the expensive call here(?)
  • Loading branch information
RoboMWM committed Mar 12, 2017
1 parent 4736b7c commit 37aada7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/extrahardmode/features/Torches.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onBlockPlace(BlockPlaceEvent placeEvent)
final boolean playerBypasses = playerModule.playerBypasses(player, Feature.TORCHES);

// FEATURE: players can't attach torches to common "soft" blocks
if (block.getType().equals(Material.TORCH) && limitedTorchPlacement && !playerBypasses)
if (limitedTorchPlacement && !playerBypasses && block.getType().equals(Material.TORCH))
{
Torch torch = new Torch(Material.TORCH, block.getData());
Material attachmentMaterial = block.getRelative(torch.getAttachedFace()).getType();
Expand Down

1 comment on commit 37aada7

@erik1988
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.