aboutsummaryrefslogtreecommitdiff
path: root/src/Java
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2017-12-09 19:19:30 +1000
committerJordan Byrne <draknyte1@hotmail.com>2017-12-09 19:19:30 +1000
commit02c185e70e23c3c826e26e2ca4ddf5dbb056af71 (patch)
treeb7419fd7dd36a290c1d5b8884bd224de276ae5f2 /src/Java
parent4f57b824fa40ac0628bf0f7fe9215bdd06cc0c52 (diff)
downloadGT5-Unofficial-02c185e70e23c3c826e26e2ca4ddf5dbb056af71.tar.gz
GT5-Unofficial-02c185e70e23c3c826e26e2ca4ddf5dbb056af71.tar.bz2
GT5-Unofficial-02c185e70e23c3c826e26e2ca4ddf5dbb056af71.zip
+ Added a config option to disable Zombie Reinforcements.
% Redid some Circuit handling for recipes. $ Fixed Component Assembler recipes not using all circuits per tier for recipes.
Diffstat (limited to 'src/Java')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java93
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java23
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java16
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java3
-rw-r--r--src/Java/gtPlusPlus/core/recipe/common/CI.java85
-rw-r--r--src/Java/gtPlusPlus/core/util/item/ItemUtils.java16
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java45
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java175
8 files changed, 312 insertions, 144 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index 8b6f750630..a999100d85 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -33,6 +33,7 @@ import gtPlusPlus.core.handler.events.BlockEventHandler;
import gtPlusPlus.core.handler.events.LoginEventHandler;
import gtPlusPlus.core.item.general.RF2EU_Battery;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.geo.GeoUtils;
import gtPlusPlus.core.util.item.ItemUtils;
@@ -63,7 +64,7 @@ public class GTplusplus implements ActionListener {
new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg"));
config.load();
- CORE.configSwitches.enableUpdateChecker = config.getBoolean("enableUpdateChecker", "debug", true,
+ configSwitches.enableUpdateChecker = config.getBoolean("enableUpdateChecker", "debug", true,
"Stops mod checking for updates.");
// Debug
@@ -88,100 +89,100 @@ public class GTplusplus implements ActionListener {
false, "Utilizes Neutronium instead.");
//Circuits
- CORE.configSwitches.enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", true,
+ configSwitches.enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", true,
"Adds custom circuits to expand past the Master Tier.");
- CORE.configSwitches.enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false,
+ configSwitches.enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false,
"Restores circuits and their recipes from Pre-5.09.28 times.");
// Tools
- CORE.configSwitches.enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true,
+ configSwitches.enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true,
"Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench.");
- CORE.configSwitches.enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true,
+ configSwitches.enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true,
"Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available.");
// GT-Fixes
- CORE.configSwitches.enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false,
+ configSwitches.enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false,
"Restores the old Nitro-Diesel recipes.");
// Pipes & Cables
- CORE.configSwitches.enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true,
+ configSwitches.enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true,
"Adds Custom GT Fluid Pipes.");
- CORE.configSwitches.enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true,
+ configSwitches.enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true,
"Adds Custom GT Cables.");
// Block Drops
- CORE.configSwitches.chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0,
+ configSwitches.chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0,
10000, "Drained shards have a 1 in X chance to drop.");
- CORE.configSwitches.chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0,
+ configSwitches.chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0,
10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone..");
// Single machines
- CORE.configSwitches.enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech",
+ configSwitches.enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech",
false, "These may be overpowered, Consult a local electrician.");
- CORE.configSwitches.enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true,
+ configSwitches.enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true,
"These protect your goodies/rare stuff.");
- CORE.configSwitches.enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true,
+ configSwitches.enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true,
"These dehydrate stuff.");
- CORE.configSwitches.enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech",
+ configSwitches.enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech",
true, "Converts IC2 steam -> Railcraft steam.");
- CORE.configSwitches.enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true,
+ configSwitches.enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true,
"Portable fluid tanks.");
- CORE.configSwitches.enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech",
+ configSwitches.enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech",
true, "Diesel egines with different internals, they consume less fuel overall.");
- CORE.configSwitches.enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines",
+ configSwitches.enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines",
"gregtech", true, "These may be overpowered, Consult a local geologist.");
- CORE.configSwitches.enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators",
+ configSwitches.enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators",
"gregtech", true, "These allow boosting Block/TileEntity Tick times [OP].");
- CORE.configSwitches.enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts",
+ configSwitches.enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts",
"gregtech", true, "Tesseracts for wireless item/fluid movement.");
- CORE.configSwitches.enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher",
+ configSwitches.enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher",
"gregtech", true, "Very basic automated cauldron for dust washing.");
- CORE.configSwitches.enableMachine_Pollution = config.getBoolean("enableMachinePollution",
+ configSwitches.enableMachine_Pollution = config.getBoolean("enableMachinePollution",
"gregtech", true, "Pollution Detector & Scrubbers.");
// Multi machines
- CORE.configSwitches.enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter",
+ configSwitches.enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter",
"gregtech", true,
"Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal.");
- CORE.configSwitches.enableMultiblock_IndustrialCentrifuge = config
+ configSwitches.enableMultiblock_IndustrialCentrifuge = config
.getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin.");
- CORE.configSwitches.enableMultiblock_IndustrialCokeOven = config.getBoolean(
+ configSwitches.enableMultiblock_IndustrialCokeOven = config.getBoolean(
"enableMultiblockIndustrialCokeOven", "gregtech", true,
"Pyro Oven Alternative, older, more realistic, better.");
- CORE.configSwitches.enableMultiblock_IndustrialElectrolyzer = config.getBoolean(
+ configSwitches.enableMultiblock_IndustrialElectrolyzer = config.getBoolean(
"enableMultiblockIndustrialElectrolyzer", "gregtech", true,
"Electrolyzes things with extra bling factor.");
- CORE.configSwitches.enableMultiblock_IndustrialMacerationStack = config.getBoolean(
+ configSwitches.enableMultiblock_IndustrialMacerationStack = config.getBoolean(
"enableMultiblockIndustrialMacerationStack", "gregtech", true,
"A hyper efficient maceration tower, nets more bonus outputs.");
- CORE.configSwitches.enableMultiblock_IndustrialPlatePress = config.getBoolean(
+ configSwitches.enableMultiblock_IndustrialPlatePress = config.getBoolean(
"enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo.");
- CORE.configSwitches.enableMultiblock_IndustrialWireMill = config.getBoolean(
+ configSwitches.enableMultiblock_IndustrialWireMill = config.getBoolean(
"enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables.");
- CORE.configSwitches.enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace",
+ configSwitches.enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace",
"gregtech", true, "Skip the Bronze age, very slowly.");
- CORE.configSwitches.enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator",
+ configSwitches.enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator",
"gregtech", true, "?FAB?RIC?ATE MA?TT?ER.");
- CORE.configSwitches.enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech",
+ configSwitches.enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech",
true, "Tall tanks, each layer adds extra fluid storage.");
- CORE.configSwitches.enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation",
+ configSwitches.enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation",
"gregtech", true, "For managing large power grids.");
- CORE.configSwitches.enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean(
+ configSwitches.enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean(
"enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids.");
- CORE.configSwitches.enableMultiblock_NuclearFuelRefinery = config.getBoolean(
+ configSwitches.enableMultiblock_NuclearFuelRefinery = config.getBoolean(
"enableMultiblock_NuclearFuelRefinery", "gregtech", true,
"Refines molten chemicals into nuclear fuels.");
- CORE.configSwitches.enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter",
+ configSwitches.enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter",
"gregtech", true, "Large scale sifting.");
- CORE.configSwitches.enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter",
+ configSwitches.enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter",
"gregtech", true, "Can Assemble, Disassemble and Craft Project data from Data Sticks.");
- CORE.configSwitches.enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge",
+ configSwitches.enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge",
"gregtech", true, "Your warm spin for the ore thing.");
- CORE.configSwitches.enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant",
+ configSwitches.enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant",
"gregtech", true, "Used to wash the dirt, riiiiight offff..");
- CORE.configSwitches.enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler",
+ configSwitches.enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler",
"gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources.");
- CORE.configSwitches.enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine",
+ configSwitches.enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine",
"gregtech", true, "Very fast and efficient Cutting Machine.");
// Options
@@ -189,8 +190,10 @@ public class GTplusplus implements ActionListener {
"How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)");
// Features
- CORE.mEnableCape = config.getBoolean("enableSupporterCape", "features", true,
- "Enables Custom GT++ Cape.");
+ configSwitches.enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true,
+ "Enables Custom GT++ Cape.");
+ configSwitches.disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false,
+ "Disables Zombie Reinforcement on hard difficutly.");
//Biomes
CORE.DARKBIOME_ID = config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension.");
@@ -223,7 +226,7 @@ public class GTplusplus implements ActionListener {
Utils.LOG_INFO("Loading " + CORE.name + " V" + CORE.VERSION);
if(!Utils.isServer()){
- CORE.mEnableCape = true;
+ configSwitches.enableCustomCapes = true;
}
//HTTP Requests
@@ -234,7 +237,7 @@ public class GTplusplus implements ActionListener {
handleConfigFile(event);
CORE.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
- if (CORE.configSwitches.enableUpdateChecker){
+ if (configSwitches.enableUpdateChecker){
Utils.LOG_INFO("Latest is " + CORE.MASTER_VERSION + ". Updated? " + Utils.isModUpToDate());
}
Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY);
@@ -243,7 +246,7 @@ public class GTplusplus implements ActionListener {
Utils.registerEvent(new LoginEventHandler());
Utils.LOG_INFO("Login Handler Initialized");
- if (CORE.configSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ if (configSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
removeCircuitRecipeMap(); //Bye shitty recipes.
}
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index 78e42d0ac7..10602c613e 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -10,8 +10,10 @@ import gtPlusPlus.core.entity.InternalEntityRegistry;
import gtPlusPlus.core.handler.*;
import gtPlusPlus.core.handler.events.BlockEventHandler;
import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
+import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.CORE.configSwitches;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.recipe.RECIPES_Old_Circuits;
import gtPlusPlus.core.recipe.common.CI;
@@ -68,8 +70,8 @@ public class CommonProxy {
registerEntities();
Utils.LOG_INFO("[Proxy] Calling Tile Entity registrator.");
registerTileEntities();
-
-
+
+
}
public void init(final FMLInitializationEvent e) {
@@ -80,25 +82,30 @@ public class CommonProxy {
ModItems.init();
ModBlocks.init();
CI.Init();
-
+
/**
* Register the Event Handlers.
*/
-
+
//Prevents my Safes being destroyed.
Utils.registerEvent(new PickaxeBlockBreakEventHandler());
//Block Handler for all events.
Utils.registerEvent(new BlockEventHandler());
//Handles Custom tooltips for EIO.
Utils.registerEvent(new HandlerTooltip_EIO());
-
+
+ if (configSwitches.disableZombieReinforcement){
+ //Make Zombie reinforcements fuck off.
+ Utils.registerEvent(new ZombieBackupSpawnEventHandler());
+ }
+
/**
* End of Subscribe Event registration.
*/
Utils.LOG_INFO("[Proxy] Calling Render registrator.");
registerRenderThings();
-
+
//Compat Handling
COMPAT_HANDLER.registerMyModsOreDictEntries();
COMPAT_HANDLER.intermodOreDictionarySupport();
@@ -121,7 +128,7 @@ public class CommonProxy {
GameRegistry.registerFuelHandler(fuelHandler);
Utils.LOG_INFO("[Fuel Handler] Registering "+fuelHandler.getClass().getName());
}
-
+
//Compat Handling
COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
COMPAT_HANDLER.RemoveRecipesFromOtherMods();
@@ -138,7 +145,7 @@ public class CommonProxy {
public void registerNetworkStuff(){
GuiHandler.init();
}
-
+
public void registerEntities(){
InternalEntityRegistry.registerEntities();
}
diff --git a/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
new file mode 100644
index 0000000000..ec078509a2
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.core.handler.events;
+
+import cpw.mods.fml.common.eventhandler.Event.Result;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.event.entity.living.ZombieEvent;
+
+public class ZombieBackupSpawnEventHandler {
+
+ @SubscribeEvent
+ public void onZombieReinforcement(final ZombieEvent.SummonAidEvent event) {
+ if (event.summonChance > 0){
+ event.setResult(Result.DENY);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 91bb519973..cd6aacd3a8 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -54,7 +54,6 @@ public class CORE {
public static final int GREGTECH_API_VERSION = GregTech_API.VERSION;
public static IGregtech_RecipeAdder RA;
- public static boolean mEnableCape = false;
public static GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("gtplusplus.core".getBytes()), "[GT++]");
@@ -131,8 +130,10 @@ public class CORE {
public static boolean enableAlternativeDivisionSigilRecipe = false;
//Feature Related
+ public static boolean enableCustomCapes = false;
public static boolean enableCustomCircuits = true;
public static boolean enableOldGTcircuits = false;
+ public static boolean disableZombieReinforcement = false;
//GT Fixes
public static boolean enableNitroFix = false;
diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java
index ad5e4c634c..1ac0f61c84 100644
--- a/src/Java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java
@@ -291,50 +291,53 @@ public class CI {
}
}
else {
- if (tier == 0){
- //return ItemList.Circuit_Primitive.get(1);
- return "circuitPrimitive";
- }
- else if (tier == 1){
- //return ItemList.Circuit_Basic.get(1);
- return "circuitBasic";
- }
- else if (tier == 2){
- //return ItemList.Circuit_Good.get(1);
- return "circuitGood";
- }
- else if (tier == 3){
- //return ItemList.Circuit_Advanced.get(1);
- return "circuitAdvanced";
- }
- else if (tier == 4){
- //return ItemList.Circuit_Elite.get(1);
- return "circuitData";
- }
- else if (tier == 5){
- //return ItemList.Circuit_Elite.get(1);
- return "circuitElite";
- }
- else if (tier == 6){
- //return ItemList.Circuit_Master.get(1);
- return "circuitMaster";
- }
- else if (tier == 7){
- //return ItemList.Circuit_Ultimate.get(1);
- return "circuitUltimate";
- }
- else if (tier == 8){
- return "circuitSuperconductor";
- }
- else if (tier == 9){
- return "circuitInfinite";
- }
- else if (tier == 10){
- return "circuitQuantum";
- }
+ return getTieredCircuitOreDictName(tier);
}
return _NULL;
}
+
+ public static ItemStack[] getAllCircuitsOfTier(int tier){
+ return ItemUtils.getStackOfAllOreDictGroup(getTieredCircuitOreDictName(tier));
+ }
+
+ public static String getTieredCircuitOreDictName(int tier){
+ if (tier == 0){
+ return "circuitPrimitive";
+ }
+ else if (tier == 1){
+ return "circuitBasic";
+ }
+ else if (tier == 2){
+ return "circuitGood";
+ }
+ else if (tier == 3){
+ return "circuitAdvanced";
+ }
+ else if (tier == 4){
+ return "circuitData";
+ }
+ else if (tier == 5){
+ return "circuitElite";
+ }
+ else if (tier == 6){
+ return "circuitMaster";
+ }
+ else if (tier == 7){
+ return "circuitUltimate";
+ }
+ else if (tier == 8){
+ return "circuitSuperconductor";
+ }
+ else if (tier == 9){
+ return "circuitInfinite";
+ }
+ else if (tier == 10){
+ return "circuitQuantum";
+ }
+ else {
+ return "circuitPrimitive";
+ }
+ }
public static ItemStack getNumberedCircuit(int Meta){
return ItemUtils.getGregtechCircuit(Meta);
diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
index 852dde6a4b..71b37ebf48 100644
--- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java
@@ -684,6 +684,22 @@ public class ItemUtils {
Utils.LOG_INFO("[Component Maker] Found "+mItemName+".");
return (gregstack);
}
+
+ public static ItemStack[] getStackOfAllOreDictGroup(String oredictname){
+ final ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictname);
+ if (!oreDictList.isEmpty()){
+ final ItemStack[] returnValues = new ItemStack[oreDictList.size()];
+ for (int i=0;i<oreDictList.size();i++){
+ if (oreDictList.get(i) != null){
+ returnValues[i] = oreDictList.get(i);
+ }
+ }
+ return returnValues.length>0 ? returnValues : null;
+ }
+ else {
+ return null;
+ }
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
index 8a138366ba..7d094b7a43 100644
--- a/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
+++ b/src/Java/gtPlusPlus/core/util/recipe/RecipeUtils.java
@@ -322,6 +322,51 @@ public class RecipeUtils {
+ public static boolean addShapedGregtechRecipeForTypes(
+ final Object InputItem1, final Object InputItem2, final Object InputItem3,
+ final Object InputItem4, final Object InputItem5, final Object InputItem6,
+ final Object InputItem7, final Object InputItem8, final Object InputItem9,
+ final ItemStack OutputItem){
+
+ int using = 0, recipeSlotCurrent = 0;
+ boolean[] hasMultiStack = new boolean[9];
+ boolean inUse[] = {false, false, false};
+ ItemStack array[][] = new ItemStack[3][9];
+
+ Object[] inputs = {
+ InputItem1, InputItem2, InputItem3,
+ InputItem4, InputItem5, InputItem6,
+ InputItem7, InputItem8, InputItem9};
+
+ for (Object o : inputs){
+ if (o.getClass().isArray()){
+ if (inUse[using] == false){
+ inUse[using] = true;
+ array[using] = (ItemStack[]) o;
+ hasMultiStack[recipeSlotCurrent] = true;
+ using++;
+ }
+ }
+ else {
+ hasMultiStack[recipeSlotCurrent] = false;
+ }
+ recipeSlotCurrent++;
+ }
+
+ int using2 = 0;
+ for (boolean t : inUse){
+
+ if (t){
+ if (array[using2] != null){
+ //addShapedGregtechRecipe
+ }
+ }
+ using2++;
+ }
+
+
+ return false;
+ }
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java
index 638f5ef2b0..c6884275a6 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java
@@ -119,7 +119,6 @@ public class GregtechComponentAssembler {
// addRecipeEmitter(0, Materials.Lead, Materials.IronMagnetic);
addRecipeEmitter(1, Materials.Tin, Materials.Brass, Materials.Quartzite);
addRecipeEmitter(2, Materials.Copper, Materials.Electrum, Materials.NetherQuartz);
- ;
addRecipeEmitter(3, Materials.Gold, Materials.Chrome, Materials.Emerald);
addRecipeEmitter(4, Materials.Aluminium, Materials.Platinum, Materials.EnderPearl);
addRecipeEmitter(5, Materials.Tungsten, Materials.Osmium, Materials.EnderEye);
@@ -286,17 +285,40 @@ public class GregtechComponentAssembler {
ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2);
ItemStack motorStack = ItemList.valueOf("Electric_Motor_" + GT_Values.VN[tier]).get(2);
ItemStack pistonStack = ItemList.valueOf("Electric_Piston_" + GT_Values.VN[tier]).get(1);
- ItemStack circuitStack;
- if (CI.getTieredCircuit(tier) instanceof String) {
- circuitStack = ItemUtils.getItemStackOfAmountFromOreDict((String) CI.getTieredCircuit(tier), 1);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 1;
+ ItemStack Input[] = { returnValue, cableStack, rodStack, pistonStack, motorStack };
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Robot_Arm_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ }
+ else {
+ return false;
+ }
}
else {
- circuitStack = (ItemStack) CI.getTieredCircuit(tier);
+ ItemStack Input[] = { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1), cableStack, rodStack, pistonStack, motorStack };
+ return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Robot_Arm_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
}
- ItemStack Input[] = { circuitStack, cableStack, rodStack, pistonStack, motorStack };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- ItemList.valueOf("Robot_Arm_" + GT_Values.VN[tier]).get(1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
+
+
}
catch (Throwable t) {
return false;
@@ -334,21 +356,40 @@ public class GregtechComponentAssembler {
gem = ItemUtils.getSimpleStack(Items.ender_pearl);
OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT);
-
- ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, Materials.Osmium, 4);
-
- ItemStack circuitStack;
- if (CI.getTieredCircuit(tier) instanceof String) {
- circuitStack = ItemUtils.getItemStackOfAmountFromOreDict((String) CI.getTieredCircuit(tier), 4);
- }
- else {
- circuitStack = (ItemStack) CI.getTieredCircuit(tier);
+ ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, Materials.Osmium, 4);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 4;
+ ItemStack Input[] = { returnValue, wireStack, gem };
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Field_Generator_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ }
+ else {
+ return false;
+ }
}
- circuitStack.stackSize = 4;
- ItemStack Input[] = { circuitStack, wireStack, gem };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- ItemList.valueOf("Field_Generator_" + GT_Values.VN[tier]).get(1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
+ else {
+ ItemStack Input[] = { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 4), wireStack, gem };
+ return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Field_Generator_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
}
catch (Throwable t) {
return false;
@@ -359,19 +400,42 @@ public class GregtechComponentAssembler {
try {
ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 2);
ItemStack gemstack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
- ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 4);
- ItemStack circuitStack;
- if (CI.getTieredCircuit(tier) instanceof String) {
- circuitStack = ItemUtils.getItemStackOfAmountFromOreDict((String) CI.getTieredCircuit(tier), 2);
+ ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 4);
+
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 2;
+ ItemStack Input[] = { returnValue, cableStack, gemstack, magrodStack };
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Emitter_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
+ }
+ else {
+ return false;
+ }
}
else {
- circuitStack = (ItemStack) CI.getTieredCircuit(tier);
- }
- circuitStack.stackSize = 2;
- ItemStack Input[] = { circuitStack, cableStack, gemstack, magrodStack };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- ItemList.valueOf("Emitter_" + GT_Values.VN[tier]).get(1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
+ ItemStack Input[] = { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 2), cableStack, gemstack, magrodStack };
+ return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Emitter_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+
+
+
}
catch (Throwable t) {
return false;
@@ -382,28 +446,41 @@ public class GregtechComponentAssembler {
try {
ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, plate, 4);
ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, rod, 1);
- ItemStack gemStack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
+ ItemStack gemStack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1);
- if (tier == 0) {
- if (CI.getTieredCircuit(tier + 1) instanceof String) {
- gemStack = ItemUtils.getItemStackOfAmountFromOreDict((String) CI.getTieredCircuit(tier + 1), 1);
+ boolean mAdd[];
+ final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier);
+ if (oreDictList.length > 0) {
+ int mcount = 0, added = 0;
+ mAdd = new boolean[oreDictList.length];
+ for (ItemStack mCircuitType : oreDictList) {
+ final ItemStack returnValue = mCircuitType.copy();
+ returnValue.stackSize = 1;
+ ItemStack Input[] = { returnValue, cableStack, returnValue, magrodStack };
+ mAdd[mcount++] = CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Sensor_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
+ }
+ for (boolean y : mAdd) {
+ if (y) {
+ added++;
+ }
+ }
+ if (added >= (oreDictList.length / 2)) {
+ return true;
}
else {
- gemStack = (ItemStack) CI.getTieredCircuit(tier + 1);
+ return false;
}
}
-
- ItemStack circuitStack2;
- if (CI.getTieredCircuit(tier) instanceof String) {
- circuitStack2 = ItemUtils.getItemStackOfAmountFromOreDict((String) CI.getTieredCircuit(tier), 1);
- }
else {
- circuitStack2 = (ItemStack) CI.getTieredCircuit(tier);
+ ItemStack Input[] = { gemStack, cableStack, magrodStack, ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1) };
+ return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
+ ItemList.valueOf("Sensor_" + GT_Values.VN[tier]).get(1), (tier * 40),
+ ((int) GT_Values.V[tier] / 16) * 15);
}
- ItemStack Input[] = { gemStack, cableStack, circuitStack2, magrodStack };
- return CORE.RA.addComponentMakerRecipe(Input, GT_Values.NF,
- ItemList.valueOf("Sensor_" + GT_Values.VN[tier]).get(1), (tier * 40),
- ((int) GT_Values.V[tier] / 16) * 15);
+
+
}
catch (Throwable t) {
return false;