Remove redundant casts, unnecessary object creation, and string ==

This commit is contained in:
mezz committed 2016-10-21 00:32:06 -07:00
1 parent 100784b51b
commit a4cd13282a
57 files changed
+180 -156

No files matched your search

@@ -37,10 +37,10 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Mutation, 0.5f, 0.2f);
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Production, 0.75f, 0.2f);
EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.Lifespan, 1.0E-4f, 1.0E-4f);
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Cocoa.item), new Object[]{" c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', new ItemStack(Items.DYE, 1, 3)});
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Cage.item), new Object[]{Mods.Forestry.stack("frameImpregnated"), Blocks.IRON_BARS});
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Soul.item), new Object[]{Mods.Forestry.stack("frameImpregnated"), Blocks.SOUL_SAND});
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Clay.item), new Object[]{" c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', Items.CLAY_BALL});
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Cocoa.item), " c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', new ItemStack(Items.DYE, 1, 3));
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Cage.item), Mods.Forestry.stack("frameImpregnated"), Blocks.IRON_BARS);
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Soul.item), Mods.Forestry.stack("frameImpregnated"), Blocks.SOUL_SAND);
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Clay.item), " c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', Items.CLAY_BALL);
}
public int getIconIndex() {
@@ -45,13 +45,13 @@ public class ModuleApiary implements IInitializable {
@Override
public void postInit() {
EnumHiveFrame.init();
GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), new Object[]{"g g", " a ", "t t", 'g', Items.GOLD_INGOT, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5)});
GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), new Object[]{"iii", "tat", " t ", 'i', Items.IRON_INGOT, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)});
GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), new Object[]{" b ", "bab", "t t", 'b', Items.BRICK, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)});
GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), new Object[]{"iii", "iai", " t ", 'i', Items.GLOWSTONE_DUST, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)});
GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), new Object[]{"kik", "iai", " t ", 'i', Items.GOLD_NUGGET, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), 'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2)});
GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), new Object[]{"i i", " a ", "iti", 'i', Blocks.GLASS_PANE, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5)});
GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), new Object[]{" t ", "tat", " t ", 'a', Mods.Forestry.block("alveary"), 't', "gearTin"}));
GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), "g g", " a ", "t t", 'g', Items.GOLD_INGOT, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5));
GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), "iii", "tat", " t ", 'i', Items.IRON_INGOT, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4));
GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), " b ", "bab", "t t", 'b', Items.BRICK, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4));
GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), "iii", "iai", " t ", 'i', Items.GLOWSTONE_DUST, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4));
GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), "kik", "iai", " t ", 'i', Items.GOLD_NUGGET, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), 'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2));
GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), "i i", " a ", "iti", 'i', Blocks.GLASS_PANE, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5));
GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), " t ", "tat", " t ", 'a', Mods.Forestry.block("alveary"), 't', "gearTin"));
for (final AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
type.createCircuit(this.stimulatorLayout);
}
@@ -64,7 +64,7 @@ public class AlvearyFrame {
}
final World world = this.getMachine().getTileEntity().getWorld();
final int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
this.getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, this.getHiveFrame().frameUsed(((TileExtraBeeAlveary) this.getMachine().getTileEntity()).getMultiblockLogic().getController(), this.getInventory().getStackInSlot(AlvearyFrame.slotFrame), (IBee) null, wear));
this.getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, this.getHiveFrame().frameUsed(((TileExtraBeeAlveary) this.getMachine().getTileEntity()).getMultiblockLogic().getController(), this.getInventory().getStackInSlot(AlvearyFrame.slotFrame), null, wear));
}
public IHiveFrame getHiveFrame() {
@@ -101,10 +101,10 @@ public class AlvearyStimulator {
return new StimulatorCircuit[0];
}
final ICircuit[] circuits = board.getCircuits();
final List<IBeeModifier> mod = new ArrayList<>();
final List<StimulatorCircuit> mod = new ArrayList<>();
for (final ICircuit circuit : circuits) {
if (circuit instanceof StimulatorCircuit) {
mod.add((IBeeModifier) circuit);
mod.add((StimulatorCircuit) circuit);
}
}
return mod.toArray(new StimulatorCircuit[0]);
@@ -64,7 +64,7 @@ public enum ExtraBeeItems implements IItemMisc {
public static void postInit() {
final ItemStack lapisShard = ExtraBeeItems.LapisShard.get(1);
GameRegistry.addShapelessRecipe(new ItemStack(Items.DYE, 1, 4), new Object[]{lapisShard, lapisShard, lapisShard, lapisShard});
GameRegistry.addShapelessRecipe(new ItemStack(Items.DYE, 1, 4), lapisShard, lapisShard, lapisShard, lapisShard);
for (final ExtraBeeItems item : values()) {
if (item.metalString != null) {
ItemStack dust = null;
@@ -77,11 +77,11 @@ public enum ExtraBeeItems implements IItemMisc {
}
final ItemStack input = item.get(1);
if (dust != null) {
GameRegistry.addShapelessRecipe(dust, new Object[]{input, input, input, input});
GameRegistry.addShapelessRecipe(dust, input, input, input, input);
} else if (ingot != null) {
GameRegistry.addShapelessRecipe(ingot, new Object[]{input, input, input, input, input, input, input, input, input});
GameRegistry.addShapelessRecipe(ingot, input, input, input, input, input, input, input, input, input);
} else if (item == ExtraBeeItems.CoalDust) {
GameRegistry.addShapelessRecipe(new ItemStack(Items.COAL), new Object[]{input, input, input, input});
GameRegistry.addShapelessRecipe(new ItemStack(Items.COAL), input, input, input, input);
}
} else if (item.gemString != null) {
ItemStack gem = null;
@@ -90,7 +90,7 @@ public enum ExtraBeeItems implements IItemMisc {
}
final ItemStack input2 = item.get(1);
if (gem != null) {
GameRegistry.addShapelessRecipe(gem.copy(), new Object[]{input2, input2, input2, input2, input2, input2, input2, input2, input2});
GameRegistry.addShapelessRecipe(gem.copy(), input2, input2, input2, input2, input2, input2, input2, input2, input2);
}
}
}
@@ -103,7 +103,7 @@ public enum ExtraBeeItems implements IItemMisc {
if (woodGear != null) {
gear = new ItemStack(woodGear, 1);
}
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("for.honey", 500), (ItemStack) null, ExtraBeeItems.ScentedGear.get(1), new Object[]{" j ", "bgb", " p ", 'j', Mods.Forestry.item("royalJelly"), 'b', Mods.Forestry.item("beeswax"), 'p', Mods.Forestry.item("pollen"), 'g', gear});
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("for.honey", 500), null, ExtraBeeItems.ScentedGear.get(1), " j ", "bgb", " p ", 'j', Mods.Forestry.item("royalJelly"), 'b', Mods.Forestry.item("beeswax"), 'p', Mods.Forestry.item("pollen"), 'g', gear);
}
ExtraBeeItems(final String name, final String iconPath) {
@@ -46,7 +46,7 @@ public class ModuleGenetics implements IInitializable {
++ebSpeciesCount;
}
}
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(ExtraBees.dictionary), new Object[]{"X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotTin", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD});
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(ExtraBees.dictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotTin", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
}
public static IGenome getGenome(final IAlleleBeeSpecies allele0) {
@@ -226,14 +226,14 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
case LIGHTNING: {
if (world.rand.nextInt(100) < 1 && world.canBlockSeeSky(pos) && world instanceof WorldServer) {
((WorldServer) world).addWeatherEffect(new EntityBeeLightning(world, x1, y1, z1));
world.addWeatherEffect(new EntityBeeLightning(world, x1, y1, z1));
break;
}
break;
}
case METEOR: {
if (world.rand.nextInt(100) < 1 && world.canBlockSeeSky(pos)) {
((WorldServer) world).spawnEntityInWorld(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0, -0.6, 0.0));
world.spawnEntityInWorld(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0, -0.6, 0.0));
break;
}
break;
@@ -349,7 +349,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
final EntityFireworkRocket var11 = new EntityFireworkRocket(world, x1, y1, z1, firework.getFirework());
if (world.canBlockSeeSky(pos)) {
((WorldServer) world).spawnEntityInWorld(var11);
world.spawnEntityInWorld(var11);
}
break;
}
@@ -406,7 +406,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
if (!world.isAirBlock(pos) || !world.isAirBlock(pos.up())) {
return null;
}
((EntityLiving) entity4).setPositionAndUpdate(x1, y1, z1);
entity4.setPositionAndUpdate(x1, y1, z1);
((EntityLiving) entity4).addPotionEffect(new PotionEffect(MobEffects.NAUSEA, 160, 10));
break;
}
@@ -38,7 +38,7 @@ public enum EnumPropolis implements IItemEnum {
public void addRecipe() {
final FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 500);
if (liquid != null) {
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{this.get(1)}, liquid, (ItemStack) null, 0);
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{this.get(1)}, liquid, null, 0);
}
}
@@ -45,7 +45,7 @@ public class ModuleProducts implements IInitializable {
@Override
public void postInit() {
GameRegistry.addRecipe(new ItemStack(ExtraBees.honeyCrystalEmpty), new Object[]{"#@#", "@#@", "#@#", '@', Mods.Forestry.stack("honeyDrop"), '#', EnumHoneyDrop.ENERGY.get(1)});
GameRegistry.addRecipe(new ItemStack(ExtraBees.honeyCrystalEmpty), "#@#", "@#@", "#@#", '@', Mods.Forestry.stack("honeyDrop"), '#', EnumHoneyDrop.ENERGY.get(1));
for (final EnumHoneyComb info : EnumHoneyComb.values()) {
info.addRecipe();
}