diff --git a/src/main/java/tconstruct/armor/ArmorProxyClient.java b/src/main/java/tconstruct/armor/ArmorProxyClient.java index f2ad0b07..3786d05b 100644 --- a/src/main/java/tconstruct/armor/ArmorProxyClient.java +++ b/src/main/java/tconstruct/armor/ArmorProxyClient.java @@ -199,8 +199,7 @@ public class ArmorProxyClient extends ArmorProxyCommon { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == ArmorProxyCommon.inventoryGui) { - GuiInventory inventory = new GuiInventory(player); - return inventory; + return new GuiInventory(player); } if (ID == ArmorProxyCommon.armorGuiID) { ArmorProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer); diff --git a/src/main/java/tconstruct/armor/blocks/DryingRack.java b/src/main/java/tconstruct/armor/blocks/DryingRack.java index 2f96d65f..f28c94c4 100644 --- a/src/main/java/tconstruct/armor/blocks/DryingRack.java +++ b/src/main/java/tconstruct/armor/blocks/DryingRack.java @@ -189,7 +189,7 @@ public class DryingRack extends InventoryBlock { @Override public String[] getTextureNames() { - String[] textureNames = { + return new String[]{ "castingtable_top", "castingtable_side", "castingtable_bottom", @@ -198,8 +198,6 @@ public class DryingRack extends InventoryBlock { "blockcast_side", "blockcast_bottom" }; - - return textureNames; } @Override diff --git a/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java b/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java index 5bcd771c..55f36ae6 100644 --- a/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java +++ b/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java @@ -101,9 +101,7 @@ public class DryingRackLogic extends InventoryLogic { @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getRenderBoundingBox() { - AxisAlignedBB cbb = - AxisAlignedBB.getBoundingBox(xCoord, yCoord - 1, zCoord, xCoord + 1, yCoord + 1, zCoord + 1); - return cbb; + return AxisAlignedBB.getBoundingBox(xCoord, yCoord - 1, zCoord, xCoord + 1, yCoord + 1, zCoord + 1); } @Override diff --git a/src/main/java/tconstruct/items/tools/Chisel.java b/src/main/java/tconstruct/items/tools/Chisel.java index 48eff5ad..c1d20916 100644 --- a/src/main/java/tconstruct/items/tools/Chisel.java +++ b/src/main/java/tconstruct/items/tools/Chisel.java @@ -45,8 +45,7 @@ public class Chisel extends ToolCore { } boolean performDetailing(World world, int x, int y, int z, int blockID, int blockMeta) { - boolean detailed = false; - return detailed; + return false; } @Override diff --git a/src/main/java/tconstruct/library/TConstructRegistry.java b/src/main/java/tconstruct/library/TConstructRegistry.java index 3627fee6..5e1e44e6 100644 --- a/src/main/java/tconstruct/library/TConstructRegistry.java +++ b/src/main/java/tconstruct/library/TConstructRegistry.java @@ -618,8 +618,7 @@ public class TConstructRegistry { try { Class clazz = Class.forName("tconstruct.TConstruct"); Method method = clazz.getMethod("getTableCasting"); - LiquidCasting lc = (LiquidCasting) method.invoke(this); - return lc; + return (LiquidCasting) method.invoke(this); } catch (Exception e) { logger.warn("Could not find casting table recipes."); return null; @@ -634,8 +633,7 @@ public class TConstructRegistry { try { Class clazz = Class.forName("tconstruct.TConstruct"); Method method = clazz.getMethod("getBasinCasting"); - LiquidCasting lc = (LiquidCasting) method.invoke(this); - return lc; + return (LiquidCasting) method.invoke(this); } catch (Exception e) { logger.warn("Could not find casting basin recipes."); return null; @@ -650,8 +648,7 @@ public class TConstructRegistry { try { Class clazz = Class.forName("tconstruct.TConstruct"); Method method = clazz.getMethod("getChiselDetailing"); - Detailing lc = (Detailing) method.invoke(this); - return lc; + return (Detailing) method.invoke(this); } catch (Exception e) { logger.warn("Could not find chisel detailing recipes."); return null; diff --git a/src/main/java/tconstruct/library/armor/ArmorCore.java b/src/main/java/tconstruct/library/armor/ArmorCore.java index af08f0fe..f1218a78 100644 --- a/src/main/java/tconstruct/library/armor/ArmorCore.java +++ b/src/main/java/tconstruct/library/armor/ArmorCore.java @@ -180,9 +180,7 @@ public abstract class ArmorCore extends ItemArmor implements ISpecialArmor, IMod float ratio = currentDurability / maxDurability; double base = tags.getDouble("BaseDefense"); double max = tags.getDouble("MaxDefense"); - double current = (max - base) * ratio + base; - - return current; + return (max - base) * ratio + base; } @Override diff --git a/src/main/java/tconstruct/library/crafting/Detailing.java b/src/main/java/tconstruct/library/crafting/Detailing.java index 59d1e372..43d90a5f 100644 --- a/src/main/java/tconstruct/library/crafting/Detailing.java +++ b/src/main/java/tconstruct/library/crafting/Detailing.java @@ -12,7 +12,6 @@ public class Detailing { public void addDetailing(Object input, int inputMeta, Object output, int outputMeta, ToolCore tool) { ItemStack iID, oID; - int iMeta = inputMeta, oMeta = outputMeta; if (input instanceof Block) iID = new ItemStack(((Block) input)); else if (input instanceof Item) iID = new ItemStack(((Item) input)); @@ -24,7 +23,7 @@ public class Detailing { else if (output instanceof ItemStack) oID = (ItemStack) output; else throw new RuntimeException("Invalid detail output!"); - this.addDetailing(new DetailInput(iID, iMeta, oID, oMeta), tool); + this.addDetailing(new DetailInput(iID, inputMeta, oID, outputMeta), tool); } public void addDetailing(DetailInput details, ToolCore tool) { @@ -48,11 +47,10 @@ public class Detailing { public void addShapelessToolRecipe(ItemStack par1ItemStack, Object... par2ArrayOfObj) { ArrayList arraylist = new ArrayList(); - Object[] aobject = par2ArrayOfObj; int i = par2ArrayOfObj.length; for (int j = 0; j < i; ++j) { - Object object1 = aobject[j]; + Object object1 = par2ArrayOfObj[j]; if (object1 instanceof ItemStack) { arraylist.add(((ItemStack) object1).copy()); diff --git a/src/main/java/tconstruct/tools/blocks/CraftingSlab.java b/src/main/java/tconstruct/tools/blocks/CraftingSlab.java index 850a1a51..841edd21 100644 --- a/src/main/java/tconstruct/tools/blocks/CraftingSlab.java +++ b/src/main/java/tconstruct/tools/blocks/CraftingSlab.java @@ -31,7 +31,7 @@ public class CraftingSlab extends InventorySlab { /* Rendering */ @Override public String[] getTextureNames() { - String[] textureNames = { + return new String[]{ "craftingstation_top", "craftingstation_slab_side", "craftingstation_bottom", @@ -51,8 +51,6 @@ public class CraftingSlab extends InventorySlab { "toolforge_slab_side", "toolforge_top" }; - - return textureNames; } @Override diff --git a/src/main/java/tconstruct/tools/blocks/CraftingStationBlock.java b/src/main/java/tconstruct/tools/blocks/CraftingStationBlock.java index bda33396..71f6c31b 100644 --- a/src/main/java/tconstruct/tools/blocks/CraftingStationBlock.java +++ b/src/main/java/tconstruct/tools/blocks/CraftingStationBlock.java @@ -30,9 +30,7 @@ public class CraftingStationBlock extends InventoryBlock { /* Rendering */ @Override public String[] getTextureNames() { - String[] textureNames = {"craftingstation_top", "craftingstation_side", "craftingstation_bottom"}; - - return textureNames; + return new String[]{"craftingstation_top", "craftingstation_side", "craftingstation_bottom"}; } @Override diff --git a/src/main/java/tconstruct/tools/blocks/FurnaceSlab.java b/src/main/java/tconstruct/tools/blocks/FurnaceSlab.java index 3d31c13e..10e4e114 100644 --- a/src/main/java/tconstruct/tools/blocks/FurnaceSlab.java +++ b/src/main/java/tconstruct/tools/blocks/FurnaceSlab.java @@ -44,9 +44,7 @@ public class FurnaceSlab extends InventorySlab { @Override public String[] getTextureNames() { - String[] textureNames = {"furnaceslab_front", "furnaceslab_front_active", "furnaceslab_side", "furnace_top"}; - - return textureNames; + return new String[]{"furnaceslab_front", "furnaceslab_front_active", "furnaceslab_side", "furnace_top"}; } @Override diff --git a/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java b/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java index 4ed9108a..c7624118 100644 --- a/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java +++ b/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java @@ -35,7 +35,7 @@ public class ToolStationBlock extends InventoryBlock { /* Rendering */ @Override public String[] getTextureNames() { - String[] textureNames = { + return new String[]{ "toolstation_top", "toolstation_side", "toolstation_bottom", @@ -67,8 +67,6 @@ public class ToolStationBlock extends InventoryBlock { "stenciltable_jungle_side", "stenciltable_jungle_bottom" }; - - return textureNames; } @Override diff --git a/src/main/java/tconstruct/tools/inventory/InventoryCraftingStationResult.java b/src/main/java/tconstruct/tools/inventory/InventoryCraftingStationResult.java index 87063f96..aa9fffcf 100644 --- a/src/main/java/tconstruct/tools/inventory/InventoryCraftingStationResult.java +++ b/src/main/java/tconstruct/tools/inventory/InventoryCraftingStationResult.java @@ -52,9 +52,8 @@ public class InventoryCraftingStationResult extends InventoryCraftResult { public ItemStack decrStackSize(int par1, int par2) { ItemStack stack = logic.getStackInSlot(0); if (stack != null) { - ItemStack itemstack = stack; logic.setInventorySlotContents(0, null); - return itemstack; + return stack; } else { return null; } diff --git a/src/main/java/tconstruct/tools/logic/BattlesignLogic.java b/src/main/java/tconstruct/tools/logic/BattlesignLogic.java index 93b30bc8..8e8060d5 100644 --- a/src/main/java/tconstruct/tools/logic/BattlesignLogic.java +++ b/src/main/java/tconstruct/tools/logic/BattlesignLogic.java @@ -76,9 +76,7 @@ public class BattlesignLogic extends EquipLogic { public S35PacketUpdateTileEntity getDescriptionPacket() { NBTTagCompound compound = new NBTTagCompound(); this.writeToNBT(compound); - - S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, compound); - return packet; + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, compound); } @Override diff --git a/src/main/java/tconstruct/tools/logic/EquipLogic.java b/src/main/java/tconstruct/tools/logic/EquipLogic.java index cd5255b9..93849854 100644 --- a/src/main/java/tconstruct/tools/logic/EquipLogic.java +++ b/src/main/java/tconstruct/tools/logic/EquipLogic.java @@ -53,9 +53,7 @@ public abstract class EquipLogic extends InventoryLogic { public S35PacketUpdateTileEntity getDescriptionPacket() { NBTTagCompound compound = new NBTTagCompound(); this.writeToNBT(compound); - - S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, compound); - return packet; + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, compound); } @Override diff --git a/src/main/java/tconstruct/weaponry/weapons/Javelin.java b/src/main/java/tconstruct/weaponry/weapons/Javelin.java index c9f5fd20..2fea6317 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Javelin.java +++ b/src/main/java/tconstruct/weaponry/weapons/Javelin.java @@ -164,9 +164,7 @@ public class Javelin extends AmmoWeapon { @Override protected Entity createProjectile(ItemStack reference, World world, EntityPlayer player, float accuracy, int time) { reference.getTagCompound().getCompoundTag("InfiTool").removeTag("Throwing"); // needed so the NBTs are equal - JavelinEntity entity = new JavelinEntity(world, player, getProjectileSpeed(), accuracy, reference); - - return entity; + return new JavelinEntity(world, player, getProjectileSpeed(), accuracy, reference); } @Override diff --git a/src/main/java/tconstruct/world/MiningExplosion.java b/src/main/java/tconstruct/world/MiningExplosion.java index 72166b84..43bf545e 100644 --- a/src/main/java/tconstruct/world/MiningExplosion.java +++ b/src/main/java/tconstruct/world/MiningExplosion.java @@ -60,10 +60,9 @@ public class MiningExplosion extends Explosion { Block k1 = this.world.getBlock(l, i1, j1); if (k1 != Blocks.air) { - Block block = k1; float f3 = this.exploder != null - ? this.exploder.func_145772_a(this, this.world, l, i1, j1, block) - : block.getExplosionResistance( + ? this.exploder.func_145772_a(this, this.world, l, i1, j1, k1) + : k1.getExplosionResistance( this.exploder, world, l, i1, j1, explosionX, explosionY, explosionZ); f1 -= (f3 + 0.8F) * f2 * 0.25f; } @@ -196,14 +195,11 @@ public class MiningExplosion extends Explosion { } if (l != Blocks.air) { - Block block = l; - - if (block.canDropFromExplosion(this)) { - block.dropBlockAsItemWithChance( + if (l.canDropFromExplosion(this)) { + l.dropBlockAsItemWithChance( this.world, i, j, k, this.world.getBlockMetadata(i, j, k), 1.0F, 0); } - - block.onBlockExploded(this.world, i, j, k, this); + l.onBlockExploded(this.world, i, j, k, this); } } }