diff --git a/src/main/java/tconstruct/armor/TinkerArmor.java b/src/main/java/tconstruct/armor/TinkerArmor.java index 6e4d83ab..8ef19317 100644 --- a/src/main/java/tconstruct/armor/TinkerArmor.java +++ b/src/main/java/tconstruct/armor/TinkerArmor.java @@ -78,10 +78,7 @@ public class TinkerArmor { GameRegistry.registerTileEntity(DryingRackLogic.class, "Armor.DryingRack"); TinkerArmor.diamondApple = new DiamondApple().setUnlocalizedName("tconstruct.apple.diamond"); GameRegistry.registerItem(TinkerArmor.diamondApple, "diamondApple"); - boolean foodOverhaul = false; - if (Loader.isModLoaded("HungerOverhaul") || Loader.isModLoaded("fc_food")) { - foodOverhaul = true; - } + boolean foodOverhaul = Loader.isModLoaded("HungerOverhaul") || Loader.isModLoaded("fc_food"); TinkerArmor.jerky = new Jerky(foodOverhaul).setUnlocalizedName("tconstruct.jerky"); GameRegistry.registerItem(TinkerArmor.jerky, "jerky"); diff --git a/src/main/java/tconstruct/armor/inventory/SlotBehavedOnly.java b/src/main/java/tconstruct/armor/inventory/SlotBehavedOnly.java index 10bfc69e..0adca107 100644 --- a/src/main/java/tconstruct/armor/inventory/SlotBehavedOnly.java +++ b/src/main/java/tconstruct/armor/inventory/SlotBehavedOnly.java @@ -20,18 +20,12 @@ public class SlotBehavedOnly extends Slot { int stackL = b.getStackLimit(par1ItemStack); - if (b != null - && this.inventory.getStackInSlot(this.slotNumber) != null - && !this.inventory.getStackInSlot(this.slotNumber).isItemEqual(par1ItemStack)) { + if (this.inventory.getStackInSlot(this.slotNumber) != null && !this.inventory.getStackInSlot(this.slotNumber).isItemEqual(par1ItemStack)) { ItemStack is = this.inventory.getStackInSlot(this.slotNumber); - if (is.stackSize + par1ItemStack.stackSize <= stackL) { - return true; - } + return is.stackSize + par1ItemStack.stackSize <= stackL; } else { return par1ItemStack.stackSize <= stackL; } - - return false; // return b != null; } diff --git a/src/main/java/tconstruct/blocks/traps/Landmine.java b/src/main/java/tconstruct/blocks/traps/Landmine.java index 269a5d2a..8bee975c 100644 --- a/src/main/java/tconstruct/blocks/traps/Landmine.java +++ b/src/main/java/tconstruct/blocks/traps/Landmine.java @@ -109,12 +109,8 @@ public class Landmine extends MantleBlock { * neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - boolean var6 = false; - - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !BlockFence.func_149825_a(par1World.getBlock(par2, par3 - 1, par4))) { - var6 = true; - } + boolean var6 = !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) + && !BlockFence.func_149825_a(par1World.getBlock(par2, par3 - 1, par4)); if (var6) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); diff --git a/src/main/java/tconstruct/library/component/TankLayerScan.java b/src/main/java/tconstruct/library/component/TankLayerScan.java index d19955d8..05573e68 100644 --- a/src/main/java/tconstruct/library/component/TankLayerScan.java +++ b/src/main/java/tconstruct/library/component/TankLayerScan.java @@ -165,10 +165,8 @@ public class TankLayerScan extends LogicComponent { protected boolean checkAir(int x, int y, int z) { Block block = world.getBlock(x, y, z); - if (block == null || world.isAirBlock(x, y, z)) // || block == TContent.tankAir) - return true; - - return false; + // || block == TContent.tankAir) + return block == null || world.isAirBlock(x, y, z); } protected boolean checkServant(int x, int y, int z) { diff --git a/src/main/java/tconstruct/library/crafting/CastingRecipe.java b/src/main/java/tconstruct/library/crafting/CastingRecipe.java index 85a94470..7b82a82e 100644 --- a/src/main/java/tconstruct/library/crafting/CastingRecipe.java +++ b/src/main/java/tconstruct/library/crafting/CastingRecipe.java @@ -49,9 +49,7 @@ public class CastingRecipe { return true; } else if (!ignoreNBT && ItemStack.areItemStacksEqual(cast, inputCast)) { return true; - } else if (ignoreNBT && cast != null && inputCast != null && cast.isItemEqual(inputCast)) { - return true; - } + } else return ignoreNBT && cast != null && inputCast != null && cast.isItemEqual(inputCast); } return false; } diff --git a/src/main/java/tconstruct/library/crafting/ToolRecipe.java b/src/main/java/tconstruct/library/crafting/ToolRecipe.java index 8ca0ab76..c9f82b3a 100644 --- a/src/main/java/tconstruct/library/crafting/ToolRecipe.java +++ b/src/main/java/tconstruct/library/crafting/ToolRecipe.java @@ -72,8 +72,7 @@ public class ToolRecipe { public boolean validAccessory(Item input) { if (input == null) { - if (accessoryList.size() < 1) return true; - return false; + return accessoryList.size() < 1; } for (Item part : accessoryList) { if (part == input) return true; @@ -84,8 +83,7 @@ public class ToolRecipe { public boolean validExtra(Item input) { if (input == null) { - if (extraList.size() < 1) return true; - return false; + return extraList.size() < 1; } for (Item part : extraList) { if (part == input) return true; diff --git a/src/main/java/tconstruct/library/tools/AbilityHelper.java b/src/main/java/tconstruct/library/tools/AbilityHelper.java index 39e08459..4a265e49 100644 --- a/src/main/java/tconstruct/library/tools/AbilityHelper.java +++ b/src/main/java/tconstruct/library/tools/AbilityHelper.java @@ -196,7 +196,7 @@ public class AbilityHelper { } if (entity instanceof EntityPlayer) ((EntityPlayer) player).addExhaustion(0.3F); - if (causedDamage) return true; + return causedDamage; } } } diff --git a/src/main/java/tconstruct/library/tools/FletchlingLeafMaterial.java b/src/main/java/tconstruct/library/tools/FletchlingLeafMaterial.java index 5b592560..63faba05 100644 --- a/src/main/java/tconstruct/library/tools/FletchlingLeafMaterial.java +++ b/src/main/java/tconstruct/library/tools/FletchlingLeafMaterial.java @@ -27,7 +27,7 @@ public class FletchlingLeafMaterial extends FletchingMaterial { if (stack != null) { Block block = BlockUtils.getBlockFromItemStack(stack); if (block != null) { - if (block.isLeaves(null, 0, 0, 0)) return true; + return block.isLeaves(null, 0, 0, 0); } } return false; diff --git a/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java index 2d1a6d41..6f9ebc61 100644 --- a/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java +++ b/src/main/java/tconstruct/library/weaponry/BowBaseAmmo.java @@ -96,19 +96,15 @@ public abstract class BowBaseAmmo extends ProjectileWeapon { // no tinker arrow if (!(stack.getItem() instanceof ArrowAmmo)) return false; // no ammo left - if (((IAmmo) stack.getItem()).getAmmoCount(stack) <= 0) return false; - - return true; + return ((IAmmo) stack.getItem()).getAmmoCount(stack) > 0; } private boolean checkVanillaArrow(ItemStack stack) { // null if (stack == null) return false; // no arrow - if (!(stack.getItem() == Items.arrow)) return false; + return stack.getItem() == Items.arrow; // inventory shouldn't contain stacksize 0 items so we don't have to check that. - - return true; } @Override diff --git a/src/main/java/tconstruct/mechworks/blocks/BlockLandmine.java b/src/main/java/tconstruct/mechworks/blocks/BlockLandmine.java index 1f2cb713..ea296575 100644 --- a/src/main/java/tconstruct/mechworks/blocks/BlockLandmine.java +++ b/src/main/java/tconstruct/mechworks/blocks/BlockLandmine.java @@ -1,12 +1,7 @@ package tconstruct.mechworks.blocks; -import static net.minecraftforge.common.util.ForgeDirection.*; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Iterator; -import java.util.List; -import java.util.Random; import mantle.blocks.BlockUtils; import mantle.world.WorldHelper; import net.minecraft.block.Block; @@ -39,6 +34,11 @@ import tconstruct.mechworks.logic.LandmineExplodeLogic; import tconstruct.mechworks.logic.TileEntityLandmine; import tconstruct.world.model.RenderLandmine; +import java.util.List; +import java.util.Random; + +import static net.minecraftforge.common.util.ForgeDirection.*; + /** * * @author fuj1n @@ -411,13 +411,7 @@ public class BlockLandmine extends BlockContainer { private boolean hasItems(World par1World, int par2, int par3, int par4) { TileEntityLandmine te = (TileEntityLandmine) par1World.getTileEntity(par2, par3, par4); - if (te != null && te.getStackInSlot(0) != null - || te.getStackInSlot(1) != null - || te.getStackInSlot(2) != null) { - return true; - } else { - return false; - } + return te != null && (te.getStackInSlot(0) != null || te.getStackInSlot(1) != null || te.getStackInSlot(2) != null); } protected int getMineState(World par1World, int par2, int par3, int par4) { diff --git a/src/main/java/tconstruct/mechworks/inventory/ContainerLandmine.java b/src/main/java/tconstruct/mechworks/inventory/ContainerLandmine.java index 029eed25..3c3fa44c 100644 --- a/src/main/java/tconstruct/mechworks/inventory/ContainerLandmine.java +++ b/src/main/java/tconstruct/mechworks/inventory/ContainerLandmine.java @@ -219,11 +219,7 @@ public class ContainerLandmine extends Container { slot2 = (Slot) this.inventorySlots.get(par1); - boolean shouldDoStuff = true; - - if ((!(slot2 instanceof SlotBehavedOnly))) { - shouldDoStuff = false; - } + boolean shouldDoStuff = slot2 instanceof SlotBehavedOnly; if (slot2 != null) { itemstack1 = slot2.getStack(); diff --git a/src/main/java/tconstruct/modifiers/tools/ModExtraModifier.java b/src/main/java/tconstruct/modifiers/tools/ModExtraModifier.java index ba3abae0..33a49536 100644 --- a/src/main/java/tconstruct/modifiers/tools/ModExtraModifier.java +++ b/src/main/java/tconstruct/modifiers/tools/ModExtraModifier.java @@ -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; } diff --git a/src/main/java/tconstruct/modifiers/tools/ModFlux.java b/src/main/java/tconstruct/modifiers/tools/ModFlux.java index 5681247f..8704c484 100644 --- a/src/main/java/tconstruct/modifiers/tools/ModFlux.java +++ b/src/main/java/tconstruct/modifiers/tools/ModFlux.java @@ -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 diff --git a/src/main/java/tconstruct/modifiers/tools/ModLapis.java b/src/main/java/tconstruct/modifiers/tools/ModLapis.java index 45d06de2..dd409158 100644 --- a/src/main/java/tconstruct/modifiers/tools/ModLapis.java +++ b/src/main/java/tconstruct/modifiers/tools/ModLapis.java @@ -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; } diff --git a/src/main/java/tconstruct/modifiers/tools/ModPotion.java b/src/main/java/tconstruct/modifiers/tools/ModPotion.java index 87f20e72..4f168bdc 100644 --- a/src/main/java/tconstruct/modifiers/tools/ModPotion.java +++ b/src/main/java/tconstruct/modifiers/tools/ModPotion.java @@ -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 diff --git a/src/main/java/tconstruct/plugins/nei/RecipeHandlerBase.java b/src/main/java/tconstruct/plugins/nei/RecipeHandlerBase.java index 76165c8e..c9379f99 100644 --- a/src/main/java/tconstruct/plugins/nei/RecipeHandlerBase.java +++ b/src/main/java/tconstruct/plugins/nei/RecipeHandlerBase.java @@ -146,15 +146,10 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler { if (tank.position.contains(relMouse)) { if ((tank.fluid != null) && tank.fluid.amount > 0) { if (usage) { - if (!GuiUsageRecipe.openRecipeGui("liquid", new Object[] {tank.fluid})) { - return false; - } + return GuiUsageRecipe.openRecipeGui("liquid", new Object[]{tank.fluid}); } else { - if (!GuiCraftingRecipe.openRecipeGui("liquid", new Object[] {tank.fluid})) { - return false; - } + return GuiCraftingRecipe.openRecipeGui("liquid", new Object[]{tank.fluid}); } - return true; } } } diff --git a/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java b/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java index 6f7110c7..6cd652db 100644 --- a/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java +++ b/src/main/java/tconstruct/smeltery/inventory/SmelteryContainer.java @@ -57,12 +57,8 @@ public class SmelteryContainer extends ActiveContainer { int basePos = invRow * columns; for (int iter = 0; iter < activeInventorySlots.size(); iter++) { ActiveSlot slot = (ActiveSlot) activeInventorySlots.get(iter); - if (slot.activeSlotNumber >= basePos - && slot.activeSlotNumber < basePos + columns * SmelteryGui.maxRows) { - slot.setActive(true); - } else { - slot.setActive(false); - } + slot.setActive(slot.activeSlotNumber >= basePos + && slot.activeSlotNumber < basePos + columns * SmelteryGui.maxRows); int xPos = (iter - basePos) % columns; int yPos = (iter - basePos) / columns; diff --git a/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java b/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java index b6fd2c55..d3481135 100644 --- a/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/FaucetLogic.java @@ -166,8 +166,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi @Override public void setActive(boolean flag) { if (!active) { - active = true; - if (!activateFaucet()) active = false; + active = activateFaucet(); } else { active = false; } diff --git a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java index 7a6a95a6..a2c13e94 100644 --- a/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java @@ -793,11 +793,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public boolean checkSameLevel(int x, int y, int z, int[] sides) { lavaTanks.clear(); - boolean check = checkBricksOnLevel(x, y, z, sides); - - if (check && lavaTanks.size() > 0) return true; - else return false; + return check && lavaTanks.size() > 0; } public int recurseStructureUp(int x, int y, int z, int[] sides, int count) { diff --git a/src/main/java/tconstruct/tools/TActiveOmniMod.java b/src/main/java/tconstruct/tools/TActiveOmniMod.java index f67f172a..9a55c9de 100644 --- a/src/main/java/tconstruct/tools/TActiveOmniMod.java +++ b/src/main/java/tconstruct/tools/TActiveOmniMod.java @@ -57,12 +57,9 @@ public class TActiveOmniMod extends ActiveToolMod { public boolean beforeBlockBreak(ToolCore tool, ItemStack stack, int x, int y, int z, EntityLivingBase entity) { NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); baconator(tool, stack, entity, tags); - if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode) return false; TinkerTools.modLapis.midStreamModify(stack, tool); - if (autoSmelt(tool, tags, stack, x, y, z, entity)) return true; - - return false; + return autoSmelt(tool, tags, stack, x, y, z, entity); } @Override @@ -294,7 +291,6 @@ public class TActiveOmniMod extends ActiveToolMod { ItemStack stack, EntityLivingBase player, Entity entity) { - if (tool == TinkerTools.cutlass && random.nextInt(10) == 0) return true; - return false; + return tool == TinkerTools.cutlass && random.nextInt(10) == 0; } } diff --git a/src/main/java/tconstruct/tools/entity/FancyEntityItem.java b/src/main/java/tconstruct/tools/entity/FancyEntityItem.java index 5cc6af88..773b5779 100644 --- a/src/main/java/tconstruct/tools/entity/FancyEntityItem.java +++ b/src/main/java/tconstruct/tools/entity/FancyEntityItem.java @@ -37,7 +37,6 @@ public class FancyEntityItem extends EntityItem { } public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getDamageType().equals("outOfWorld")) return true; - return false; + return par1DamageSource.getDamageType().equals("outOfWorld"); } } diff --git a/src/main/java/tconstruct/tools/gui/PartCrafterGui.java b/src/main/java/tconstruct/tools/gui/PartCrafterGui.java index d1c3352a..6b8354f7 100644 --- a/src/main/java/tconstruct/tools/gui/PartCrafterGui.java +++ b/src/main/java/tconstruct/tools/gui/PartCrafterGui.java @@ -270,11 +270,7 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler { @Override public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) { - if (width - xSize < 107) { - currentVisibility.showWidgets = false; - } else { - currentVisibility.showWidgets = true; - } + currentVisibility.showWidgets = width - xSize >= 107; if (guiLeft < 58) { currentVisibility.showStateButtons = false; @@ -301,9 +297,6 @@ public class PartCrafterGui extends GuiContainer implements INEIGuiHandler { @Override public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { if (y + h - 4 < guiTop || y + 4 > guiTop + ySize) return false; - - if (x - w - 4 < guiLeft - 40 || x + 4 > guiLeft + xSize + DESC_WIDTH) return false; - - return true; + return x - w - 4 >= guiLeft - 40 && x + 4 <= guiLeft + xSize + DESC_WIDTH; } } diff --git a/src/main/java/tconstruct/tools/gui/StencilTableGui.java b/src/main/java/tconstruct/tools/gui/StencilTableGui.java index 11244e08..dd25b71f 100644 --- a/src/main/java/tconstruct/tools/gui/StencilTableGui.java +++ b/src/main/java/tconstruct/tools/gui/StencilTableGui.java @@ -183,10 +183,6 @@ public class StencilTableGui extends GuiContainer implements INEIGuiHandler { } // is it in the horizontal column of the left buttons? - if (x + w > this.buttonsLeftRect[0] && x < this.guiLeft && y + h > this.guiTop && y < this.buttonsLeftRect[1]) { - return true; - } - - return false; + return x + w > this.buttonsLeftRect[0] && x < this.guiLeft && y + h > this.guiTop && y < this.buttonsLeftRect[1]; } } diff --git a/src/main/java/tconstruct/tools/gui/ToolStationGui.java b/src/main/java/tconstruct/tools/gui/ToolStationGui.java index 36bc5d77..f4f4b5f7 100644 --- a/src/main/java/tconstruct/tools/gui/ToolStationGui.java +++ b/src/main/java/tconstruct/tools/gui/ToolStationGui.java @@ -268,16 +268,10 @@ public class ToolStationGui extends GuiContainer implements INEIGuiHandler { @Override public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) { - if (width - xSize < 107) { - currentVisibility.showWidgets = false; - } else { - currentVisibility.showWidgets = true; - } - + currentVisibility.showWidgets = width - xSize >= 107; if (guiLeft < 58) { currentVisibility.showStateButtons = false; } - return currentVisibility; } @@ -299,9 +293,6 @@ public class ToolStationGui extends GuiContainer implements INEIGuiHandler { @Override public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) { if (y + h - 4 < guiTop || y + 4 > guiTop + ySize) return false; - - if (x - w - 4 < guiLeft - 40 || x + 4 > guiLeft + xSize + 126) return false; - - return true; + return x - w - 4 >= guiLeft - 40 && x + 4 <= guiLeft + xSize + 126; } } diff --git a/src/main/java/tconstruct/tools/logic/PartBuilderLogic.java b/src/main/java/tconstruct/tools/logic/PartBuilderLogic.java index 1fe1c108..2e84bffb 100644 --- a/src/main/java/tconstruct/tools/logic/PartBuilderLogic.java +++ b/src/main/java/tconstruct/tools/logic/PartBuilderLogic.java @@ -66,8 +66,7 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory } } - if (inventory[4] != null || inventory[5] != null) craftedTop = true; - else craftedTop = false; + craftedTop = inventory[4] != null || inventory[5] != null; } if (!craftedTop) buildTopPart(); @@ -84,8 +83,7 @@ public class PartBuilderLogic extends InventoryLogic implements ISidedInventory } } - if (inventory[6] != null || inventory[7] != null) craftedBottom = true; - else craftedBottom = false; + craftedBottom = inventory[6] != null || inventory[7] != null; } if (!craftedBottom) buildBottomPart(); diff --git a/src/main/java/tconstruct/tools/logic/StencilTableLogic.java b/src/main/java/tconstruct/tools/logic/StencilTableLogic.java index 66da28d8..76e7b0e9 100644 --- a/src/main/java/tconstruct/tools/logic/StencilTableLogic.java +++ b/src/main/java/tconstruct/tools/logic/StencilTableLogic.java @@ -91,8 +91,7 @@ public class StencilTableLogic extends InventoryLogic implements ISidedInventory @Override public boolean canDropInventorySlot(int slot) { - if (slot == 0) return true; - else return false; + return slot == 0; } @Override diff --git a/src/main/java/tconstruct/tools/logic/ToolStationLogic.java b/src/main/java/tconstruct/tools/logic/ToolStationLogic.java index 6ce86817..91b15618 100644 --- a/src/main/java/tconstruct/tools/logic/ToolStationLogic.java +++ b/src/main/java/tconstruct/tools/logic/ToolStationLogic.java @@ -32,8 +32,7 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory @Override public boolean canDropInventorySlot(int slot) { - if (slot == 0) return false; - return true; + return slot != 0; } @Override diff --git a/src/main/java/tconstruct/weaponry/WeaponryActiveToolMod.java b/src/main/java/tconstruct/weaponry/WeaponryActiveToolMod.java index eb8d23e2..ea3e7f35 100644 --- a/src/main/java/tconstruct/weaponry/WeaponryActiveToolMod.java +++ b/src/main/java/tconstruct/weaponry/WeaponryActiveToolMod.java @@ -15,7 +15,7 @@ public class WeaponryActiveToolMod extends ActiveToolMod { IAmmo ammo = (IAmmo) stack.getItem(); if (tags.getInteger("Damage") == 0) { int rem = ammo.consumeAmmo(1, stack); - if (rem > 0) return true; + return rem > 0; } else if (ammo.getAmmoCount(stack) > 0) { int d = tags.getInteger("Damage") + damage; int max = tags.getInteger("TotalDurability"); @@ -26,7 +26,9 @@ public class WeaponryActiveToolMod extends ActiveToolMod { } } // all other ammo items can't be damaged - else if (stack.getItem() instanceof IAmmo) return true; + else { + return stack.getItem() instanceof IAmmo; + } return false; } diff --git a/src/main/java/tconstruct/world/entity/CartEntity.java b/src/main/java/tconstruct/world/entity/CartEntity.java index f4bec17c..8027c652 100644 --- a/src/main/java/tconstruct/world/entity/CartEntity.java +++ b/src/main/java/tconstruct/world/entity/CartEntity.java @@ -1027,10 +1027,7 @@ public class CartEntity extends Entity implements IInventory, IEntityAdditionalS * @return True if this cart can be ridden. */ public boolean canBeRidden() { - if (pullcartType == 0 && getClass() == CartEntity.class) { - return true; - } - return false; + return pullcartType == 0 && getClass() == CartEntity.class; } /**