aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java2
-rw-r--r--src/main/java/gregtech/common/GT_RecipeAdder.java58
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores.java16
3 files changed, 66 insertions, 10 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index ddd2179478..af229bb17d 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -168,6 +168,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
public boolean mChangeHarvestLevels=false;
public boolean mNerfedCombs = true;
public int mWireHeatingTicks = 4;
+ public boolean mHideUnusedOres = true;
+ public boolean mHideRecyclingRecipes = true;
public GT_Proxy() {
GameRegistry.registerFuelHandler(this);
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java
index ebffafca47..74dd9d5788 100644
--- a/src/main/java/gregtech/common/GT_RecipeAdder.java
+++ b/src/main/java/gregtech/common/GT_RecipeAdder.java
@@ -114,8 +114,13 @@ public class GT_RecipeAdder
new GT_Recipe(aInput1, aEUt, aInput2, aDuration, aOutput1, aOutput2);
return true;
}
+
+ @Override
+ public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) {
+ return addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt, false);
+ }
- public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt) {
+ public boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, boolean hidden) {
if ((aInput1 == null) || (aOutput1 == null || Materials.Graphite.contains(aInput1))) {
return false;
}
@@ -125,7 +130,10 @@ public class GT_RecipeAdder
if ((aDuration = GregTech_API.sRecipeFile.get("alloysmelting", aInput2 == null ? aInput1 : aOutput1, aDuration)) <= 0) {
return false;
}
- new GT_Recipe(aInput1, aInput2, aEUt, aDuration, aOutput1);
+ GT_Recipe tRecipe =new GT_Recipe(aInput1, aInput2, aEUt, aDuration, aOutput1);
+ if ((hidden) && (tRecipe != null)) {
+ tRecipe.mHidden = true;
+ }
return true;
}
@@ -464,8 +472,13 @@ public class GT_RecipeAdder
GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes.addRecipe(true, new ItemStack[]{aMold}, new ItemStack[]{aOutput}, null, new FluidStack[]{aInput}, null, aDuration, aEUt, 0);
return true;
}
+
+ @Override
+ public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) {
+ return addFluidSmelterRecipe(aInput, aRemains, aOutput, aChance, aDuration, aEUt, false);
+ }
- public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt) {
+ public boolean addFluidSmelterRecipe(ItemStack aInput, ItemStack aRemains, FluidStack aOutput, int aChance, int aDuration, int aEUt, boolean hidden) {
if ((aInput == null) || (aOutput == null)) {
return false;
}
@@ -478,7 +491,10 @@ public class GT_RecipeAdder
if ((aDuration = GregTech_API.sRecipeFile.get("fluidsmelter", aInput, aDuration)) <= 0) {
return false;
}
- GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
+ GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aRemains}, null, new int[]{aChance}, null, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
+ if ((hidden) && (tRecipe != null)) {
+ tRecipe.mHidden = true;
+ }
return true;
}
@@ -619,8 +635,14 @@ public class GT_RecipeAdder
}
return false;
}
+
+
+ @Override
+ public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
+ return addArcFurnaceRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false);
+ }
- public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
+ public boolean addArcFurnaceRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) {
if ((aInput == null) || (aOutputs == null)) {
return false;
}
@@ -629,11 +651,17 @@ public class GT_RecipeAdder
if ((aDuration = GregTech_API.sRecipeFile.get("arcfurnace", aInput, aDuration)) <= 0) {
return false;
}
- GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{Materials.Oxygen.getGas(aDuration)}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0);
+ GT_Recipe sRecipe = GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{Materials.Oxygen.getGas(aDuration)}, null, Math.max(1, aDuration), Math.max(1, aEUt), 0);
+ if ((hidden) && (sRecipe != null)) {
+ sRecipe.mHidden = true;
+ }
for (Materials tMaterial : new Materials[]{Materials.Argon, Materials.Nitrogen}) {
if (tMaterial.mPlasma != null) {
int tPlasmaAmount = (int) Math.max(1L, aDuration / (tMaterial.getMass() * 16L));
- GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{tMaterial.getPlasma(tPlasmaAmount)}, new FluidStack[]{tMaterial.getGas(tPlasmaAmount)}, Math.max(1, aDuration / 16), Math.max(1, aEUt / 3), 0);
+ GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, new FluidStack[]{tMaterial.getPlasma(tPlasmaAmount)}, new FluidStack[]{tMaterial.getGas(tPlasmaAmount)}, Math.max(1, aDuration / 16), Math.max(1, aEUt / 3), 0);
+ if ((hidden) && (tRecipe != null)) {
+ tRecipe.mHidden = true;
+ }
}
}
return true;
@@ -689,8 +717,14 @@ public class GT_RecipeAdder
}
return false;
}
+
- public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
+ @Override
+ public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt) {
+ return addPulveriserRecipe(aInput, aOutputs, aChances, aDuration, aEUt, false);
+ }
+
+ public boolean addPulveriserRecipe(ItemStack aInput, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUt, boolean hidden) {
if ((aInput == null) || (aOutputs == null)) {
return false;
}
@@ -699,7 +733,10 @@ public class GT_RecipeAdder
if ((aDuration = GregTech_API.sRecipeFile.get("pulveriser", aInput, aDuration)) <= 0) {
return false;
}
- GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, null, null, aDuration, aEUt, 0);
+ GT_Recipe tRecipe =GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.addRecipe(true, new ItemStack[]{aInput}, aOutputs, null, aChances, null, null, aDuration, aEUt, 0);
+ if ((hidden) && (tRecipe != null)) {
+ tRecipe.mHidden = true;
+ }
return true;
}
}
@@ -732,4 +769,7 @@ public class GT_RecipeAdder
return true;
}
+
+
+
}
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
index df1a4ba6bd..07be0e3132 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores.java
@@ -1,7 +1,9 @@
package gregtech.common.blocks;
+import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
@@ -40,6 +42,7 @@ public class GT_Block_Ores
this.isBlockContainer = true;
setStepSound(soundTypeStone);
setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
+ boolean tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres;
for (int i = 0; i < 16; i++) {
GT_ModHandler.addValuableOre(this, i, 1);
}
@@ -60,8 +63,19 @@ public class GT_Block_Ores
GT_OreDictUnificator.registerOre(OrePrefixes.oreNetherrack.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 1000));
GT_OreDictUnificator.registerOre(OrePrefixes.oreEndstone.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 2000));
GT_OreDictUnificator.registerOre(OrePrefixes.oreBlackgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 3000));
- GT_OreDictUnificator.registerOre(OrePrefixes.oreRedgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000));
+ GT_OreDictUnificator.registerOre(OrePrefixes.oreRedgranite.get(GregTech_API.sGeneratedMaterials[i]), new ItemStack(this, 1, i + 4000));
+ if (tHideOres) {
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000));
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000));
}
+ }
}
}
}