aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_BaseCrop.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java23
-rw-r--r--src/main/java/gregtech/api/util/GT_OreDictUnificator.java2
3 files changed, 16 insertions, 13 deletions
diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java
index 0171e35ff2..6cdd6ab02b 100644
--- a/src/main/java/gregtech/api/util/GT_BaseCrop.java
+++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java
@@ -1,7 +1,6 @@
package gregtech.api.util;
import cpw.mods.fml.common.Loader;
-import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ConfigCategories;
import gregtech.api.enums.Materials;
@@ -63,7 +62,6 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
* @param aGrowthSpeed how fast the Crop grows. if < 0 then its set to Tier*300
* @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size
* @param aBlock the block below needed for crop to grow. If null no block needed
- * @param aMeta meta of the block below(-1 if no meta)
*/
public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize, int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood, int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop, ItemStack[] aSpecialDrops) {
mName = aCropName;
@@ -238,7 +236,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
public List<String> getCropInformation() {
if (mBlock != null) {
ArrayList<String> result = new ArrayList<String>(1);
- result.add(String.format("Requires %s Ore or Block of %s as soil block to reach full growth.", mBlock.name(), mBlock.name()));
+ result.add(String.format("Requires %s Ore or Block of %s as soil block to reach full growth.", mBlock.mName, mBlock.mName));
return result;
}
return null;
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index e5edee17ca..b037b1f273 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -446,7 +446,8 @@ public class GT_ModHandler {
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,hidden))
temp = true;
- if (addInductionSmelterRecipe(aInput, null, aOutput, null, aOutput.stackSize * 1600, 0)) temp = true;
+ if (GT_Mod.gregtechproxy.mTEMachineRecipes)
+ if (addInductionSmelterRecipe(aInput, null, aOutput, null, aOutput.stackSize * 1600, 0)) temp = true;
return temp;
}
@@ -456,7 +457,7 @@ public class GT_ModHandler {
public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) {
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))
+ if (!GT_Mod.gregtechproxy.mTEMachineRecipes && !GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposer, aFullContainer, true))
return false;
try {
ThermalExpansion.addTransposerFill(aMJ * 10, aEmptyContainer, aFullContainer, aLiquid, true);
@@ -470,7 +471,7 @@ public class GT_ModHandler {
public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) {
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))
+ if (!GT_Mod.gregtechproxy.mTEMachineRecipes && !GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposerfilling, aFullContainer, true))
return false;
try {
ThermalExpansion.addTransposerFill(aMJ * 10, aEmptyContainer, aFullContainer, aLiquid, false);
@@ -484,7 +485,7 @@ public class GT_ModHandler {
public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, ItemStack aEmptyContainer, int aMJ) {
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))
+ if (!GT_Mod.gregtechproxy.mTEMachineRecipes && !GregTech_API.sRecipeFile.get(ConfigCategories.Machines.liquidtransposeremptying, aFullContainer, true))
return false;
try {
ThermalExpansion.addTransposerExtract(aMJ * 10, aFullContainer, aEmptyContainer, aLiquid, 100, false);
@@ -562,8 +563,9 @@ public class GT_ModHandler {
RA.addPulveriserRecipe(aInput, new ItemStack[]{aOutput1, aOutput2, aOutput3}, new int[]{10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3}, 400, 2);
if (!OrePrefixes.log.contains(aInput)) {
+ boolean aEnableTEMachineRecipes = GT_Mod.gregtechproxy.mTEMachineRecipes;
if (Materials.Wood.contains(aOutput1)) {
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, true)) {
+ if (aEnableTEMachineRecipes && GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, true)) {
if (aOutput2 == null)
ThermalExpansion.addSawmillRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1));
else
@@ -582,7 +584,7 @@ public class GT_ModHandler {
}
} catch (Throwable e) {/*Do nothing*/}
}
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, true)) {
+ if (aEnableTEMachineRecipes && GregTech_API.sRecipeFile.get(ConfigCategories.Machines.pulverization, aInput, true)) {
if (aOutput2 == null)
ThermalExpansion.addPulverizerRecipe(32000, GT_Utility.copy(aInput), GT_Utility.copy(aOutput1));
else
@@ -626,7 +628,7 @@ public class GT_ModHandler {
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;
+ if (!GT_Mod.gregtechproxy.mTEMachineRecipes && !GregTech_API.sRecipeFile.get(ConfigCategories.Machines.sawmill, aInput1, true)) return false;
try {
ThermalExpansion.addSawmillRecipe(1600, aInput1, aOutput1, aOutput2, 100);
} catch (Throwable e) {/*Do nothing*/}
@@ -641,7 +643,8 @@ public class GT_ModHandler {
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;
+ if (GT_Mod.gregtechproxy.mTEMachineRecipes)
+ if (addInductionSmelterRecipe(aInput1, aInput2, aOutput1, null, aDuration * aEUt * 2, 0)) temp = true;
return temp;
}
@@ -652,7 +655,7 @@ public class GT_ModHandler {
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))
+ if (!GT_Mod.gregtechproxy.mTEMachineRecipes && !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);
@@ -743,7 +746,7 @@ public class GT_ModHandler {
*/
public static boolean addCompressionRecipe(ItemStack aInput, ItemStack aOutput) {
aOutput = GT_OreDictUnificator.get(true, aOutput);
- if (aInput == null || aOutput == null) return false;
+ if (aInput == null || aOutput == null || GT_Utility.areStacksEqual(aInput, aOutput, true)) return false;
GT_Utility.removeSimpleIC2MachineRecipe(aInput, getCompressorRecipeList(), null);
if (!GregTech_API.sRecipeFile.get(ConfigCategories.Machines.compression, aInput, true)) return false;
GT_Utility.addSimpleIC2MachineRecipe(aInput, getCompressorRecipeList(), null, aOutput);
diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
index c8d95140a2..b403f05e5a 100644
--- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
+++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
@@ -94,6 +94,8 @@ public class GT_OreDictUnificator {
}
public static ItemStack get(OrePrefixes aPrefix, Object aMaterial, ItemStack aReplacement, long aAmount) {
+ //if (Materials.mDefaultComponents.contains(aPrefix) && !aPrefix.mDynamicItems.contains((Materials)aMaterial)) aPrefix.mDynamicItems.add((Materials) aMaterial);
+ if (Materials.mDefaultComponents.contains(aPrefix) && aPrefix.mDisabledItems.contains(aMaterial)) return null;
return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true);
}