Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from bartimaeusnek/0.4.X
Browse files Browse the repository at this point in the history
Added THTR
  • Loading branch information
bartimaeusnek authored Apr 14, 2019
2 parents 460c371 + 5c3c594 commit d172e0d
Show file tree
Hide file tree
Showing 19 changed files with 421 additions and 72 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
mc_version=1.7.10
majorUpdate=0
minorUpdate=4
buildNumber=7
buildNumber=8
APIVersion=6
ic2.version=2.2.828-experimental
gregtech.version=5.09.32.36
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

package com.github.bartimaeusnek.ASM;

import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import cpw.mods.fml.relauncher.FMLInjectionData;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.common.config.Configuration;
Expand All @@ -44,13 +45,8 @@ public BWCorePlugin() {
if (minecraftDir != null)
return;//get called twice, once for IFMLCallHook
minecraftDir = (File) FMLInjectionData.data()[6];

Configuration asmconfighandler = new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg"));
for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) {
BWCoreTransformer.shouldTransform[i] = asmconfighandler.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true);
}
if (asmconfighandler.hasChanged())
asmconfighandler.save();
//do all the configuration already now...
new ConfigHandler(new Configuration(new File(new File(minecraftDir, "config"), "bartworks.cfg")));
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks;
import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry;
import com.github.bartimaeusnek.bartworks.common.net.BW_Network;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR;
import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
Expand Down Expand Up @@ -72,11 +73,9 @@ public final class MainMod {
public static final CreativeTabs BIO_TAB = new BioTab("BioTab");
public static final CreativeTabs BWT = new bartworksTab("bartworks");
public static final IGuiHandler GH = new GuiHandler();
public static boolean GTNH = false;

@Mod.Instance(MOD_ID)
public static MainMod instance;
public static ConfigHandler CHandler;
public static BW_Network BW_Network_instance = new BW_Network();

@Mod.EventHandler
Expand All @@ -88,17 +87,17 @@ public void preInit(FMLPreInitializationEvent preinit) {
}

if (Loader.isModLoaded("dreamcraft")) {
GTNH = true;
ConfigHandler.GTNH = true;
}
CHandler = new ConfigHandler(preinit);
ConfigHandler.GTNH = ConfigHandler.ezmode != ConfigHandler.GTNH;
if (ConfigHandler.debugLog) {
try {
new DebugLog(preinit);
} catch (IOException e) {
e.printStackTrace();
}
}
if (GTNH)
if (ConfigHandler.GTNH)
LOGGER.info("GTNH-Detected . . . ACTIVATE HARDMODE.");

if (ConfigHandler.BioLab) {
Expand All @@ -124,6 +123,7 @@ public void init(FMLInitializationEvent init) {
else
WerkstoffLoader.INSTANCE.runInit();
}

}

@Mod.EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,66 @@
package com.github.bartimaeusnek.bartworks.common.configs;


import com.github.bartimaeusnek.bartworks.MainMod;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import com.github.bartimaeusnek.ASM.BWCoreTransformer;
import gregtech.api.enums.GT_Values;
import net.minecraftforge.common.config.Configuration;

import javax.annotation.Nonnull;
import java.io.File;

public class ConfigHandler {
private static final int IDU = GT_Values.VN.length * 8 + 1;
public static int IDOffset = 12600;
public static boolean teslastaff = false;
public static boolean teslastaff;
public static long energyPerCell = 1000000L;
public static boolean newStuff = true;
public static boolean BioLab = true;
public static Configuration c;
public static boolean DEHPDirectSteam = false;
public static boolean DEHPDirectSteam;
public static int megaMachinesMax = 256;
public static int mbWaterperSec = 150;
private static boolean ezmode = false;
public static boolean debugLog = false;
public static boolean experimentalThreadedLoader = false;
public static int ross128ID = -64;
public static boolean Ross128Enabled = true;
public static boolean debugLog;
public static boolean experimentalThreadedLoader;
public static boolean GTNH;
public static boolean ezmode;

public ConfigHandler(@Nonnull FMLPreInitializationEvent e) {
c = new Configuration(new File(e.getModConfigurationDirectory().toString() + "/" + MainMod.MOD_ID + ".cfg"));
public ConfigHandler(Configuration C) {
ConfigHandler.c = C;

IDOffset = c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600);
energyPerCell = c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000);
ezmode = c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false);
MainMod.GTNH = ezmode ? !MainMod.GTNH : MainMod.GTNH;
teslastaff = c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false);
newStuff = !c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false);
BioLab = !c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false);
DEHPDirectSteam = c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false);
megaMachinesMax = c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256);
mbWaterperSec = c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150);
ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600);
ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000);
ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false);
ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false);
ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false);
ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false);
ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false);
ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256);
ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150);
if (ConfigHandler.IDOffset == 0) {
ConfigHandler.IDOffset = 12600;
c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600);
ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600);
}
ConfigHandler.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false);
ConfigHandler.experimentalThreadedLoader = ConfigHandler.c.get("System", "Enable Experimental Threaded Material Loader", false, "Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false);

for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) {
BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true);
}
debugLog=c.get("System","Enable Debug Log",false,"Enables or Disables the debug log.").getBoolean(false);
experimentalThreadedLoader =c.get("System","Enable Experimental Threaded Material Loader",false,"Enables or Disables the Experimental Threaded Material Loader.").getBoolean(false);
if (c.hasChanged())
c.save();

