diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-06-14 18:55:26 +1000 |
---|---|---|
committer | Dream-Master <dream-master@gmx.net> | 2017-06-14 18:45:52 +0200 |
commit | edefa41a62a0472c914bb61beb82bcde63a7c3bd (patch) | |
tree | 684ad9f292a27728b03bd365e9af3cbcaf025036 /src/main/java/gregtech | |
parent | ccfc34501d48850ac6d2b43e18837dbdcb3e0c4e (diff) | |
download | GT5-Unofficial-edefa41a62a0472c914bb61beb82bcde63a7c3bd.tar.gz GT5-Unofficial-edefa41a62a0472c914bb61beb82bcde63a7c3bd.tar.bz2 GT5-Unofficial-edefa41a62a0472c914bb61beb82bcde63a7c3bd.zip |
cherry pick
d1eea59fe744c1b5b2c5dae324b6887f985a6569
Made the Cleanroom optional.
This disables the Low Grav option if the Cleanroom is disabled.
Diffstat (limited to 'src/main/java/gregtech')
5 files changed, 26 insertions, 3 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 248f581e97..1c8e88b0ab 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -260,6 +260,7 @@ public class GT_Mod implements IGT_Mod { gregtechproxy.mExplosionItemDrop = tMainConfig.get("general", "ExplosionItemDrops", false).getBoolean(false); gregtechproxy.mAddGTRecipesToIC2Machines = tMainConfig.get("general", "AddGTRecipesToIC2Machines", true).getBoolean(true); gregtechproxy.mUndergroundOil.getConfig(tMainConfig, "undergroundfluid"); + gregtechproxy.mEnableCleanroom = tMainConfig.get("general", "EnableCleanroom", true).getBoolean(true); gregtechproxy.mLowGravProcessing = Loader.isModLoaded(GT_Values.MOD_ID_GC_CORE) && tMainConfig.get("general", "LowGravProcessing", true).getBoolean(true); Calendar now = Calendar.getInstance(); gregtechproxy.mAprilFool = GregTech_API.sSpecialFile.get(ConfigCategories.general, "AprilFool", now.get(Calendar.MONTH) == Calendar.APRIL && now.get(Calendar.DAY_OF_MONTH) == 1); @@ -502,6 +503,11 @@ public class GT_Mod implements IGT_Mod { new GT_Bees(); + //Disable Low Grav regardless of config if Cleanroom is disabled. + if (!gregtechproxy.mEnableCleanroom){ + gregtechproxy.mLowGravProcessing = false; + } + gregtechproxy.onLoad(); if (gregtechproxy.mSortToTheEnd) { new GT_ItemIterator().run(); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 44a61b8f9d..5ec76906f2 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -181,6 +181,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public boolean mEnableAllMaterials = false; public boolean mEnableAllComponents = false; public boolean mAddGTRecipesToIC2Machines = true; + public boolean mEnableCleanroom = true; public boolean mLowGravProcessing = false; public boolean mAprilFool = false; public boolean mCropNeedBlock = true; diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 37c259a22d..21af0b347a 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -746,6 +746,9 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("autoclave", aInput, aDuration)) <= 0) { return false; } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluid}, null, aDuration, aEUt, aCleanroom ? -100 : 0); return true; } @@ -775,6 +778,9 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if ((aDuration = GregTech_API.sRecipeFile.get("laserengraving", aEngravedItem, aDuration)) <= 0) { return false; } + if (!GT_Mod.gregtechproxy.mEnableCleanroom){ + aCleanroom = false; + } GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes.addRecipe(true, new ItemStack[]{aItemToEngrave, aLens}, new ItemStack[]{aEngravedItem}, null, null, null, aDuration, aEUt, aCleanroom ? -200 : 0); return true; } diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index 16139ab0fa..83c5a19154 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -1,5 +1,6 @@ package gregtech.loaders.preload; +import codechicken.nei.api.API; import cpw.mods.fml.common.Loader; import gregtech.GT_Mod; import gregtech.api.GregTech_API; @@ -40,6 +41,7 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI private final static long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | bits; private final static boolean aBoolConst_0 = false; + private final static Boolean isNEILoaded = Loader.isModLoaded("NotEnoughItems"); private static void run1() { GT_ModHandler.addCraftingRecipe(ItemList.Casing_ULV.get(1L, new Object[0]), bits, new Object[]{aTextPlate, aTextPlateWrench, aTextPlate, 'P', OrePrefixes.plate.get(Materials.WroughtIron)}); GT_ModHandler.addCraftingRecipe(ItemList.Casing_LV.get(1L, new Object[0]), bits, new Object[]{aTextPlate, aTextPlateWrench, aTextPlate, 'P', OrePrefixes.plate.get(Materials.Steel)}); @@ -1255,8 +1257,16 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI GT_ModHandler.addCraftingRecipe(ItemList.Casing_EngineIntake.get(1L, new Object[0]), bitsd, new Object[]{"PhP", "RFR", aTextPlateWrench, 'R', OrePrefixes.pipeMedium.get(Materials.Titanium), 'F', ItemList.Casing_StableTitanium, 'P', OrePrefixes.rotor.get(Materials.Titanium)}); ItemList.Machine_Multi_Cleanroom.set(new GT_MetaTileEntity_Cleanroom(1172, "multimachine.cleanroom", "Cleanroom Controller").getStackForm(1)); - GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_Cleanroom.get(1L, new Object[0]), bitsd, new Object[]{"FFF", "RHR", "MCM", 'H', ItemList.Hull_HV, 'F', ItemList.Component_Filter, 'R', OrePrefixes.rotor.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.circuit.get(Materials.Advanced)}); - + //If Cleanroom is enabled, add a recipe, else hide from NEI. + if (GT_Mod.gregtechproxy.mEnableCleanroom){ + GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_Cleanroom.get(1L, new Object[0]), bitsd, new Object[]{"FFF", "RHR", "MCM", 'H', ItemList.Hull_HV, 'F', ItemList.Component_Filter, 'R', OrePrefixes.rotor.get(Materials.StainlessSteel), 'M', ItemList.Electric_Motor_HV, 'C', OrePrefixes.circuit.get(Materials.Advanced)}); + } + else { + if (isNEILoaded){ + API.hideItem(ItemList.Machine_Multi_Cleanroom.get(1L, new Object[0])); + } + } + ItemList.Machine_LV_CircuitAssembler.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 1180, "basicmachine.circuitassembler.tier.01", "Basic Circuit Assembling Machine", 1, "Avengers, Assemble!", GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes, 6, 1, 16000, 0, 1, "CircuitAssembler.png", "", aBoolConst_0, aBoolConst_0, 0, "CIRCUITASSEMBLER", new Object[]{"ACE", "VMV", aTextWireCoil, 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'E', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER}).getStackForm(1L)); ItemList.Machine_MV_CircuitAssembler.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 1181, "basicmachine.circuitassembler.tier.02", "Advanced Circuit Assembling Machine", 2, "Avengers, Assemble!", GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes, 6, 1, 16000, 0, 1, "CircuitAssembler.png", "", aBoolConst_0, aBoolConst_0, 0, "CIRCUITASSEMBLER", new Object[]{"ACE", "VMV", aTextWireCoil, 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'E', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER}).getStackForm(1L)); ItemList.Machine_HV_CircuitAssembler.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( 1182, "basicmachine.circuitassembler.tier.03", "Advanced Circuit Assembling Machine II", 3, "Avengers, Assemble!", GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes, 6, 1, 16000, 0, 1, "CircuitAssembler.png", "", aBoolConst_0, aBoolConst_0, 0, "CIRCUITASSEMBLER", new Object[]{"ACE", "VMV", aTextWireCoil, 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR, 'A', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'C', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT, 'W', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'E', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER}).getStackForm(1L)); diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java index 42d6eaa516..1a385f4dbd 100644 --- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java +++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -223,7 +223,7 @@ public class GT_NEI_DefaultHandler int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) {//IF mSpecialValue == -100 THEN needs Low Gravity
drawText(10, 123, "Needs Low Gravity", -16777216);
- } else if (tSpecial == -200) {//IF mSpecialValue == -200 THEN needs cleanroom
+ } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) {//IF mSpecialValue == -200 THEN needs cleanroom
drawText(10, 123, "Needs Cleanroom", -16777216);
} else if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216);
|