quick fix : Redundant 'if' statement

This commit is contained in:
Alexdoru authored and Jason Mitchell committed 2023-01-28 18:02:41 -08:00
1 parent 28b094ea1a
commit f384a4fe28
29 files changed
+48 -130

No files matched your search

@@ -13,10 +13,7 @@ public class ModExtraModifier extends ItemModifier {
protected boolean canModify(ItemStack tool, ItemStack[] recipe) {
if (tool != null && tool.getItem() instanceof IModifyable) {
NBTTagCompound tags = this.getModifierTag(tool);
if (tags.getBoolean(key)) {
return false;
}
return true;
return !tags.getBoolean(key);
}
return false;
}
@@ -62,10 +62,9 @@ public class ModFlux extends ModBoolean {
> ((ToolCore) tool.getItem()).getMaxEnergyStored(tool);
}
// otherwise check if we have enough modfiers
else if (tags.getInteger("Modifiers") < modifiersRequired) return false;
else return tags.getInteger("Modifiers") >= modifiersRequired;
// all requirements satisfied!
return true;
}
@Override
@@ -30,7 +30,7 @@ public class ModLapis extends ItemModTypeFilter {
if (!tags.hasKey(key)) return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max;
int[] keyPair = tags.getIntArray(key);
if (keyPair[0] + matchingAmount(input) <= max) return true;
return keyPair[0] + matchingAmount(input) <= max;
}
return false;
}
@@ -14,9 +14,7 @@ public class ModPotion extends ItemModifier {
protected boolean canModify(ItemStack tool, ItemStack[] input) {
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
NBTTagCompound potion = tool.getTagCompound().getCompoundTag("Potion");
if (potion == null) return true;
return false;
return potion == null;
}
@Override