ConfigHandler.ross128ID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64);
ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated").getBoolean(true);

ConfigHandler.setUpComments();

if (ConfigHandler.c.hasChanged())
ConfigHandler.c.save();
}

public static void setUpComments(){
c.addCustomCategoryComment("ASM fixes","Disable ASM fixes here.");
c.addCustomCategoryComment("Multiblocks","Multliblock Options can be set here.");
c.addCustomCategoryComment("Singleblocks","Singleblock Options can be set here.");
c.addCustomCategoryComment("System","Different System Settings can be set here.");
c.addCustomCategoryComment("CrossMod Interactions","CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!");
c.save();
public static void setUpComments() {
ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here.");
ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multliblock Options can be set here.");
ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here.");
ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here.");
ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class SimpleSubItemClass extends Item {
protected IIcon[] itemIcon;
String[] tex;

public SimpleSubItemClass(String[] tex) {
public SimpleSubItemClass(String... tex) {
this.tex = tex;
this.hasSubtypes = true;
this.setCreativeTab(MainMod.BWT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_TileEntity_HeatedWaterPump;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_DEHP;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaBlastFurnace;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega.GT_TileEntity_MegaVacuumFreezer;
import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_AcidGenerator;
Expand Down Expand Up @@ -130,10 +131,13 @@ public class ItemRegistry {
public static ItemStack[] energyDistributor = new ItemStack[GT_Values.VN.length];
public static ItemStack[] acidGens = new ItemStack[3];
public static ItemStack[] megaMachines = new ItemStack[2];
public static ItemStack thtr;

public static void run() {

if (newStuff) {
thtr=new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5,"THTR","Thorium High Temperature Reactor").getStackForm(1L);
GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials();
GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks");
GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock");
GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

package com.github.bartimaeusnek.bartworks.common.loaders;

import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_LESU;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_THTR;
import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_Windmill;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
import gregtech.api.GregTech_API;
Expand All @@ -51,7 +51,7 @@ public class RecipeLoader implements Runnable {
@Override
public void run() {

if (MainMod.GTNH) {
if (ConfigHandler.GTNH) {
/*
* GTNH "hardmode" Recipes
*/
Expand Down Expand Up @@ -96,11 +96,11 @@ public void run() {
"CDC",
"SBS",
"CFC",
'C', GT_OreDictUnificator.get(OrePrefixes.circuit, MainMod.GTNH ? Materials.Advanced : Materials.Basic, 1L),
'C', GT_OreDictUnificator.get(OrePrefixes.circuit, ConfigHandler.GTNH ? Materials.Advanced : Materials.Basic, 1L),
'D', ItemList.Cover_Screen.get(1L),
'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, MainMod.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L),
'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.GTNH ? Materials.Platinum : Materials.AnnealedCopper, 1L),
'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]),
'F', MainMod.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L)
'F', ConfigHandler.GTNH ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L)
});

GT_ModHandler.addCraftingRecipe(
Expand All @@ -111,7 +111,7 @@ public void run() {
"PLP",
"CPC",
'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L),
'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L),
'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L),
'L', new ItemStack(Items.lava_bucket)
});

Expand All @@ -123,7 +123,7 @@ public void run() {
"PLP",
"CPC",
'C', GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 1L),
'P', GT_OreDictUnificator.get(MainMod.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, MainMod.GTNH ? Materials.Steel : Materials.Iron, 1L),
'P', GT_OreDictUnificator.get(ConfigHandler.GTNH ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.GTNH ? Materials.Steel : Materials.Iron, 1L),
'L', new ItemStack(Items.lava_bucket)
});

Expand Down Expand Up @@ -219,7 +219,7 @@ public void run() {
}
);

if (!MainMod.GTNH)
if (!ConfigHandler.GTNH)
GT_ModHandler.addCraftingRecipe(
ItemRegistry.dehp,
BITSD,
Expand Down Expand Up @@ -727,6 +727,19 @@ public void run() {
'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L),
}
);
GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes();
GT_ModHandler.addCraftingRecipe(
ItemRegistry.thtr,
RecipeLoader.BITSD,
new Object[]{
"BZB",
"BRB",
"BZB",
'B',new ItemStack(GregTech_API.sBlockCasings3,1,12),
'R',GT_ModHandler.getModItem("IC2","blockGenerator",1,5),
'Z',"circuitUltimate"
}
);

}
}
Expand Down
Loading

0 comments on commit d172e0d

Please sign in to comment.