aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
authorShawn Buckley <shawntbuckley@gmail.com>2015-10-19 20:15:50 -0400
committerShawn Buckley <shawntbuckley@gmail.com>2015-10-19 20:48:52 -0400
commit49e6015068d67147993c688bd4e42be7c96a4f6b (patch)
tree8b1902132b9d5f7d7bcf1640728c90aa02d651b7 /src/main/java/gregtech/api/util
parentba53c6004c1a64968e49a9292055853e775aeaf8 (diff)
downloadGT5-Unofficial-49e6015068d67147993c688bd4e42be7c96a4f6b.tar.gz
GT5-Unofficial-49e6015068d67147993c688bd4e42be7c96a4f6b.tar.bz2
GT5-Unofficial-49e6015068d67147993c688bd4e42be7c96a4f6b.zip
Replace GT_Values.T/F with java primitive boolean values
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_Config.java3
-rw-r--r--src/main/java/gregtech/api/util/GT_FoodStat.java3
-rw-r--r--src/main/java/gregtech/api/util/GT_IBoxableWrapper.java3
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java344
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java368
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java227
6 files changed, 471 insertions, 477 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java
index 9ad2ebab50..3ba9603114 100644
--- a/src/main/java/gregtech/api/util/GT_Config.java
+++ b/src/main/java/gregtech/api/util/GT_Config.java
@@ -1,14 +1,13 @@
package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
-import static gregtech.api.enums.GT_Values.F;
import gregtech.api.GregTech_API;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
public class GT_Config implements Runnable {
- public static boolean troll = F;
+ public static boolean troll = false;
public static Configuration sConfigFileIDs;
diff --git a/src/main/java/gregtech/api/util/GT_FoodStat.java b/src/main/java/gregtech/api/util/GT_FoodStat.java
index a2134290cf..336aeeab9c 100644
--- a/src/main/java/gregtech/api/util/GT_FoodStat.java
+++ b/src/main/java/gregtech/api/util/GT_FoodStat.java
@@ -1,6 +1,5 @@
package gregtech.api.util;
-import static gregtech.api.enums.GT_Values.F;
import gregtech.api.damagesources.GT_DamageSources;
import gregtech.api.interfaces.IFoodStat;
import gregtech.api.items.GT_MetaBase_Item;
@@ -17,7 +16,7 @@ public class GT_FoodStat implements IFoodStat {
private final EnumAction mAction;
private final ItemStack mEmptyContainer;
private final boolean mAlwaysEdible, mInvisibleParticles, mIsRotten;
- private boolean mExplosive = F, mMilk = F;
+ private boolean mExplosive = false, mMilk = false;
/**
* @param aFoodLevel Amount of Food in Half Bacon [0 - 20]
diff --git a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java b/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java
index 8511f76c49..03ffc6755a 100644
--- a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java
+++ b/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java
@@ -1,12 +1,11 @@
package gregtech.api.util;
-import static gregtech.api.enums.GT_Values.T;
import ic2.api.item.IBoxable;
import net.minecraft.item.ItemStack;
public class GT_IBoxableWrapper implements IBoxable {
@Override
public boolean canBeStoredInToolbox(ItemStack itemstack) {
- return T;
+ return true;
}
} \ No newline at end of file
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index b657c8ee3f..e7c95e5905 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -16,7 +16,6 @@ import ic2.api.reactor.IReactorComponent;
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.RecipeOutput;
-import ic2.core.AdvRecipe;
import java.util.*;
import java.util.Map.Entry;
@@ -38,7 +37,6 @@ import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import cpw.mods.fml.common.event.FMLInterModComms;
@@ -58,7 +56,7 @@ public class GT_ModHandler {
* Returns if that Liquid is Water or Distilled Water
*/
public static boolean isWater(FluidStack aFluid) {
- if (aFluid == null) return F;
+ if (aFluid == null) return false;
return aFluid.isFluidEqual(getWater(1)) || aFluid.isFluidEqual(getDistilledWater(1));
}
@@ -80,7 +78,7 @@ public class GT_ModHandler {
* Returns if that Liquid is Lava
*/
public static boolean isLava(FluidStack aFluid) {
- if (aFluid == null) return F;
+ if (aFluid == null) return false;
return aFluid.isFluidEqual(getLava(1));
}
@@ -95,7 +93,7 @@ public class GT_ModHandler {
* Returns if that Liquid is Steam
*/
public static boolean isSteam(FluidStack aFluid) {
- if (aFluid == null) return F;
+ if (aFluid == null) return false;
return aFluid.isFluidEqual(getSteam(1));
}
@@ -110,7 +108,7 @@ public class GT_ModHandler {
* Returns if that Liquid is Milk
*/
public static boolean isMilk(FluidStack aFluid) {
- if (aFluid == null) return F;
+ if (aFluid == null) return false;
return aFluid.isFluidEqual(getMilk(1));
}
@@ -174,7 +172,7 @@ public class GT_ModHandler {
* @return the exact Value in EU the Fuel Can is worth if its even a Fuel Can.
*/
public static int getFuelCanValue(ItemStack aFuelCan) {
- if (GT_Utility.isStackInvalid(aFuelCan) || !ItemList.IC2_Fuel_Can_Filled.isStackEqual(aFuelCan, F, T)) return 0;
+ if (GT_Utility.isStackInvalid(aFuelCan) || !ItemList.IC2_Fuel_Can_Filled.isStackEqual(aFuelCan, false, true)) return 0;
NBTTagCompound tNBT = aFuelCan.getTagCompound();
return tNBT==null?0:tNBT.getInteger("value")*5;
}
@@ -254,82 +252,82 @@ public class GT_ModHandler {
* OUT OF ORDER
*/
public static boolean getModeKeyDown(EntityPlayer aPlayer) {
- return F;
+ return false;
}
/**
* OUT OF ORDER
*/
public static boolean getBoostKeyDown(EntityPlayer aPlayer) {
- return F;
+ return false;
}
/**
* OUT OF ORDER
*/
public static boolean getJumpKeyDown(EntityPlayer aPlayer) {
- return F;
+ return false;
}
/**
* Adds a Valuable Ore to the Miner
*/
public static boolean addValuableOre(Block aBlock, int aMeta, int aValue) {
- if (aValue <= 0) return F;
+ if (aValue <= 0) return false;
try {
Class.forName("ic2.core.IC2").getMethod("addValuableOre", IRecipeInput.class, int.class).invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue);
} catch (Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* Adds a Scrapbox Drop. Fails at April first for the "suddenly Hoes"-Feature of IC2
*/
public static boolean addScrapboxDrop(float aChance, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(T, aOutput);
- if (aOutput == null || aChance <= 0) return F;
+ aOutput = GT_OreDictUnificator.get(true, aOutput);
+ if (aOutput == null || aChance <= 0) return false;
aOutput.stackSize = 1;
- if (GT_Config.troll && !GT_Utility.areStacksEqual(aOutput, new ItemStack(Items.wooden_hoe, 1, 0))) return F;
+ if (GT_Config.troll && !GT_Utility.areStacksEqual(aOutput, new ItemStack(Items.wooden_hoe, 1, 0))) return false;
aChance = (float)GregTech_API.sRecipeFile.get(ConfigCategories.Machines.scrapboxdrops, aOutput, aChance);
- if (aChance <= 0) return F;
+ if (aChance <= 0) return false;
try {
- GT_Utility.callMethod(GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", T, T), "addDrop", T, F, T, GT_Utility.copy(aOutput), aChance);
- GT_Utility.callMethod(GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", T, T), "addRecipe", T, T, F, GT_Utility.copy(aOutput), aChance);
+ GT_Utility.callMethod(GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true , true), "addDrop", true , false, true , GT_Utility.copy(aOutput), aChance);
+ GT_Utility.callMethod(GT_Utility.getFieldContent("ic2.api.recipe.Recipes", "scrapboxDrops", true , true), "addRecipe", true , true , false, GT_Utility.copy(aOutput), aChance);
} catch (Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* Adds an Item to the Recycler Blacklist
*/
public static boolean addToRecyclerBlackList(ItemStack aRecycledStack) {
- if (aRecycledStack == null) return F;
+ if (aRecycledStack == null) return false;
try {
ic2.api.recipe.Recipes.recyclerBlacklist.add(new RecipeInputItemStack(aRecycledStack));
} catch (Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* Just simple Furnace smelting. Unbelievable how Minecraft fails at making a simple ItemStack->ItemStack mapping...
*/
public static boolean addSmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(T, aOutput);
- if (aInput == null || aOutput == null || GT_Utility.getContainerItem(aInput, F) != null) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.smelting, aInput, T)) return F;
+ aOutput = GT_OreDictUnificator.get(true, aOutput);
+ if (aInput == null || aOutput == null || GT_Utility.getContainerItem(aInput, false) != null) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.smelting, aInput, true)) return false;
FurnaceRecipes.smelting().func_151394_a(aInput, GT_Utility.copy(aOutput), 0.0F);
- return T;
+ return true;
}
/**
* Adds to Furnace AND Alloysmelter AND Induction Smelter
*/
public static boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
- if (aInput == null || aOutput == null) return F;
- boolean temp = F;
- if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = T;
- if (RA.addAlloySmelterRecipe(aInput, OrePrefixes.ingot.contains(aOutput)?ItemList.Shape_Mold_Ingot.get(0):OrePrefixes.block.contains(aOutput)?ItemList.Shape_Mold_Block.get(0):OrePrefixes.nugget.contains(aOutput)?ItemList.Shape_Mold_Nugget.get(0):null, aOutput, 130, 3)) temp = T;
- if (addInductionSmelterRecipe(aInput, null, aOutput, null, aOutput.stackSize*1600, 0)) temp = T;
+ if (aInput == null || aOutput == null) return false;
+ boolean temp = false;
+ if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = true;
+ if (RA.addAlloySmelterRecipe(aInput, OrePrefixes.ingot.contains(aOutput)?ItemList.Shape_Mold_Ingot.get(0):OrePrefixes.block.contains(aOutput)?ItemList.Shape_Mold_Block.get(0):OrePrefixes.nugget.contains(aOutput)?ItemList.Shape_Mold_Nugget.get(0):null, aOutput, 130, 3)) temp = true;
+ if (addInductionSmelterRecipe(aInput, null, aOutput, null, aOutput.stackSize*1600, 0)) temp = true;
return temp;
}
@@ -337,80 +335,80 @@ public class GT_ModHandler {
* LiquidTransposer Recipe for both directions
*/
public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) {
- aFullContainer = GT_OreDictUnificator.get(T, aFullContainer);
- if (aEmptyContainer == null || aFullContainer == null || aLiquid == null) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposer, aFullContainer, T)) return F;
+ aFullContainer = GT_OreDictUnificator.get(true, aFullContainer);
+ if (aEmptyContainer == null || aFullContainer == null || aLiquid == null) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposer, aFullContainer, true)) return false;
try {
- ThermalExpansion.addTransposerFill(aMJ*10, aEmptyContainer, aFullContainer, aLiquid, T);
+ ThermalExpansion.addTransposerFill(aMJ*10, aEmptyContainer, aFullContainer, aLiquid, true);
} catch(Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* LiquidTransposer Recipe for filling Containers
*/
public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) {
- aFullContainer = GT_OreDictUnificator.get(T, aFullContainer);
- if (aEmptyContainer == null || aFullContainer == null || aLiquid == null) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposerfilling, aFullContainer, T)) return F;
+ aFullContainer = GT_OreDictUnificator.get(true, aFullContainer);
+ if (aEmptyContainer == null || aFullContainer == null || aLiquid == null) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposerfilling, aFullContainer, true)) return false;
try {
- ThermalExpansion.addTransposerFill(aMJ*10, aEmptyContainer, aFullContainer, aLiquid, F);
+ ThermalExpansion.addTransposerFill(aMJ*10, aEmptyContainer, aFullContainer, aLiquid, false);
} catch(Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* LiquidTransposer Recipe for emptying Containers
*/
public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, ItemStack aEmptyContainer, int aMJ) {
- aEmptyContainer = GT_OreDictUnificator.get(T, aEmptyContainer);
- if (aFullContainer == null || aEmptyContainer == null || aLiquid == null) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposeremptying, aFullContainer, T)) return F;
+ aEmptyContainer = GT_OreDictUnificator.get(true, aEmptyContainer);
+ if (aFullContainer == null || aEmptyContainer == null || aLiquid == null) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposeremptying, aFullContainer, true)) return false;
try {
- ThermalExpansion.addTransposerExtract(aMJ*10, aFullContainer, aEmptyContainer, aLiquid, 100, F);
+ ThermalExpansion.addTransposerExtract(aMJ*10, aFullContainer, aEmptyContainer, aLiquid, 100, false);
} catch(Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* IC2-Extractor Recipe. Overloads old Recipes automatically
*/
public static boolean addExtractionRecipe(ItemStack aInput, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(T, aOutput);
- if (aInput == null || aOutput == null) return F;
+ aOutput = GT_OreDictUnificator.get(true, aOutput);
+ if (aInput == null || aOutput == null) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput, getExtractorRecipeList(), null);
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.extractor, aInput, T)) return F;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.extractor, aInput, true)) return false;
GT_Utility.addSimpleIC2MachineRecipe(aInput, getExtractorRecipeList(), null, aOutput);
- return T;
+ return true;
}
/**
* RC-BlastFurnace Recipes
*/
public static boolean addRCBlastFurnaceRecipe(ItemStack aInput, ItemStack aOutput, int aTime) {
- aOutput = GT_OreDictUnificator.get(T, aOutput);
- if (aInput == null || aOutput == null || aTime <= 0) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.rcblastfurnace, aInput, T)) return F;
+ aOutput = GT_OreDictUnificator.get(true, aOutput);
+ if (aInput == null || aOutput == null || aTime <= 0) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.rcblastfurnace, aInput, true)) return false;
aInput = GT_Utility.copy(aInput);
aOutput = GT_Utility.copy(aOutput);
try {
- mods.railcraft.api.crafting.RailcraftCraftingManager.blastFurnace.addRecipe(aInput, T, F, aTime, aOutput);
+ mods.railcraft.api.crafting.RailcraftCraftingManager.blastFurnace.addRecipe(aInput, true , false, aTime, aOutput);
} catch (Throwable e) {
- return F;
+ return false;
}
- return T;
+ return true;
}
public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1) {
- return addPulverisationRecipe(aInput, aOutput1, null, 0, F);
+ return addPulverisationRecipe(aInput, aOutput1, null, 0, false);
}
public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2) {
- return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, F);
+ return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, false);
}
public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance) {
- return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, F);
+ return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false);
}
public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, boolean aOverwrite) {
@@ -429,13 +427,13 @@ public class GT_ModHandler {
* Adds Several Pulverizer-Type Recipes.
*/
public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, ItemStack aOutput3, int aChance3, boolean aOverwrite) {
- aOutput1 = GT_OreDictUnificator.get(T, aOutput1);
- aOutput2 = GT_OreDictUnificator.get(T, aOutput2);
- if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return F;
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
+ if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput, getMaceratorRecipeList(), null);
- if (GT_Utility.getContainerItem(aInput, F) == null) {
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, T)) {
+ if (GT_Utility.getContainerItem(aInput, false) == null) {
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) {
GT_Utility.addSimpleIC2MachineRecipe(aInput, getMaceratorRecipeList(), null, aOutput1);
}
@@ -443,24 +441,24 @@ public class GT_ModHandler {
if (!OrePrefixes.log.contains(aInput)) {
if (Materials.Wood.contains(aOutput1)) {
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, T)) {
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, true)) {
if (aOutput2 == null)
ThermalExpansion.addSawmillRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1));
else
ThermalExpansion.addSawmillRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1), GT_Utility.copy(aOutput2), aChance2<=0?10:aChance2);
}
} else {
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.rockcrushing, aInput, T)) {
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.rockcrushing, aInput, true)) {
try {
if (GT_Utility.getBlockFromStack(aInput) != Blocks.obsidian && GT_Utility.getBlockFromStack(aInput) != Blocks.gravel) {
- mods.railcraft.api.crafting.IRockCrusherRecipe tRecipe = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher.createNewRecipe(GT_Utility.copyAmount(1, aInput), aInput.getItemDamage() != W, F);
+ mods.railcraft.api.crafting.IRockCrusherRecipe tRecipe = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher.createNewRecipe(GT_Utility.copyAmount(1, aInput), aInput.getItemDamage() != W, false);
tRecipe.addOutput(GT_Utility.copy(aOutput1), 1.0F/aInput.stackSize);
if (aOutput2 != null) tRecipe.addOutput(GT_Utility.copy(aOutput2), (0.01F*(aChance2<=0?10:aChance2))/aInput.stackSize);
if (aOutput3 != null) tRecipe.addOutput(GT_Utility.copy(aOutput3), (0.01F*(aChance3<=0?10:aChance3))/aInput.stackSize);
}
} catch(Throwable e) {/*Do nothing*/}
}
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, T)) {
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, true)) {
if (aOutput2 == null)
ThermalExpansion.addPulverizerRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1));
else
@@ -469,32 +467,32 @@ public class GT_ModHandler {
}
}
}
- return T;
+ return true;
}
/**
* Adds a Recipe to the Sawmills of GregTech and ThermalCraft
*/
public static boolean addSawmillRecipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2) {
- aOutput1 = GT_OreDictUnificator.get(T, aOutput1);
- aOutput2 = GT_OreDictUnificator.get(T, aOutput2);
- if (aInput1 == null || aOutput1 == null) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.sawmill, aInput1, T)) return F;
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
+ if (aInput1 == null || aOutput1 == null) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.sawmill, aInput1, true)) return false;
try {
ThermalExpansion.addSawmillRecipe(1600, aInput1, aOutput1, aOutput2, 100);
} catch(Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* Induction Smelter Recipes and Alloy Smelter Recipes
*/
public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean aAllowSecondaryInputEmpty) {
- if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return F;
- aOutput1 = GT_OreDictUnificator.get(T, aOutput1);
- boolean temp = F;
- if (RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt)) temp = T;
- if (addInductionSmelterRecipe(aInput1, aInput2, aOutput1, null, aDuration * aEUt * 2, 0)) temp = T;
+ if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false;
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ boolean temp = false;
+ if (RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt)) temp = true;
+ if (addInductionSmelterRecipe(aInput1, aInput2, aOutput1, null, aDuration * aEUt * 2, 0)) temp = true;
return temp;
}
@@ -502,24 +500,24 @@ public class GT_ModHandler {
* Induction Smelter Recipes for TE
*/
public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aEnergy, int aChance) {
- aOutput1 = GT_OreDictUnificator.get(T, aOutput1);
- aOutput2 = GT_OreDictUnificator.get(T, aOutput2);
- if (aInput1 == null || aOutput1 == null || GT_Utility.getContainerItem(aInput1, F) != null) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.inductionsmelter, aInput2==null?aInput1:aOutput1, T)) return F;
+ aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
+ aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
+ if (aInput1 == null || aOutput1 == null || GT_Utility.getContainerItem(aInput1, false) != null) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.inductionsmelter, aInput2==null?aInput1:aOutput1, true)) return false;
try {
ThermalExpansion.addSmelterRecipe(aEnergy*10, GT_Utility.copy(aInput1), aInput2==null?new ItemStack(Blocks.sand, 1, 0):aInput2, aOutput1, aOutput2, aChance);
} catch(Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* Smelts Ores to Ingots
*/
public static boolean addOreToIngotSmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(T, aOutput);
- if (aInput == null || aOutput == null) return F;
+ aOutput = GT_OreDictUnificator.get(true, aOutput);
+ if (aInput == null || aOutput == null) return false;
FurnaceRecipes.smelting().func_151394_a(aInput, GT_Utility.copy(aOutput), 0.0F);
- return T;
+ return true;
}
private static Map<IRecipeInput, RecipeOutput> sExtractorRecipes = new HashMap<IRecipeInput, RecipeOutput>();
@@ -575,74 +573,74 @@ public class GT_ModHandler {
* IC2-ThermalCentrifuge Recipe. Overloads old Recipes automatically
*/
public static boolean addThermalCentrifugeRecipe(ItemStack aInput, int aHeat, Object... aOutput) {
- if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return F;
+ if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput, getThermalCentrifugeRecipeList(), null);
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, T)) return F;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.thermalcentrifuge, aInput, true)) return false;
NBTTagCompound tNBT = new NBTTagCompound();
tNBT.setInteger("minHeat", aHeat);
GT_Utility.addSimpleIC2MachineRecipe(aInput, getThermalCentrifugeRecipeList(), tNBT, aOutput);
- return T;
+ return true;
}
/**
* IC2-OreWasher Recipe. Overloads old Recipes automatically
*/
public static boolean addOreWasherRecipe(ItemStack aInput, int aWaterAmount, Object... aOutput) {
- if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return F;
+ if (aInput == null || aOutput == null || aOutput.length <= 0 || aOutput[0] == null) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput, getOreWashingRecipeList(), null);
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, T)) return F;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.orewashing, aInput, true)) return false;
NBTTagCompound tNBT = new NBTTagCompound();
tNBT.setInteger("amount", aWaterAmount);
GT_Utility.addSimpleIC2MachineRecipe(aInput, getOreWashingRecipeList(), tNBT, aOutput);
- return T;
+ return true;
}
/**
* IC2-Compressor Recipe. Overloads old Recipes automatically
*/
public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput) {
- aOutput = GT_OreDictUnificator.get(T, aOutput);
- if (aInput == null || aOutput == null) return F;
+ aOutput = GT_OreDictUnificator.get(true, aOutput);
+ if (aInput == null || aOutput == null) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput, getCompressorRecipeList(), null);
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.compression, aInput, T)) return F;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.compression, aInput, true)) return false;
GT_Utility.addSimpleIC2MachineRecipe(aInput, getCompressorRecipeList(), null, aOutput);
- return T;
+ return true;
}
/**
* @param aValue Scrap = 5000, Scrapbox = 45000, Diamond Dust 125000
*/
public static boolean addIC2MatterAmplifier(ItemStack aAmplifier, int aValue) {
- if (aAmplifier == null || aValue <= 0) return F;
- if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.massfabamplifier, aAmplifier, T)) return F;
+ if (aAmplifier == null || aValue <= 0) return false;
+ if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.massfabamplifier, aAmplifier, true)) return false;
try {
NBTTagCompound tNBT = new NBTTagCompound();
tNBT.setInteger("amplification", aValue);
- GT_Utility.callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", F, F, F, aAmplifier, tNBT);
+ GT_Utility.callMethod(ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT);
} catch(Throwable e) {/*Do nothing*/}
- return T;
+ return true;
}
/**
* Rolling Machine Crafting Recipe
*/
public static boolean addRollingMachineRecipe(ItemStack aResult, Object[] aRecipe) {
- aResult = GT_OreDictUnificator.get(T, aResult);
- if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return F;
+ aResult = GT_OreDictUnificator.get(true, aResult);
+ if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false;
try {
mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList().add(new ShapedOreRecipe(GT_Utility.copy(aResult), aRecipe));
} catch(Throwable e) {
return addCraftingRecipe(GT_Utility.copy(aResult), aRecipe);
}
- return T;
+ return true;
}
- private static boolean sBufferCraftingRecipes = T;
+ private static boolean sBufferCraftingRecipes = true;
private static final List<IRecipe> sAllRecipeList = Collections.synchronizedList(new ArrayList<IRecipe>(5000)), sBufferRecipeList = new ArrayList<IRecipe>(1000);
public static final List<IRecipe> sSingleNonBlockDamagableRecipeList = new ArrayList<IRecipe>(1000);
public static void stopBufferingCraftingRecipes() {
- sBufferCraftingRecipes = F;
+ sBufferCraftingRecipes = false;
for (IRecipe tRecipe : sBufferRecipeList) GameRegistry.addRecipe(tRecipe);
sBufferRecipeList.clear();
}
@@ -680,7 +678,7 @@ public class GT_ModHandler {
* Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/
public static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) {
- return addCraftingRecipe(aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, F, T, F, F, F, F, F, F, F, F, F, F, T, aRecipe);
+ return addCraftingRecipe(aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, false, true , false, false, false, false, false, false, false, false, false, false, true, aRecipe);
}
/**
@@ -743,12 +741,12 @@ public class GT_ModHandler {
* Internal realisation of the Crafting Recipe adding Process.
*/
private static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) {
- aResult = GT_OreDictUnificator.get(T, aResult);
- if (aOnlyAddIfResultIsNotNull && aResult == null) return F;
+ aResult = GT_OreDictUnificator.get(true, aResult);
+ if (aOnlyAddIfResultIsNotNull && aResult == null) return false;
if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0);
- if (aRecipe == null || aRecipe.length <= 0) return F;
+ if (aRecipe == null || aRecipe.length <= 0) return false;
- boolean tThereWasARecipe = F;
+ boolean tThereWasARecipe = false;
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] instanceof IItemContainer)
@@ -803,7 +801,7 @@ public class GT_ModHandler {
HashMap<Character, ItemData> tItemDataMap = new HashMap<Character, ItemData>();
tItemStackMap.put(' ', null);
- boolean tRemoveRecipe = T;
+ boolean tRemoveRecipe = true;
for (; idx < aRecipe.length; idx += 2) {
if (aRecipe[idx] == null || aRecipe[idx + 1] == null) {
@@ -811,7 +809,7 @@ public class GT_ModHandler {
GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + (aResult==null?"null":aResult.getDisplayName()));
for (Object tContent : aRecipe) GT_Log.err.println(tContent);
}
- return F;
+ return false;
}
Character chr = (Character)aRecipe[idx];
Object in = aRecipe[idx + 1];
@@ -832,7 +830,7 @@ public class GT_ModHandler {
tItemDataMap.put(chr, (ItemData)in);
}
ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1);
- if (tStack == null) tRemoveRecipe = F; else tItemStackMap.put(chr, tStack);
+ if (tStack == null) tRemoveRecipe = false; else tItemStackMap.put(chr, tStack);
in = aRecipe[idx + 1] = in.toString();
} else if (in instanceof String) {
if (in.equals(OreDictNames.craftingChest .toString())) tItemDataMap.put(chr, new ItemData(Materials.Wood, M * 8));
@@ -842,7 +840,7 @@ public class GT_ModHandler {
else if (in.equals(OreDictNames.craftingIndustrialDiamond .toString())) tItemDataMap.put(chr, new ItemData(Materials.Diamond, M));
else if (in.equals(OreDictNames.craftingAnvil .toString())) tItemDataMap.put(chr, new ItemData(Materials.Iron, M * 10));
ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1);
- if (tStack == null) tRemoveRecipe = F; else tItemStackMap.put(chr, tStack);
+ if (tStack == null) tRemoveRecipe = false; else tItemStackMap.put(chr, tStack);
} else {
throw new IllegalArgumentException();
}
@@ -866,7 +864,7 @@ public class GT_ModHandler {
}
} catch(Throwable e) {e.printStackTrace(GT_Log.err);}
- if (aResult == null || aResult.stackSize <= 0) return F;
+ if (aResult == null || aResult.stackSize <= 0) return false;
if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes)
tThereWasARecipe = removeRecipeByOutput(aResult, !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, aRemoveAllOtherShapedsWithSameOutput, aRemoveAllOtherNativeRecipes) || tThereWasARecipe;
@@ -876,9 +874,9 @@ public class GT_ModHandler {
for (int i = 0; i < tList.size() && !tThereWasARecipe; i++) {
IRecipe tRecipe = tList.get(i);
if (sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue;
- if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, T)) {
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) {
tList.remove(i--);
- tThereWasARecipe = T;
+ tThereWasARecipe = true;
}
}
}
@@ -893,14 +891,14 @@ public class GT_ModHandler {
else
GameRegistry.addRecipe(new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored));
}
- return T;
+ return true;
}
/**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/
public static boolean addShapelessEnchantingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) {
- return addShapelessCraftingRecipe(aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, T, F, F, F, aRecipe);
+ return addShapelessCraftingRecipe(aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, true , false, false, false, aRecipe);
}
/**
@@ -921,8 +919,8 @@ public class GT_ModHandler {
* Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/
private static boolean addShapelessCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, Object[] aRecipe) {
- aResult = GT_OreDictUnificator.get(T, aResult);
- if (aRecipe == null || aRecipe.length <= 0) return F;
+ aResult = GT_OreDictUnificator.get(true, aResult);
+ if (aRecipe == null || aRecipe.length <= 0) return false;
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] instanceof IItemContainer)
aRecipe[i] = ((IItemContainer)aRecipe[i]).get(1);
@@ -938,7 +936,7 @@ public class GT_ModHandler {
if (tObject == null) {
if (D1) GT_Log.err.println("WARNING: Missing Item for shapeless Recipe: " + (aResult==null?"null":aResult.getDisplayName()));
for (Object tContent : aRecipe) GT_Log.err.println(tContent);
- return F;
+ return false;
}
if (tObject instanceof ItemStack) {
tRecipe[i] = (ItemStack)tObject;
@@ -955,7 +953,7 @@ public class GT_ModHandler {
removeRecipe(tRecipe);
} catch(Throwable e) {e.printStackTrace(GT_Log.err);}
- if (aResult == null || aResult.stackSize <= 0) return F;
+ if (aResult == null || aResult.stackSize <= 0) return false;
if (Items.feather.getDamage(aResult) == W || Items.feather.getDamage(aResult) < 0) Items.feather.setDamage(aResult, 0);
@@ -965,7 +963,7 @@ public class GT_ModHandler {
sBufferRecipeList.add(new GT_Shapeless_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe));
else
GameRegistry.addRecipe(new GT_Shapeless_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe));
- return T;
+ return true;
}
/**
@@ -974,13 +972,13 @@ public class GT_ModHandler {
public static boolean removeFurnaceSmelting(ItemStack aInput) {
if (aInput != null) {
for (Object tInput : FurnaceRecipes.smelting().getSmeltingList().keySet()) {
- if (GT_Utility.isStackValid(tInput) && GT_Utility.areStacksEqual(aInput, (ItemStack)tInput, T)) {
+ if (GT_Utility.isStackValid(tInput) && GT_Utility.areStacksEqual(aInput, (ItemStack)tInput, true)) {
FurnaceRecipes.smelting().getSmeltingList().remove(tInput);
- return T;
+ return true;
}
}
}
- return F;
+ return false;
}
/**
@@ -990,16 +988,16 @@ public class GT_ModHandler {
*/
public static ItemStack removeRecipe(ItemStack... aRecipe) {
if (aRecipe == null) return null;
- boolean temp = F;
+ boolean temp = false;
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] != null) {
- temp = T;
+ temp = true;
break;
}
}
if (!temp) return null;
ItemStack rReturn = null;
- InventoryCrafting aCrafting = new InventoryCrafting(new Container() {@Override public boolean canInteractWith(EntityPlayer var1) {return F;}}, 3, 3);
+ InventoryCrafting aCrafting = new InventoryCrafting(new Container() {@Override public boolean canInteractWith(EntityPlayer var1) {return false;}}, 3, 3);
for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
ArrayList<IRecipe> tList = (ArrayList<IRecipe>)CraftingManager.getInstance().getRecipeList();
for (int i = 0; i < tList.size(); i++) {try {for (; i < tList.size(); i++) {
@@ -1012,7 +1010,7 @@ public class GT_ModHandler {
}
public static boolean removeRecipeByOutput(ItemStack aOutput) {
- return removeRecipeByOutput(aOutput, T, F, F);
+ return removeRecipeByOutput(aOutput, true , false, false);
}
public static Collection<String> sNativeRecipeClasses = new HashSet<String>(), sSpecialRecipeClasses = new HashSet<String>();
@@ -1066,8 +1064,8 @@ public class GT_ModHandler {
* @return if it has removed at least one Recipe.
*/
public static boolean removeRecipeByOutput(It