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

@@ -119,23 +119,23 @@ public class ModuleGardening implements IInitializable {
final ItemStack tubes = new ItemStack(Botany.insulatedTube, 2, mat + 128 * insulate);
final ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
final ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, mat);
GameRegistry.addShapelessRecipe(tubes, new Object[]{forestryTube, forestryTube, insulateStack});
GameRegistry.addShapelessRecipe(tubes, forestryTube, forestryTube, insulateStack);
}
}
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelWood, new Object[]{"d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "plankWood"}));
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelStone, new Object[]{"d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "cobblestone"}));
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelIron, new Object[]{"d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "ingotIron"}));
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelGold, new Object[]{"d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "ingotGold"}));
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.trowelDiamond, new Object[]{"d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "gemDiamond"}));
GameRegistry.addRecipe(new ShapedOreRecipe((Item) Botany.soilMeter, new Object[]{" gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", 'i', "ingotIron"}));
GameRegistry.addShapelessRecipe(BotanyItems.Weedkiller.get(4), new Object[]{new ItemStack(Items.SPIDER_EYE), new ItemStack(Items.WHEAT_SEEDS), new ItemStack(Items.WHEAT_SEEDS), new ItemStack(Items.WHEAT_SEEDS)});
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), new Object[]{Mods.Forestry.stack("ash")});
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), new Object[]{Mods.Forestry.stack("mulch")});
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), new Object[]{Mods.Forestry.stack("fertilizerBio")});
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), new Object[]{Mods.Forestry.stack("fertilizerCompound")});
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), new Object[]{Mods.Forestry.stack("woodPulp")});
GameRegistry.addRecipe(new ShapelessOreRecipe(BotanyItems.SulphurPowder.get(4), new Object[]{"dustSulphur"}));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Botany.pigment, 2, EnumFlowerColor.Black.ordinal()), new Object[]{"pigment", "pigment", "dyeBlack"}));
GameRegistry.addRecipe(new ShapedOreRecipe(Botany.trowelWood, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "plankWood"));
GameRegistry.addRecipe(new ShapedOreRecipe(Botany.trowelStone, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "cobblestone"));
GameRegistry.addRecipe(new ShapedOreRecipe(Botany.trowelIron, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(Botany.trowelGold, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "ingotGold"));
GameRegistry.addRecipe(new ShapedOreRecipe(Botany.trowelDiamond, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", 'x', "gemDiamond"));
GameRegistry.addRecipe(new ShapedOreRecipe(Botany.soilMeter, " gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", 'i', "ingotIron"));
GameRegistry.addShapelessRecipe(BotanyItems.Weedkiller.get(4), new ItemStack(Items.SPIDER_EYE), new ItemStack(Items.WHEAT_SEEDS), new ItemStack(Items.WHEAT_SEEDS), new ItemStack(Items.WHEAT_SEEDS));
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.Forestry.stack("ash"));
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.Forestry.stack("mulch"));
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.Forestry.stack("fertilizerBio"));
GameRegistry.addShapelessRecipe(BotanyItems.FertiliserPowder.get(4), Mods.Forestry.stack("fertilizerCompound"));
GameRegistry.addShapelessRecipe(BotanyItems.PulpPowder.get(4), Mods.Forestry.stack("woodPulp"));
GameRegistry.addRecipe(new ShapelessOreRecipe(BotanyItems.SulphurPowder.get(4), "dustSulphur"));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Botany.pigment, 2, EnumFlowerColor.Black.ordinal()), "pigment", "pigment", "dyeBlack"));
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("forestry", "mulch")), 2);
@@ -159,15 +159,15 @@ public class ModuleGardening implements IInitializable {
for (final Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedNutrientFertilisers.entrySet()) {
this.addNutrientFertiliser(entry.getKey(), entry.getValue());
}
GameRegistry.addRecipe(BotanyItems.Mortar.get(6), new Object[]{" c ", "cgc", " c ", 'c', Items.CLAY_BALL, 'g', Blocks.GRAVEL});
GameRegistry.addRecipe(BotanyItems.Mortar.get(6), " c ", "cgc", " c ", 'c', Items.CLAY_BALL, 'g', Blocks.GRAVEL);
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
final ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
final ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
GameRegistry.addShapelessRecipe(clay, new Object[]{Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment});
GameRegistry.addShapelessRecipe(clay, Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment);
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f);
final ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal());
glass.stackSize = 4;
GameRegistry.addShapedRecipe(glass, new Object[]{" g ", "gpg", " g ", 'g', Blocks.GLASS, 'p', pigment});
GameRegistry.addShapedRecipe(glass, " g ", "gpg", " g ", 'g', Blocks.GLASS, 'p', pigment);
}
GameRegistry.addRecipe(new PigmentRecipe());
}
@@ -58,12 +58,12 @@ public class ModuleGenetics implements IInitializable {
@Override
public void postInit() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Botany.encyclopedia), new Object[]{"fff", "fbf", "fff", 'f', new ItemStack(Blocks.RED_FLOWER, 1, 32767), 'b', Items.BOOK}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Botany.encyclopedia), new Object[]{"fff", "fbf", "fff", 'f', new ItemStack(Blocks.YELLOW_FLOWER, 1, 32767), 'b', Items.BOOK}));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Botany.encyclopedia), new Object[]{"fff", "fbf", "fff", 'f', new ItemStack(Botany.flower, 1, 32767), 'b', Items.BOOK}));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Botany.encyclopediaIron), new Object[]{new ItemStack(Botany.encyclopedia), "ingotIron"}));
FlowerManager.flowerRegistry.registerAcceptableFlower(Botany.flower, new String[]{"flowersVanilla"});
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(Botany.database), new Object[]{"X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', Items.GOLD_NUGGET, 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD});
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Botany.encyclopedia), "fff", "fbf", "fff", 'f', new ItemStack(Blocks.RED_FLOWER, 1, 32767), 'b', Items.BOOK));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Botany.encyclopedia), "fff", "fbf", "fff", 'f', new ItemStack(Blocks.YELLOW_FLOWER, 1, 32767), 'b', Items.BOOK));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Botany.encyclopedia), "fff", "fbf", "fff", 'f', new ItemStack(Botany.flower, 1, 32767), 'b', Items.BOOK));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Botany.encyclopediaIron), new ItemStack(Botany.encyclopedia), "ingotIron"));
FlowerManager.flowerRegistry.registerAcceptableFlower(Botany.flower, "flowersVanilla");
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(Botany.database), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', Items.GOLD_NUGGET, 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
}
static {
+6 -4
View File
@@ -10,6 +10,8 @@ import net.minecraftforge.fml.common.versioning.ArtifactVersion;
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
import net.minecraftforge.fml.common.versioning.Restriction;
import java.util.Objects;
public class Mods {
public static Mod Forestry;
public static Mod IC2;
@@ -18,7 +20,7 @@ public class Mods {
private static Item findItem(final String modId, final String name) {
final Item stack = Item.REGISTRY.getObject(new ResourceLocation(modId, name));
if (stack == null && Mods.WARN && modId == "forestry") {
if (stack == null && Mods.WARN && Objects.equals(modId, "forestry")) {
//throw new RuntimeException("Item not found: " + modId + ":" + name);
}
@@ -27,7 +29,7 @@ public class Mods {
private static ItemStack findItemStack(final String modId, final String name, final int stackSize) {
final ItemStack stack = GameRegistry.makeItemStack(modId + ":" + name, 0, stackSize, null);
if (stack == null && Mods.WARN && modId == "forestry") {
if (stack == null && Mods.WARN && Objects.equals(modId, "forestry")) {
//throw new RuntimeException("Stack not found: " + modId + ":" + name);
}
return stack;
@@ -35,7 +37,7 @@ public class Mods {
private static Block findBlock(final String modId, final String name) {
final Block stack = Block.REGISTRY.getObject(new ResourceLocation(modId + ":" + name));
if (stack == null && Mods.WARN && modId == "forestry") {
if (stack == null && Mods.WARN && Objects.equals(modId, "forestry")) {
//throw new RuntimeException("Block not found: " + modId + ":" + name);
}
return stack;
@@ -46,7 +48,7 @@ public class Mods {
@Override
public boolean dev() {
final String forVersion = Loader.instance().getIndexedModList().get("forestry").getVersion();
final Restriction rest = new Restriction(new DefaultArtifactVersion("3.6"), true, (ArtifactVersion) null, false);
final Restriction rest = new Restriction(new DefaultArtifactVersion("3.6"), true, null, false);
return rest.containsVersion(new DefaultArtifactVersion(forVersion));
}
};
@@ -405,7 +405,7 @@ public abstract class BreedingSystem implements IItemStackRepresentitive {
if (allele instanceof IAlleleBoolean) {
return ((IAlleleBoolean) allele).getValue() ? Binnie.Language.localise(BinnieCore.instance, "allele.true") : Binnie.Language.localise(BinnieCore.instance, "allele.false");
}
if (allele.getName() == "for.gui.maximum") {
if (Objects.equals(allele.getName(), "for.gui.maximum")) {
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum");
}
return allele.getName();
@@ -20,7 +20,7 @@ class FlowerBreedingSystem extends BreedingSystem {
@Override
public float getChance(final IMutation mutation, final EntityPlayer player, final IAllele species1, final IAllele species2) {
return ((IFlowerMutation) mutation).getBaseChance();
return mutation.getBaseChance();
}
@Override
@@ -29,7 +29,7 @@ public class ModuleItems implements IInitializable {
@Override
public void postInit() {
GameRegistry.addRecipe(new ItemStack(BinnieCore.fieldKit, 1, 63), new Object[]{"g ", " is", " pi", 'g', Blocks.GLASS_PANE, 'i', Items.IRON_INGOT, 'p', Items.PAPER, 's', new ItemStack(Items.DYE, 1)});
GameRegistry.addRecipe(new ItemStack(BinnieCore.fieldKit, 1, 63), "g ", " is", " pi", 'g', Blocks.GLASS_PANE, 'i', Items.IRON_INGOT, 'p', Items.PAPER, 's', new ItemStack(Items.DYE, 1));
}
@SubscribeEvent
@@ -66,7 +66,7 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
}
public <T extends MachineComponent> T getComponent(final Class<T> componentClass) {
return this.hasComponent(componentClass) ? ((T) componentClass.cast(this.componentMap.get(componentClass))) : null;
return this.hasComponent(componentClass) ? componentClass.cast(this.componentMap.get(componentClass)) : null;
}
@Override
@@ -18,7 +18,7 @@ class ModelBlock extends ModelBase {
}
public void render(final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
super.render((Entity) null, f, f1, f2, f3, f4, f5);
super.render(null, f, f1, f2, f3, f4, f5);
this.setRotationAngles(f, f1, f2, f3, f4, f5);
this.Block.render(f5);
}
@@ -30,6 +30,6 @@ class ModelBlock extends ModelBase {
}
public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
super.setRotationAngles(f, f1, f2, f3, f4, f5, (Entity) null);
super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
}
}
@@ -143,6 +143,6 @@ class ModelCompartment extends ModelBase {
}
public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
super.setRotationAngles(f, f1, f2, f3, f4, f5, (Entity) null);
super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
}
}
@@ -25,11 +25,11 @@ public class ModuleStorage implements IInitializable {
final String ironGear = OreDictionary.getOres("gearIron").isEmpty() ? "ingotIron" : "gearIron";
final String goldGear = OreDictionary.getOres("gearGold").isEmpty() ? "ingotGold" : "gearGold";
final String diamondGear = "gemDiamond";
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.Compartment.get(1), new Object[]{"pcp", "cbc", "pcp", 'b', Items.BOOK, 'c', Blocks.CHEST, 'p', Blocks.STONE_BUTTON}));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentCopper.get(1), new Object[]{"pcp", "cbc", "pcp", 'b', Compartment.Compartment.get(1), 'c', "gearCopper", 'p', Blocks.STONE_BUTTON}));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentBronze.get(1), new Object[]{"pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', "gearBronze", 'p', Items.GOLD_NUGGET}));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentIron.get(1), new Object[]{"pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', ironGear, 'p', Items.GOLD_NUGGET}));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentGold.get(1), new Object[]{"pcp", "cbc", "pcp", 'b', Compartment.CompartmentIron.get(1), 'c', goldGear, 'p', Items.EMERALD}));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentDiamond.get(1), new Object[]{"pcp", "cbc", "pcp", 'b', Compartment.CompartmentGold.get(1), 'c', diamondGear, 'p', Items.EMERALD}));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.Compartment.get(1), "pcp", "cbc", "pcp", 'b', Items.BOOK, 'c', Blocks.CHEST, 'p', Blocks.STONE_BUTTON));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentCopper.get(1), "pcp", "cbc", "pcp", 'b', Compartment.Compartment.get(1), 'c', "gearCopper", 'p', Blocks.STONE_BUTTON));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentBronze.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', "gearBronze", 'p', Items.GOLD_NUGGET));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentIron.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', ironGear, 'p', Items.GOLD_NUGGET));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentGold.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentIron.get(1), 'c', goldGear, 'p', Items.EMERALD));
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentDiamond.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentGold.get(1), 'c', diamondGear, 'p', Items.EMERALD));
}
}
@@ -32,7 +32,7 @@ public class BinnieModProxy implements IBinnieModProxy {
@Override
public void sendToPlayer(final MessageBase packet, final EntityPlayer entityplayer) {
if (entityplayer instanceof EntityPlayerMP) {
this.mod.getNetworkWrapper().sendTo((IMessage) packet.GetMessage(), (EntityPlayerMP) entityplayer);
this.mod.getNetworkWrapper().sendTo(packet.GetMessage(), (EntityPlayerMP) entityplayer);
}
}
@@ -91,7 +91,7 @@ public final class BinnieProxyClient extends BinnieProxy implements IBinnieProxy
public boolean checkTexture(final BinnieResource location) {
final SimpleTexture texture = new SimpleTexture(location.getResourceLocation());
try {
((ITextureObject) texture).loadTexture(this.getMinecraftInstance().getResourceManager());
texture.loadTexture(this.getMinecraftInstance().getResourceManager());
} catch (IOException e) {
return false;
}
@@ -120,7 +120,7 @@ public class WindowGenesis extends Window {
public void onEvent(final EventValueChanged event) {
final Map<IChromosomeType, List<IAllele>> map = Binnie.Genetics.getChromosomeMap(WindowGenesis.this.root);
final List<Gene> opts = new ArrayList<>();
final IChromosomeType chromo = ((Gene) event.value) != null ? ((Gene) event.value).getChromosome() : null;
final IChromosomeType chromo = event.value != null ? ((Gene) event.value).getChromosome() : null;
if (chromo != null)// fix NPE
for (final IAllele allele : map.get(chromo)) {
opts.add(new Gene(allele, chromo, WindowGenesis.this.root));
@@ -12,7 +12,7 @@ public class ControlColourMixBox extends ControlListBox<IColourMix> {
@Override
public IWidget createOption(final IColourMix value, final int y) {
return new ControlColourMixItem(((ControlScrollableContent<ControlList<IColourMix>>) this).getContent(), value, y);
return new ControlColourMixItem(this.getContent(), value, y);
}
public ControlColourMixBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
@@ -45,7 +45,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
this.listBox = new ControlListBox<IFlowerColour>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
@Override
public IWidget createOption(final IFlowerColour value, final int y) {
return new ControlColourOption(((ControlScrollableContent<ControlList<IFlowerColour>>) this).getContent(), value, y);
return new ControlColourOption(this.getContent(), value, y);
}
};
final List<IFlowerColour> colors = new ArrayList<>();
@@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class ControlTileSelect extends Control implements IControlValue<IDesign>, IControlScrollable {
IDesign value;
@@ -74,7 +75,7 @@ public class ControlTileSelect extends Control implements IControlValue<IDesign>
for (final IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) {
designs.put(category, new ArrayList<>());
for (final IDesign tile : category.getDesigns()) {
if (filterText == "" || tile.getName().toLowerCase().contains(filterText)) {
if (Objects.equals(filterText, "") || tile.getName().toLowerCase().contains(filterText)) {
designs.get(category).add(tile);
}
}
@@ -72,7 +72,7 @@ public class PageSpeciesTreeGenome extends PageSpecies {
try {
//TODO RENDERING
//fruit = ForestryAPI.textureManager.getIcon(genome.getFruitProvider().getIconIndex(genome, (IBlockAccess) null, 0, 0, 0, 100, false));
fruitColour = genome.getFruitProvider().getColour(genome, (IBlockAccess) null, new BlockPos(0, 0, 0), 100);
fruitColour = genome.getFruitProvider().getColour(genome, null, new BlockPos(0, 0, 0), 100);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -44,7 +44,7 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
@Override
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(((ControlScrollableContent<ControlList<ItemStack>>) this).getContent(), value, y);
return new ControlItemStackOption(this.getContent(), value, y);
}
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allFruits);
}
@@ -55,7 +55,7 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
@Override
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(((ControlScrollableContent<ControlList<ItemStack>>) this).getContent(), value, y);
return new ControlItemStackOption(this.getContent(), value, y);
}
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allWoods);
}
@@ -66,7 +66,7 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
@Override
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(((ControlScrollableContent<ControlList<ItemStack>>) this).getContent(), value, y);
return new ControlItemStackOption(this.getContent(), value, y);
}
};
}
@@ -55,7 +55,7 @@ public class WindowPress extends Window {
logic.alterProgress(2.0f);
} else if (side == Side.SERVER && name.equals("clear-fruit")) {
logic.setProgress(0.0f);
this.getInventory().setInventorySlotContents(Press.slotCurrent, (ItemStack) null);
this.getInventory().setInventorySlotContents(Press.slotCurrent, null);
}
}
}
@@ -75,7 +75,7 @@ public class ContainerCraftGUI extends Container {
if (par1 < 0 || par1 >= this.inventorySlots.size()) {
return null;
}
return (Slot) this.inventorySlots.get(par1);
return this.inventorySlots.get(par1);
}
@Override
@@ -150,7 +150,7 @@ public class ContainerCraftGUI extends Container {
return null;
}
final ItemStack itemstack = request.transfer(true);
final Slot shiftClickedSlot = (Slot) this.inventorySlots.get(slotnumber);
final Slot shiftClickedSlot = this.inventorySlots.get(slotnumber);
shiftClickedSlot.putStack(itemstack);
shiftClickedSlot.onSlotChanged();
return null;
@@ -270,7 +270,7 @@ public class ContainerCraftGUI extends Container {
//TODO INVENTORY
this.crafters.stream().filter(Objects::nonNull).forEach(entityPlayer -> {
System.out.println("send to:" + entityPlayer.getDisplayName().getUnformattedText());
BinnieCore.proxy.sendToPlayer(new MessageContainerUpdate(nbt.getValue()), (EntityPlayerMP) entityPlayer);
BinnieCore.proxy.sendToPlayer(new MessageContainerUpdate(nbt.getValue()), entityPlayer);
});
sentThisTime.put(nbt.getKey(), nbt.getValue());
}
@@ -36,7 +36,7 @@ public class CustomSlot extends Slot {
ItemStack stack = player.inventory.getItemStack();
//TODO modifier==mouseButton2?
if (stack == null || modifier == ClickType.PICKUP_ALL) {
this.putStack((ItemStack) null);
this.putStack(null);
} else {
stack = stack.copy();
stack.stackSize = 1;
@@ -404,7 +404,7 @@ public class GuiCraftGUI extends GuiContainer {
}
Minecraft.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI(item, (int) pos.x(), (int) pos.y());
GL11.glPopMatrix();
Minecraft.getMinecraft().getRenderItem().renderItemOverlayIntoGUI(font, item, (int) pos.x(), (int) pos.y(), (String) null);
Minecraft.getMinecraft().getRenderItem().renderItemOverlayIntoGUI(font, item, (int) pos.x(), (int) pos.y(), null);
}
GL11.glClear(256);
GL11.glEnable(3042);
@@ -104,8 +104,9 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
}
public String showInfoButton() {
if (Machine.getInterface(IMachineInformation.class, this.getInventory()) != null) {
return Machine.getInterface(IMachineInformation.class, this.getInventory()).getInformation();
IMachineInformation machineInformation = Machine.getInterface(IMachineInformation.class, this.getInventory());
if (machineInformation != null) {
return machineInformation.getInformation();
}
return null;
}
@@ -4,6 +4,8 @@ import binnie.craftgui.controls.core.Control;
import binnie.craftgui.core.*;
import binnie.craftgui.resource.minecraft.CraftGUITexture;
import java.util.Objects;
public class ControlUser extends Control implements ITooltip {
private String username;
String team;
@@ -25,7 +27,7 @@ public class ControlUser extends Control implements ITooltip {
public void getTooltip(final Tooltip tooltip) {
tooltip.setType(Tooltip.Type.User);
tooltip.add("Owner");
if (this.username != "") {
if (!Objects.equals(this.username, "")) {
tooltip.add(this.username);
}
tooltip.setMaxWidth(200);
@@ -9,7 +9,7 @@ import forestry.api.genetics.IClassification;
class ControlBranchBox extends ControlListBox<IClassification> {
@Override
public IWidget createOption(final IClassification value, final int y) {
return new ControlBranchBoxOption(((ControlScrollableContent<ControlList<IClassification>>) this).getContent(), value, y);
return new ControlBranchBoxOption(this.getContent(), value, y);
}
public ControlBranchBox(final IWidget parent, final float x, final float y, final float width, final float height) {
@@ -18,7 +18,7 @@ class ControlMutationBox extends ControlListBox<IMutation> {
@Override
public IWidget createOption(final IMutation value, final int y) {
return new ControlMutationItem(((ControlScrollableContent<ControlList<IMutation>>) this).getContent(), value, this.species, y);
return new ControlMutationItem(this.getContent(), value, this.species, y);
}
public ControlMutationBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
@@ -19,7 +19,7 @@ public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies> {
@Override
public IWidget createOption(final IAlleleSpecies value, final int y) {
return new ControlSpeciexBoxOption(((ControlScrollableContent<ControlList<IAlleleSpecies>>) this).getContent(), value, y);
return new ControlSpeciexBoxOption(this.getContent(), value, y);
}
public ControlSpeciesBox(final IWidget parent, final float x, final float y, final float width, final float height) {
@@ -8,6 +8,7 @@ import forestry.api.genetics.IClassification;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class PageBranchOverview extends PageBranch {
private ControlText pageBranchOverview_branchName;
@@ -33,7 +34,7 @@ public class PageBranchOverview extends PageBranch {
}
this.pageBranchOverview_branchDescription.clear();
String desc = branch.getDescription();
if (desc == null || desc == "") {
if (desc == null || Objects.equals(desc, "")) {
desc = "No Description Provided.";
}
String line = "";
@@ -9,6 +9,8 @@ import binnie.craftgui.core.geometry.IPoint;
import binnie.craftgui.core.geometry.TextJustification;
import forestry.api.genetics.IAlleleSpecies;
import java.util.Objects;
public class PageSpeciesOverview extends PageSpecies {
private ControlText controlName;
private ControlText controlScientific;
@@ -44,7 +46,7 @@ public class PageSpeciesOverview extends PageSpecies {
final String desc = species.getDescription();
String descBody = "§o";
String descSig = "";
if (desc == null || desc == "") {
if (desc == null || Objects.equals(desc, "")) {
descBody += "No Description Provided.";
} else {
final String[] descStrings = desc.split("\\|");
@@ -32,6 +32,7 @@ import net.minecraftforge.fml.relauncher.Side;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public abstract class WindowAbstractDatabase extends Window {
private float selectionBoxWidth;
@@ -120,7 +121,7 @@ public abstract class WindowAbstractDatabase extends Window {
widgets.listBox.setValidator(new IValidator<IWidget>() {
@Override
public boolean isValid(final IWidget object) {
return event.getValue() == "" || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
return Objects.equals(event.getValue(), "") || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
}
});
}
@@ -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();
}
@@ -5,6 +5,7 @@ import binnie.extratrees.alcohol.drink.DrinkManager;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public enum Cocktail {
Bellini("Bellini", Glassware.Flute, 15974764),
@@ -58,7 +59,7 @@ public enum Cocktail {
for (final Cocktail cocktail : values()) {
boolean is = true;
for (final Map.Entry<ICocktailIngredient, Integer> entry : ingredients.entrySet()) {
if (cocktail.ingredients.get(entry.getKey()) != entry.getValue()) {
if (!Objects.equals(cocktail.ingredients.get(entry.getKey()), entry.getValue())) {
is = false;
}
}
@@ -21,6 +21,7 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class ModuleAlcohol implements IInitializable {
public static int drinkRendererID;
@@ -69,13 +70,13 @@ public class ModuleAlcohol implements IInitializable {
for (final ItemStack stack : ores) {
for (final ISqueezerRecipe entry : RecipeManagers.squeezerManager.recipes()) {
try {
final ItemStack input = (ItemStack) entry.getResources()[0];
final ItemStack input = entry.getResources()[0];
final FluidStack output = entry.getFluidOutput();
if (!ItemStack.areItemStacksEqual(stack, input) && !OreDictionary.itemMatches(input, stack, true)) {
continue;
}
int amount = output.amount;
if (output.getFluid().getName() == "seedoil") {
if (Objects.equals(output.getFluid().getName(), "seedoil")) {
amount *= 2;
}
Press.addRecipe(stack, juice.get(amount));
@@ -132,9 +132,9 @@ public class ModuleBlocks implements IInitializable {
final ItemStack slabs = TileEntityMetadata.getItemStack(ExtraTrees.blockSlab, plank.ordinal());
final ItemStack stairs = TileEntityMetadata.getItemStack(ExtraTrees.blockStairs, plank.ordinal());
stairs.stackSize = 4;
GameRegistry.addRecipe(stairs.copy(), new Object[]{"# ", "## ", "###", '#', planks.copy()});
GameRegistry.addRecipe(stairs.copy(), "# ", "## ", "###", '#', planks.copy());
slabs.stackSize = 6;
CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), new Object[]{"###", '#', planks.copy()}));
CraftingManager.getInstance().getRecipeList().add(0, new ShapedOreRecipe(slabs.copy(), "###", '#', planks.copy()));
}
GameRegistry.addRecipe(new MultiFenceRecipeSize());
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
@@ -152,13 +152,13 @@ public class ModuleBlocks implements IInitializable {
continue;
}
gate.stackSize = 1;
GameRegistry.addRecipe(gate.copy(), new Object[]{"fpf", 'f', fenceNormal.copy(), 'p', planks2.copy()});
GameRegistry.addRecipe(gate.copy(), "fpf", 'f', fenceNormal.copy(), 'p', planks2.copy());
fenceNormal.stackSize = 4;
GameRegistry.addRecipe(fenceNormal.copy(), new Object[]{"###", "# #", '#', planks2.copy()});
GameRegistry.addRecipe(doorSolid.copy(), new Object[]{"###", "###", "###", '#', planks2.copy()});
GameRegistry.addRecipe(doorStandard.copy(), new Object[]{"# #", "###", "###", '#', planks2.copy()});
GameRegistry.addRecipe(doorSplit.copy(), new Object[]{"# #", "###", "# #", '#', planks2.copy()});
GameRegistry.addRecipe(doorFull.copy(), new Object[]{"# #", "# #", "# #", '#', planks2.copy()});
GameRegistry.addRecipe(fenceNormal.copy(), "###", "# #", '#', planks2.copy());
GameRegistry.addRecipe(doorSolid.copy(), "###", "###", "###", '#', planks2.copy());
GameRegistry.addRecipe(doorStandard.copy(), "# #", "###", "###", '#', planks2.copy());
GameRegistry.addRecipe(doorSplit.copy(), "# #", "###", "# #", '#', planks2.copy());
GameRegistry.addRecipe(doorFull.copy(), "# #", "# #", "# #", '#', planks2.copy());
}
}
this.addSqueezer(EnumVanillaWoodType.SPRUCE, ExtraTreeLiquid.Resin, 50);
@@ -259,8 +259,13 @@ public class PlankType {
public ItemStack getStack() {
try {
final Class clss = Class.forName("extrabiomes.api.Stuff");
final Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
return new ItemStack(block, 1, this.ordinal());
Optional planks = (Optional) clss.getField("planks").get(null);
if (planks.isPresent()) {
final Block block = (Block) planks.get();
return new ItemStack(block, 1, this.ordinal());
} else {
return null;
}
} catch (Exception e) {
return null;
}
@@ -8,16 +8,19 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
import java.util.HashMap;
public class NBTShapedRecipe implements IRecipe {
public final int recipeWidth;
public final int recipeHeight;
public final ItemStack[] recipeItems;
@Nonnull
private ItemStack recipeOutput;
private boolean field_92101_f;
private static final String __OBFID = "CL_00000093";
@Nonnull
@Override
public ItemStack getRecipeOutput() {
return this.recipeOutput;
@@ -84,7 +87,7 @@ public class NBTShapedRecipe implements IRecipe {
for (int i = 0; i < p_77572_1_.getSizeInventory(); ++i) {
final ItemStack itemstack2 = p_77572_1_.getStackInSlot(i);
if (itemstack2 != null && itemstack2.hasTagCompound()) {
itemstack.setTagCompound((NBTTagCompound) itemstack2.getTagCompound().copy());
itemstack.setTagCompound(itemstack2.getTagCompound().copy());
}
}
}
@@ -96,7 +99,7 @@ public class NBTShapedRecipe implements IRecipe {
return this.recipeWidth * this.recipeHeight;
}
public NBTShapedRecipe(final ItemStack p_92103_1_, final Object... p_92103_2_) {
public NBTShapedRecipe(@Nonnull final ItemStack recipeOutput, final Object... p_92103_2_) {
String s = "";
int i = 0;
int j = 0;
@@ -142,7 +145,7 @@ public class NBTShapedRecipe implements IRecipe {
this.recipeWidth = j;
this.recipeHeight = k;
this.recipeItems = aitemstack;
this.recipeOutput = p_92103_1_;
this.recipeOutput = recipeOutput;
NBTShapedRecipes.addRecipe(this);
}
}
@@ -119,7 +119,7 @@ public class ModuleCore implements IInitializable {
if (wood4 == null) {
outputDesigns.println("<td></td>");
} else {
final String texture = ((EnumPattern) wood4.getTopPattern().getPattern()).toString().toLowerCase();
final String texture = wood4.getTopPattern().getPattern().toString().toLowerCase();
final String img2 = "<img alt=\"" + texture + "\" src=\"images/pattern/" + texture + ".png\">";
outputDesigns.println("<td>" + img2 + " " + wood4.getName() + "</td>");
}
@@ -545,9 +545,9 @@ public class ExtraTreeSpecies implements IAlleleTreeSpecies//, IIconProvider, IG
try {
final Class elements = Class.forName("extrabiomes.lib.Element");
final Method getElementMethod = elements.getMethod("valueOf", String.class);
final Method getItemStack = elements.getMethod("get", new Class[0]);
final Method getItemStack = elements.getMethod("get");
final Object element = getElementMethod.invoke(null, "SAPLING_AUTUMN_YELLOW");
return (ItemStack) getItemStack.invoke(element, new Object[0]);
return (ItemStack) getItemStack.invoke(element);
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -107,36 +107,36 @@ public class ModuleItems implements IInitializable {
@Override
public void postInit() {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ExtraTrees.itemDurableHammer, 1, 0), new Object[]{"wiw", " s ", " s ", 'w', Blocks.OBSIDIAN, 'i', Items.GOLD_INGOT, 's', Items.STICK}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ExtraTrees.itemHammer, 1, 0), new Object[]{"wiw", " s ", " s ", 'w', "plankWood", 'i', Items.IRON_INGOT, 's', Items.STICK}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.Yeast.get(8), new Object[]{" m ", "mbm", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.LagerYeast.get(8), new Object[]{"mbm", " m ", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM}));
GameRegistry.addRecipe(ExtraTreeItems.GrainWheat.get(5), new Object[]{" s ", "sss", " s ", 's', Items.WHEAT_SEEDS});
GameRegistry.addRecipe(ExtraTreeItems.GrainBarley.get(3), new Object[]{" s ", "s ", " s ", 's', ExtraTreeItems.GrainWheat.get(1)});
GameRegistry.addRecipe(ExtraTreeItems.GrainCorn.get(3), new Object[]{" s ", " s", " s ", 's', ExtraTreeItems.GrainWheat.get(1)});
GameRegistry.addRecipe(ExtraTreeItems.GrainRye.get(3), new Object[]{" ", "s s", " s ", 's', ExtraTreeItems.GrainWheat.get(1)});
GameRegistry.addRecipe(ExtraTreeItems.Hops.get(3), new Object[]{" s ", "sps", " s ", 's', Items.WHEAT_SEEDS, 'p', Items.APPLE});
GameRegistry.addRecipe(ExtraTreeItems.ProvenGear.get(1), new Object[]{" s ", "s s", " s ", 's', Mods.Forestry.stack("oakStick")});
GameRegistry.addRecipe(ExtraTreeItems.GlassFitting.get(6), new Object[]{"s s", " i ", "s s", 'i', Items.IRON_INGOT, 's', Items.STICK});
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ExtraTrees.itemDurableHammer, 1, 0), "wiw", " s ", " s ", 'w', Blocks.OBSIDIAN, 'i', Items.GOLD_INGOT, 's', Items.STICK));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(ExtraTrees.itemHammer, 1, 0), "wiw", " s ", " s ", 'w', "plankWood", 'i', Items.IRON_INGOT, 's', Items.STICK));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.Yeast.get(8), " m ", "mbm", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.LagerYeast.get(8), "mbm", " m ", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM));
GameRegistry.addRecipe(ExtraTreeItems.GrainWheat.get(5), " s ", "sss", " s ", 's', Items.WHEAT_SEEDS);
GameRegistry.addRecipe(ExtraTreeItems.GrainBarley.get(3), " s ", "s ", " s ", 's', ExtraTreeItems.GrainWheat.get(1));
GameRegistry.addRecipe(ExtraTreeItems.GrainCorn.get(3), " s ", " s", " s ", 's', ExtraTreeItems.GrainWheat.get(1));
GameRegistry.addRecipe(ExtraTreeItems.GrainRye.get(3), " ", "s s", " s ", 's', ExtraTreeItems.GrainWheat.get(1));
GameRegistry.addRecipe(ExtraTreeItems.Hops.get(3), " s ", "sps", " s ", 's', Items.WHEAT_SEEDS, 'p', Items.APPLE);
GameRegistry.addRecipe(ExtraTreeItems.ProvenGear.get(1), " s ", "s s", " s ", 's', Mods.Forestry.stack("oakStick"));
GameRegistry.addRecipe(ExtraTreeItems.GlassFitting.get(6), "s s", " i ", "s s", 'i', Items.IRON_INGOT, 's', Items.STICK);
GameRegistry.addSmelting(ExtraTreeItems.GrainWheat.get(1), ExtraTreeItems.GrainRoasted.get(1), 0.0f);
GameRegistry.addSmelting(ExtraTreeItems.GrainRye.get(1), ExtraTreeItems.GrainRoasted.get(1), 0.0f);
GameRegistry.addSmelting(ExtraTreeItems.GrainCorn.get(1), ExtraTreeItems.GrainRoasted.get(1), 0.0f);
GameRegistry.addSmelting(ExtraTreeItems.GrainBarley.get(1), ExtraTreeItems.GrainRoasted.get(1), 0.0f);
try {
final Item minium = (Item) Class.forName("com.pahimar.ee3.lib.ItemIds").getField("miniumShard").get(null);
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(Food.Papayimar.get(1), new Object[]{minium, "cropPapaya"}));
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(Food.Papayimar.get(1), minium, "cropPapaya"));
} catch (Exception ex) {
}
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(ExtraTrees.itemDictionary), new Object[]{"X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotCopper", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD});
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(ExtraTrees.itemDictionaryLepi), new Object[]{"X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotBronze", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD});
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(ExtraTrees.itemDictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotCopper", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(ExtraTrees.itemDictionaryLepi), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotBronze", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
RecipeManagers.stillManager.addRecipe(25, ExtraTreeLiquid.Resin.get(5), ExtraTreeLiquid.Turpentine.get(3));
RecipeManagers.carpenterManager.addRecipe(25, ExtraTreeLiquid.Turpentine.get(50), (ItemStack) null, ((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 4), new Object[]{"x", 'x', Mods.Forestry.stack("beeswax")});
RecipeManagers.carpenterManager.addRecipe(25, ExtraTreeLiquid.Turpentine.get(50), null, ((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 4), "x", 'x', Mods.Forestry.stack("beeswax"));
if (Binnie.Liquid.getLiquidStack("Creosote Oil", 100) != null) {
RecipeManagers.carpenterManager.addRecipe(25, Binnie.Liquid.getLiquidStack("Creosote Oil", 50), (ItemStack) null, ((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 1), new Object[]{"x", 'x', Mods.Forestry.stack("beeswax")});
RecipeManagers.carpenterManager.addRecipe(25, Binnie.Liquid.getLiquidStack("Creosote Oil", 50), null, ((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 1), "x", 'x', Mods.Forestry.stack("beeswax"));
}
for (final FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if (data.fluid.isFluidEqual(Binnie.Liquid.getLiquidStack("water", 0)) && data.fluid.amount == 1000) {
CraftingManager.getInstance().addRecipe(Mods.Forestry.stack("mulch"), new Object[]{" b ", "bwb", " b ", 'b', ExtraTreeItems.Bark.get(1), 'w', data.filledContainer.copy()});
CraftingManager.getInstance().addRecipe(Mods.Forestry.stack("mulch"), " b ", "bwb", " b ", 'b', ExtraTreeItems.Bark.get(1), 'w', data.filledContainer.copy());
}
}
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Sap.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Sap.get(1).getFluid(), 20, 10000, 1));
@@ -12,8 +12,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public enum KitchenMachine implements IMachineType {
Worktop((Class<? extends MachinePackage>) null),
Cupboard((Class<? extends MachinePackage>) null),
Worktop(null),
Cupboard(null),
BottleRack(BottleRack.PackageBottleRack.class);
Class<? extends MachinePackage> clss;
@@ -28,13 +28,13 @@ public class ModuleMachine implements IInitializable {
@Override
public void postInit() {
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Lumbermill.get(1), new Object[]{"gAg", "GsG", "gPg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'A', Items.IRON_AXE, 's', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"}));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Press.get(1), new Object[]{"iGi", "tSt", "tPt", 'i', "ingotIron", 'G', Blocks.GLASS, 't', "ingotTin", 'S', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"}));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Brewery.get(1), new Object[]{"bGb", "iSi", "bPb", 'i', "ingotIron", 'G', Blocks.GLASS, 'b', "gearBronze", 'S', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"}));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Distillery.get(1), new Object[]{"rGr", "iSi", "rPr", 'i', "ingotIron", 'G', Blocks.GLASS, 'r', "dustRedstone", 'S', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Woodworker.get(1), new Object[]{"wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.PLANKS, 's', Mods.Forestry.stack("impregnatedCasing")}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Panelworker.get(1), new Object[]{"wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.WOODEN_SLAB, 's', Mods.Forestry.stack("impregnatedCasing")}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Glassworker.get(1), new Object[]{"wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.GLASS, 's', Mods.Forestry.stack("impregnatedCasing")}));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Tileworker.get(1), new Object[]{"wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Items.CLAY_BALL, 's', Mods.Forestry.stack("impregnatedCasing")}));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Lumbermill.get(1), "gAg", "GsG", "gPg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'A', Items.IRON_AXE, 's', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Press.get(1), "iGi", "tSt", "tPt", 'i', "ingotIron", 'G', Blocks.GLASS, 't', "ingotTin", 'S', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Brewery.get(1), "bGb", "iSi", "bPb", 'i', "ingotIron", 'G', Blocks.GLASS, 'b', "gearBronze", 'S', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(ExtraTreeMachine.Distillery.get(1), "rGr", "iSi", "rPr", 'i', "ingotIron", 'G', Blocks.GLASS, 'r', "dustRedstone", 'S', Mods.Forestry.stack("sturdyMachine"), 'P', "gearBronze"));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Woodworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.PLANKS, 's', Mods.Forestry.stack("impregnatedCasing")));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Panelworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.WOODEN_SLAB, 's', Mods.Forestry.stack("impregnatedCasing")));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Glassworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Blocks.GLASS, 's', Mods.Forestry.stack("impregnatedCasing")));
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeMachine.Tileworker.get(1), "wGw", "GsG", "ggg", 'G', Blocks.GLASS, 'g', ExtraTreeItems.ProvenGear.get(1), 'w', Items.CLAY_BALL, 's', Mods.Forestry.stack("impregnatedCasing")));
}
}
@@ -13,6 +13,6 @@ public class BlockTypeLeaf extends BlockType {
@Override
public void setBlock(final World world, final ITreeGenData tree, final BlockPos pos) {
tree.setLeaves(world, (GameProfile) null, pos);
tree.setLeaves(world, null, pos);
}
}
@@ -22,6 +22,7 @@ import forestry.api.genetics.IIndividual;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Objects;
public class AnalystPageDatabase extends ControlAnalystPage {
ControlScrollableContent scroll;
@@ -52,7 +53,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
AnalystPageDatabase.this.getSpecies(system);
for (final IAlleleSpecies species : AnalystPageDatabase.this.getSpecies(system)) {
if (value != null) {
if (value != "") {
if (!Objects.equals(value, "")) {
if (!species.getName().toLowerCase().contains(value.toLowerCase())) {
continue;
}
@@ -10,6 +10,8 @@ import binnie.craftgui.core.geometry.TextJustification;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IIndividual;
import java.util.Objects;
public class AnalystPageDescription extends ControlAnalystPage {
public AnalystPageDescription(final IWidget parent, final IArea area, final IIndividual ind) {
super(parent, area);
@@ -21,7 +23,7 @@ public class AnalystPageDescription extends ControlAnalystPage {
final String desc = species.getDescription();
String descBody = "§o";
String descSig = "";
if (desc == null || desc == "" || desc.contains("for.description")) {
if (desc == null || Objects.equals(desc, "") || desc.contains("for.description")) {
descBody += "";
} else {
final String[] descStrings = desc.split("\\|");
@@ -282,7 +282,7 @@ public class Inoculator {
public ComponentInoculatorFX(final IMachine machine) {
super(machine);
this.dummyEntityItem = new EntityItem((World) null);
this.dummyEntityItem = new EntityItem(null);
}
@SideOnly(Side.CLIENT)
@@ -24,6 +24,7 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Objects;
import java.util.Random;
public class Isolator {
@@ -82,7 +83,7 @@ public class Isolator {
@Override
public boolean isValid(final FluidStack stack) {
return stack.getFluid().getName() == "bioethanol";
return Objects.equals(stack.getFluid().getName(), "bioethanol");
}
});
final ComponentChargedSlots chargedSlots = new ComponentChargedSlots(machine);
@@ -72,6 +72,6 @@ public class ModelMachine extends ModelBase {
}
public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
super.setRotationAngles(f, f1, f2, f3, f4, f5, (Entity) null);
super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
}
}
@@ -50,7 +50,7 @@ public class ModuleMachine implements IInitializable {
final String goldGear = OreDictionary.getOres("gearGold").isEmpty() ? "gearIron" : "ingotIron";
final String diamondGear = OreDictionary.getOres("gearDiamond").isEmpty() ? "gearIron" : "ingotIron";
for (final Object circuit : standardCircuit) {
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Incubator.get(1), new Object[]{"gFg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'F', Blocks.FURNACE, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', ironGear}));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Incubator.get(1), "gFg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'F', Blocks.FURNACE, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', ironGear));
Item alyzer = null;
if (BinnieCore.isApicultureActive()) {
alyzer = Mods.Forestry.item("beealyzer");
@@ -60,18 +60,18 @@ public class ModuleMachine implements IInitializable {
alyzer = Mods.Forestry.item("flutterlyzer");
}
if (alyzer != null) {
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Analyser.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', alyzer, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', GeneticsItems.DNADye.get(1)}));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Analyser.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', alyzer, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', GeneticsItems.DNADye.get(1)));
}
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Genepool.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', "gearBronze", 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', Blocks.GLASS}));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Acclimatiser.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', Items.LAVA_BUCKET, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', Items.WATER_BUCKET}));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Genepool.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', "gearBronze", 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', Blocks.GLASS));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Acclimatiser.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', Items.LAVA_BUCKET, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', Items.WATER_BUCKET));
}
for (final Object circuit : advCircuit) {
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Isolator.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', goldGear, 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', GeneticsItems.Enzyme.get(1)}));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Polymeriser.get(1), new Object[]{"gBg", "cCc", "gPg", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', ironGear, 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze"}));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Sequencer.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', "gearBronze", 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', GeneticsItems.FluorescentDye.get(1)}));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Inoculator.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', diamondGear, 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', Items.EMERALD}));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Isolator.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', goldGear, 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', GeneticsItems.Enzyme.get(1)));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Polymeriser.get(1), "gBg", "cCc", "gPg", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', ironGear, 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Sequencer.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', "gearBronze", 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', GeneticsItems.FluorescentDye.get(1)));
GameRegistry.addRecipe(new ShapedOreRecipe(GeneticMachine.Inoculator.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', diamondGear, 'c', circuit, 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', Items.EMERALD));
}
GameRegistry.addRecipe(new ShapedOreRecipe(AdvGeneticMachine.Splicer.get(1), new Object[]{"gBg", "cCc", "aPa", 'C', GeneticsItems.IntegratedCasing.get(1), 'B', diamondGear, 'c', GeneticsItems.IntegratedCPU.get(1), 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', Items.BLAZE_ROD}));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.LabMachine.get(1), new Object[]{"igi", "gCg", "igi", 'C', GeneticsItems.LaboratoryCasing.get(1), 'i', "ingotIron", 'g', Blocks.GLASS_PANE}));
GameRegistry.addRecipe(new ShapedOreRecipe(AdvGeneticMachine.Splicer.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.IntegratedCasing.get(1), 'B', diamondGear, 'c', GeneticsItems.IntegratedCPU.get(1), 'g', Items.GOLD_NUGGET, 'P', "gearBronze", 'a', Items.BLAZE_ROD));
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.LabMachine.get(1), "igi", "gCg", "igi", 'C', GeneticsItems.LaboratoryCasing.get(1), 'i', "ingotIron", 'g', Blocks.GLASS_PANE));
}
}
@@ -307,7 +307,7 @@ public class Splicer {
public ComponentSplicerFX(final IMachine machine) {
super(machine);
this.dummyEntityItem = new EntityItem((World) null);
this.dummyEntityItem = new EntityItem(machine.getWorld());
}
@SideOnly(Side.CLIENT)