Skip to content

Commit

Permalink
chore(utils): introduce local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Max Tiedemann committed Aug 11, 2023
1 parent 3326022 commit 9adb42b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/me/ryanhamshire/GriefPrevention/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ public static boolean checkHeldItem(ItemStack itemStack)
if (heldItemMeta == null)
return false;

ItemMeta toolMeta = GriefPrevention.instance.config_claims_modificationTool.getItemMeta();
ItemStack claimtool = GriefPrevention.instance.config_claims_modificationTool;
ItemMeta toolMeta = claimtool.getItemMeta();
assert toolMeta != null;

if (itemStack.getType() != GriefPrevention.instance.config_claims_modificationTool.getType()) return false;
if (itemStack.getType() != claimtool.getType()) return false;
if (heldItemMeta.hasDisplayName() != toolMeta.hasDisplayName()) return false;
if (!heldItemMeta.getDisplayName().equals(toolMeta.getDisplayName())) return false;

Expand Down

0 comments on commit 9adb42b

Please sign in to comment.