aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java1
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java48
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java109
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java79
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java118
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java (renamed from src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java)19
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java24
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java51
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java142
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java18
12 files changed, 530 insertions, 95 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 297abb2ca2..aa5d3f63f4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -34,6 +34,8 @@ import com.github.bartimaeusnek.bartworks.common.loaders.*;
import com.github.bartimaeusnek.bartworks.common.net.BW_Network;
import com.github.bartimaeusnek.bartworks.server.EventHandler.ServerEventHandler;
import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
+import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader;
+import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitPartLoader;
import com.github.bartimaeusnek.bartworks.system.material.ThreadedLoader;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
@@ -48,6 +50,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
+import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.SubTag;
@@ -120,6 +123,7 @@ public final class MainMod {
if (ConfigHandler.newStuff) {
WerkstoffLoader.INSTANCE.init();
Werkstoff.init();
+ GregTech_API.sAfterGTPostload.add(new CircuitPartLoader());
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java
index 1ca3c8fe2f..ab19b5d967 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java
@@ -38,5 +38,6 @@ public class SimpleIconItem extends Item {
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex);
+
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java
new file mode 100644
index 0000000000..5bd182c6c0
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
+
+import gregtech.api.GregTech_API;
+
+public class BW_CircuitsLoader {
+ private static final BW_Meta_Items NEW_CIRCUITS;
+
+ public static BW_Meta_Items getNewCircuits() {
+ return BW_CircuitsLoader.NEW_CIRCUITS;
+ }
+
+ static {
+ NEW_CIRCUITS = new BW_Meta_Items();
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(0,1, "Primitive Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(1,2, "Basic Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(2,3, "Good Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(3,4, "Advanced Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(4,5, "Data Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(5,6, "Elite Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(6,7, "Master Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7,8, "Ultimate Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8,9, "Superconductor Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9,10, "Infinite Magneto Resonatic Circuit");
+ BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,11, "Bio Magneto Resonatic Circuit");
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
new file mode 100644
index 0000000000..c8e1ba1335
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
+
+import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
+import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.github.bartimaeusnek.bartworks.util.Pair;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.items.GT_MetaGenerated_Item;
+import gregtech.api.util.GT_OreDictUnificator;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+
+public class BW_Meta_Items {
+
+ public static BW_Meta_Items.BW_GT_MetaGenCircuits getNEWCIRCUITS() {
+ return BW_Meta_Items.NEWCIRCUITS;
+ }
+
+ private static final BW_Meta_Items.BW_GT_MetaGenCircuits NEWCIRCUITS = new BW_Meta_Items.BW_GT_MetaGenCircuits();
+
+
+ public void addNewCircuit(int aTier, int aID, String aName){
+
+ String additionalOreDictData = "";
+ String tooltip = "";
+ String aOreDictPrefix = OrePrefixes.circuit.toString();
+ switch (aTier){
+ case 0: additionalOreDictData = Materials.Primitive.toString(); tooltip = Materials.Primitive.getToolTip(); break;
+ case 1: additionalOreDictData = Materials.Basic.toString(); tooltip = Materials.Basic.getToolTip(); break;
+ case 2: additionalOreDictData = Materials.Good.toString(); tooltip = Materials.Good.getToolTip(); break;
+ case 3: additionalOreDictData = Materials.Advanced.toString(); tooltip = Materials.Advanced.getToolTip(); break;
+ case 4: additionalOreDictData = Materials.Data.toString(); tooltip = Materials.Data.getToolTip(); break;
+ case 5: additionalOreDictData = Materials.Elite.toString(); tooltip = Materials.Elite.getToolTip(); break;
+ case 6: additionalOreDictData = Materials.Master.toString(); tooltip = Materials.Master.getToolTip(); break;
+ case 7: additionalOreDictData = Materials.Ultimate.toString(); tooltip = Materials.Ultimate.getToolTip(); break;
+ case 8: additionalOreDictData = Materials.Superconductor.toString(); tooltip = Materials.Superconductor.getToolTip(); break;
+ case 9: additionalOreDictData = "Infinite"; tooltip = "An Infinite Circuit"; break;
+ case 10: additionalOreDictData = "Bio"; tooltip = "A Bio Circuit"; break;
+ }
+
+ ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID,aName,tooltip,aTier);
+
+ if (ConfigHandler.experimentalThreadedLoader)
+ OreDictAdder.addToMap(new Pair<>((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack));
+ else
+ GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack);
+ }
+
+ public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook{
+
+
+ public BW_GT_MetaGenCircuits() {
+ super("bwMetaGeneratedItem0", (short) 0, (short) 32766);
+ }
+
+ public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){
+ CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(tier-2),0,(byte)tier), CircuitImprintLoader.getTagFromStack(new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID)));
+ return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION);
+ }
+
+ public final void modifyIIconIndex(int aID, IIcon icon){
+ this.mIconList[aID][0] = icon;
+ }
+
+ public final ItemStack getStack(int... meta_amount){
+ ItemStack ret = new ItemStack(this);
+ if (meta_amount.length <= 0 || meta_amount.length > 2)
+ return ret;
+ if (meta_amount.length == 1) {
+ ret.setItemDamage(meta_amount[0]);
+ return ret;
+ }
+ ret.setItemDamage(meta_amount[0]);
+ ret.stackSize=meta_amount[1];
+ return ret;
+ }
+ }
+
+ private static class BW_GT_MetaGen_Item_Hook extends GT_MetaGenerated_Item{
+ private BW_GT_MetaGen_Item_Hook(String aUnlocalized, short aOffset, short aItemAmount) {
+ super(aUnlocalized, aOffset, aItemAmount);
+ }
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java
new file mode 100644
index 0000000000..2dfb4ad7c0
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
+
+import com.github.bartimaeusnek.bartworks.util.MurmurHash3;
+
+import java.nio.ByteBuffer;
+
+public class CircuitData {
+
+ private long aVoltage;
+ private int aSpecial;
+ private byte aTier;
+
+ public CircuitData(long aVoltage, int aSpecial, byte aTier) {
+ this.aVoltage = aVoltage;
+ this.aSpecial = aSpecial;
+ this.aTier = aTier;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof CircuitData)) return false;
+ CircuitData that = (CircuitData) o;
+ if (this.getaVoltage() != that.getaVoltage()) return false;
+ if (this.getaSpecial() != that.getaSpecial()) return false;
+ return this.getaTier() == that.getaTier();
+ }
+
+ @Override
+ public int hashCode() {
+ return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).put(this.aTier).putInt(this.aSpecial).putLong(this.aVoltage).array(),0,13,31);
+ }
+
+ public long getaVoltage() {
+ return this.aVoltage;
+ }
+
+ public void setaVoltage(long aVoltage) {
+ this.aVoltage = aVoltage;
+ }
+
+ public int getaSpecial() {
+ return this.aSpecial;
+ }
+
+ public void setaSpecial(int aSpecial) {
+ this.aSpecial = aSpecial;
+ }
+
+ public byte getaTier() {
+ return this.aTier;
+ }
+
+ public void setaTier(byte aTier) {
+ this.aTier = aTier;
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
new file mode 100644
index 0000000000..d3af29e6b7
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2019 bartimaeusnek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
+
+import com.github.bartimaeusnek.bartworks.util.BWRecipes;
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.github.bartimaeusnek.bartworks.util.Pair;
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.HashBiMap;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.items.GT_MetaGenerated_Item;
+import gregtech.api.items.GT_MetaGenerated_Item_X32;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.IIcon;
+import net.minecraftforge.oredict.OreDictionary;
+
+import java.util.*;
+
+public class CircuitImprintLoader implements Runnable {
+
+ static final ArrayListMultimap<NBTTagCompound,GT_Recipe> recipeTagMap = ArrayListMultimap.create();
+ static final HashBiMap<CircuitData,NBTTagCompound> bwCircuitTagMap = HashBiMap.create(20);
+ static final HashSet<NBTTagCompound> refs = new HashSet<>();
+ private static short reverseIDs = 32766;
+
+ public static NBTTagCompound getTagFromStack(ItemStack stack){
+ if (GT_Utility.isStackValid(stack))
+ return stack.copy().splitStack(1).writeToNBT(new NBTTagCompound());
+ return new NBTTagCompound();
+ }
+
+ public static ItemStack getStackFromTag(NBTTagCompound tagCompound){
+ return ItemStack.loadItemStackFromNBT(tagCompound);
+ }
+
+ public static void makeCircuitParts() {
+ ItemList[] itemLists = ItemList.values();
+ for (ItemList single : itemLists) {
+ if (!single.hasBeenSet())
+ continue;
+ ItemStack itemStack = single.get(1);
+ if (!GT_Utility.isStackValid(itemStack))
+ continue;
+ int[] oreIDS = OreDictionary.getOreIDs(itemStack);
+ if (oreIDS.length > 1)
+ continue;
+ String name = null;
+ if (oreIDS.length == 1)
+ name = OreDictionary.getOreName(oreIDS[0]);
+ if ((name == null || name.isEmpty()) && (single.toString().contains("Circuit") || single.toString().contains("circuit")) && single.getBlock() == Blocks.air) {
+ ArrayList<String> toolTip = new ArrayList<>();
+ single.getItem().addInformation(single.get(1).copy(), null, toolTip, true);
+ String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack));
+ BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised, toolTip.size() > 0 ? toolTip.get(0) : "");
+ GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy()},Materials.Plastic.getMolten(576),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30);
+ CircuitImprintLoader.reverseIDs--;
+ }
+ }
+ }
+
+ @Override
+ public void run() {
+ Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.iterator();
+ GT_Recipe circuitRecipe;
+ HashSet<GT_Recipe> torem = new HashSet<>();
+ while (it.hasNext()) {
+ circuitRecipe = it.next();
+ ItemStack[] outputs = circuitRecipe.mOutputs;
+ if (outputs.length < 1)
+ continue;
+ int[] oreIDS = OreDictionary.getOreIDs(outputs[0]);
+ if (oreIDS.length < 1)
+ continue;
+ String name = OreDictionary.getOreName(oreIDS[0]);
+ if (name.contains("Circuit") || name.contains("circuit")) {
+ CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]),circuitRecipe.copy());
+ for (ItemStack s : circuitRecipe.mInputs){
+ if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0)))
+ CircuitImprintLoader.refs.add(CircuitImprintLoader.getTagFromStack(s.copy().splitStack(1)));
+ }
+// if (circuitRecipe.mEUt > BW_Util.getTierVoltage(5))
+ if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))) {
+ torem.add(circuitRecipe);
+ BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(circuitRecipe);
+ }
+ }
+ }
+ GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(torem);
+ }
+
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java
index 1027e8b344..24f581d208 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/CircuitImprintLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java
@@ -20,24 +20,11 @@
* SOFTWARE.
*/
-package com.github.bartimaeusnek.bartworks.common.loaders;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.oredict.OreDictionary;
-
-import java.util.HashSet;
-
-public class CircuitImprintLoader implements Runnable {
-
- private static final HashSet<NBTTagCompound> circuitTypes = new HashSet<>();
+package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration;
+public class CircuitPartLoader implements Runnable {
@Override
public void run() {
- for(String names : OreDictionary.getOreNames()){
- if (names.contains("circuit") || names.contains("Circuit"))
- for (ItemStack itemStack : OreDictionary.getOres(names))
- CircuitImprintLoader.circuitTypes.add(itemStack.copy().splitStack(1).writeToNBT(new NBTTagCompound()));
- }
+ CircuitImprintLoader.makeCircuitParts();
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
index ccc1335e6c..24af0547a7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
@@ -108,11 +108,27 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.toolTip = "";
if (toolTip.isEmpty()) {
for (Pair<ISubTagContainer, Integer> p : contents) {
- if (p.getKey() instanceof Materials) {
- this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
+ if (contents.length > 1) {
+ if (p.getKey() instanceof Materials) {
+ if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1)
+// if (((Materials) p.getKey()).mChemicalFormula != null && Character.isDigit(((Materials) p.getKey()).mChemicalFormula.toCharArray()[((Materials) p.getKey()).mChemicalFormula.length()-1]))
+ this.toolTip += "(" + ((Materials) p.getKey()).mChemicalFormula + ")" + (BW_Util.subscriptNumber(p.getValue()));
+ else
+ this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
+ }
+ if (p.getKey() instanceof Werkstoff) {
+ if (((Werkstoff) p.getKey()).contents.size() > 1 && p.getValue() > 1)
+// if (((Werkstoff) p.getKey()).toolTip != null && Character.isDigit(((Werkstoff) p.getKey()).toolTip.toCharArray()[((Werkstoff) p.getKey()).toolTip.length()-1]))
+ this.toolTip += "(" + ((Werkstoff) p.getKey()).toolTip + ")" + (BW_Util.subscriptNumber(p.getValue()));
+ else
+ this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
+ }
+ } else {
+ if (p.getKey() instanceof Materials) {
+ this.toolTip += ((Materials) p.getKey()).mChemicalFormula + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
+ } else if (p.getKey() instanceof Werkstoff)
+ this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
}
- if (p.getKey() instanceof Werkstoff)
- this.toolTip += ((Werkstoff) p.getKey()).toolTip + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : "");
}
} else
this.toolTip = toolTip;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
index 99dce114b2..8c9164538a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
@@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores
import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler;
import com.github.bartimaeusnek.bartworks.system.log.DebugLog;
import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.AdditionalRecipes;
+import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
@@ -103,10 +104,10 @@ public class WerkstoffLoader implements Runnable {
Werkstoff.Types.ELEMENT,
new Werkstoff.GenerationFeatures().onlyDust(),
3,
- TextureSet.SET_METALLIC,
- Arrays.asList()
+ TextureSet.SET_METALLIC
+ //No Byproducts
);
- public static final Werkstoff Zirconia = new Werkstoff(
+ public static final Werkstoff CubicZirconia = new Werkstoff(
new short[]{255, 255, 255, 0},
"Cubic Zirconia",
Werkstoff.Types.COMPOUND,
@@ -462,6 +463,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust(),
30,
TextureSet.SET_METALLIC
+ //No Byproducts
);
public static final Werkstoff BismuthTellurite = new Werkstoff(
new short[]{32,72,32,0},
@@ -471,6 +473,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(),
31,
TextureSet.SET_METALLIC,
+ //No Byproducts
new Pair<>(Materials.Bismuth, 2),
new Pair<>(Materials.Tellurium, 3)
);
@@ -479,9 +482,10 @@ public class WerkstoffLoader implements Runnable {
"Tellurium",
new Werkstoff.Stats(),
Werkstoff.Types.ELEMENT,
- new Werkstoff.GenerationFeatures().disable().addMetalItems(),
+ new Werkstoff.GenerationFeatures().addMetalItems().removeOres(),
32,
TextureSet.SET_METALLIC,
+ //No Byproducts
new Pair<>(Materials.Tellurium, 1)
);
public static final Werkstoff BismuthHydroBorat = new Werkstoff(
@@ -492,23 +496,54 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(),
33,
TextureSet.SET_METALLIC,
+ //No Byproducts
new Pair<>(Materials.Bismuth, 2),
new Pair<>(Materials.Boron, 1),
new Pair<>(Materials.Hydrogen, 1)
);
public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff(
new short[]{36,36,36,0},
- "Circuit Compound MK1",
+ "Circuit Compound MK3",
new Werkstoff.Stats().setCentrifuge(true),
Werkstoff.Types.COMPOUND,
new Werkstoff.GenerationFeatures().disable().onlyDust().addMixerRecipes(),
34,
TextureSet.SET_METALLIC,
+ //No Byproducts
new Pair<>(Materials.IndiumGalliumPhosphide, 1),
new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3),
new Pair<>(WerkstoffLoader.BismuthTellurite, 2)
);
+ public static final Werkstoff Prasiolite = new Werkstoff(
+ new short[]{0xD0,0xDD,0x95,0},
+ "Prasiolite",
+ new Werkstoff.Stats().setElektrolysis(true),
+ Werkstoff.Types.COMPOUND,
+ new Werkstoff.GenerationFeatures().addGems(),
+ 35,
+ TextureSet.SET_QUARTZ,
+ //No Byproducts
+ new Pair<>(Materials.Silicon,5),
+ new Pair<>(Materials.Oxygen,10),
+ new Pair<>(Materials.Iron,1)
+ );
+
+ public static final Werkstoff MagnetoResonaticDust = new Werkstoff(
+ new short[]{0xDD,0x77,0xDD,0},
+ "Magneto Resonatic Dust",
+ new Werkstoff.Stats().setElektrolysis(true),
+ Werkstoff.Types.COMPOUND,
+ new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(),
+ 36,
+ TextureSet.SET_MAGNETIC,
+ //No Byproducts
+ new Pair<>(WerkstoffLoader.Prasiolite,3),
+ new Pair<>(WerkstoffLoader.BismuthTellurite,4),
+ new Pair<>(WerkstoffLoader.CubicZirconia,1),
+ new Pair<>(Materials.SteelMagnetic,1)
+ );
+
public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>();
public static Block BWOres;
public boolean registered;
@@ -571,6 +606,8 @@ public class WerkstoffLoader implements Runnable {
DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone));
ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff);
}
+ DebugLog.log("Loading New Circuits"+" " +(System.nanoTime()-timepreone));
+ new BW_CircuitsLoader();
DebugLog.log("Done"+" " +(System.nanoTime()-timepreone));
progressBar.step(werkstoff.getDefaultName());
}
@@ -690,7 +727,7 @@ public class WerkstoffLoader implements Runnable {
OreDictAdder.addToMap(new Pair<>("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)));
}
- OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite)));
+ OreDictAdder.addToMap(new Pair<>("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)));
} else {
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
if (werkstoff.getGenerationFeatures().hasOres())
@@ -699,7 +736,7 @@ public class WerkstoffLoader implements Runnable {
OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens));
}
- GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.Zirconia.get(gemExquisite));
+ GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite));
}
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java
index 0c8327ad69..155283bfb0 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java
@@ -28,6 +28,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Util;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
@@ -40,9 +41,6 @@ public class AdditionalRecipes implements Runnable {
@Override
public void run() {
- //Cubic Circonia
- GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4));
- GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.Zirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953);
//Thorium/Yttrium Glas
GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall,2),WerkstoffLoader.Thorianit.get(dustSmall,2),Materials.Glass.getMolten(144),null,new ItemStack(ItemRegistry.bw_glasses[0],1,12),null,800,BW_Util.getMachineVoltageFromTier(5),3663);
//Thorianit recipes
@@ -61,6 +59,14 @@ public class AdditionalRecipes implements Runnable {
GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Aluminium.getDust(1),Materials.Thorium.getDust(1),1000);
GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust),Materials.Magnesium.getDust(1),Materials.Thorium.getDust(1),1000);
GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9),Materials.Water.getFluid(1000),Materials.Thorium.getMolten(144),WerkstoffLoader.Thorianit.get(crushedPurified,4),96,24);
+
+ //TODO: Gem & Circuit Stuff
+ //Prasiolite
+ GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),GT_Values.NF,GT_Values.NF,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800, BW_Util.getMachineVoltageFromTier(2),500);
+ GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust,Materials.Quartzite,40L),Materials.Amethyst.getDust(10),6,WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed,20),GT_Values.NI,800);
+ //Cubic Circonia
+ GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(11),Materials.Oxygen.getGas(3000),null, WerkstoffLoader.YttriumOxide.get(dust,5),64, BW_Util.getMachineVoltageFromTier(4));
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.addRecipe(false, new ItemStack[]{WerkstoffLoader.Zirconium.get(dust,10), WerkstoffLoader.YttriumOxide.get(dust)}, new ItemStack[]{WerkstoffLoader.YttriumOxide.get(dust), WerkstoffLoader.CubicZirconia.get(gemFlawed, 40)}, null, null, new FluidStack[]{Materials.Oxygen.getGas(20000)}, null, 14400, BW_Util.getMachineVoltageFromTier(4), 2953);
//Tellurium
GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(crushed,Materials.Lead,10L),GT_Utility.getIntegratedCircuit(17),GT_Values.NF,GT_Values.NF,Materials.Lead.getIngots(10),Materials.Tellurium.getNuggets(20),800,BW_Util.getMachineVoltageFromTier(2),722);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
index c380f3399b..e6c83a7f76 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -60,6 +60,8 @@ public class BWRecipes {
public static final byte BIOLABBYTE = 0;
public static final byte BACTERIALVATBYTE = 1;
public static final byte ACIDGENMAPB