aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.properties2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java213
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java8
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java57
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java49
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java11
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java40
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java90
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java322
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java74
12 files changed, 753 insertions, 117 deletions
diff --git a/build.properties b/build.properties
index a57697dccb..ed11277dc1 100644
--- a/build.properties
+++ b/build.properties
@@ -23,7 +23,7 @@
mc_version=1.7.10
majorUpdate=0
minorUpdate=5
-buildNumber=0_pre7
+buildNumber=0_pre9
APIVersion=7
ic2.version=2.2.828-experimental
gregtech.version=5.09.32.36
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index d1b2935cf3..6f066cb893 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -41,7 +41,9 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.system.material.processingLoaders.DownTierLoader;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
+import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
+import com.google.common.collect.ArrayListMultimap;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
@@ -49,24 +51,26 @@ import cpw.mods.fml.common.event.*;
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;
-import gregtech.api.util.GT_LanguageManager;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.enums.*;
+import gregtech.api.interfaces.ISubTagContainer;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.*;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
-import java.util.HashSet;
+import java.lang.reflect.Field;
+import java.util.*;
import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap;
+import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*;
@Mod(
modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION,
@@ -120,7 +124,7 @@ public final class MainMod {
bioCultureLoader.run();
}
if (ConfigHandler.newStuff) {
- WerkstoffLoader.INSTANCE.init();
+ INSTANCE.init();
Werkstoff.init();
GregTech_API.sAfterGTPostload.add(new CircuitPartLoader());
}
@@ -142,7 +146,7 @@ public final class MainMod {
if (ConfigHandler.experimentalThreadedLoader)
new ThreadedLoader().runInit();
else
- WerkstoffLoader.INSTANCE.runInit();
+ INSTANCE.runInit();
}
}
@@ -156,7 +160,7 @@ public final class MainMod {
if (ConfigHandler.experimentalThreadedLoader)
new ThreadedLoader().run();
else
- WerkstoffLoader.INSTANCE.run();
+ INSTANCE.run();
GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor","Electric Implosions?");
GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.electricimplosioncompressor.desc","Basically a giant Hammer that presses Stuff - No more TNT!");
GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.DEHP","Heat from below!");
@@ -170,13 +174,198 @@ public final class MainMod {
public static void runOnPlayerJoined(boolean classicMode){
OreDictHandler.adaptCacheForWorld();
- WerkstoffLoader.removeIC2Recipes();
+ removeIC2Recipes();
MainMod.addElectricImplosionCompressorRecipes();
+ MainMod.unificationEnforcer();
+
+ ArrayListMultimap tochange = MainMod.getRecipesToChange(NOBLE_GAS,ANAEROBE_GAS);
+ HashSet noGas = MainMod.getNoGasItems(tochange);
+ MainMod.editRecipes(tochange,noGas);
+
new CircuitImprintLoader().run();
if (classicMode)
new DownTierLoader().run();
}
+ private static void unificationEnforcer() {
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) {
+ if (werkstoff.getGenerationFeatures().enforceUnification) {
+ MainMod.runMoltenUnificationEnfocement(werkstoff);
+ for (OrePrefixes prefixes : OrePrefixes.values()) {
+ if (OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size() > 1) {
+ for (int j = 0; j < OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).size(); j++) {
+ ItemStack toReplace = OreDictionary.getOres(prefixes + werkstoff.getDefaultName()).get(j);
+ ItemStack replacement = werkstoff.get(prefixes);
+ if (GT_Utility.areStacksEqual(toReplace,replacement) || replacement == null || replacement.getItem() == null)
+ continue;
+ if (toReplace != null) {
+ for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
+ HashSet<GT_Recipe> toRem = new HashSet<>();
+ for (GT_Recipe recipe : map.mRecipeList) {
+ boolean removal = map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes);
+ for (int i = 0; i < recipe.mInputs.length; i++) {
+ if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) {
+ if (removal)
+ toRem.add(recipe);
+ else
+ recipe.mInputs[i] = replacement;
+ }
+ }
+ for (int i = 0; i < recipe.mOutputs.length; i++) {
+ if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) {
+ if (removal)
+ toRem.add(recipe);
+ else
+ recipe.mOutputs[i] = replacement;
+ }
+ }
+ if (recipe.mSpecialItems instanceof ItemStack) {
+ if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) {
+ if (removal)
+ toRem.add(recipe);
+ else
+ recipe.mSpecialItems = replacement;
+ }
+ }
+ }
+ map.mRecipeList.removeAll(toRem);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){
+ if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) {
+ try {
+ FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(molten.get(werkstoff), 144), werkstoff.get(cellMolten), Materials.Empty.getCells(1));
+ Field f = GT_Utility.class.getDeclaredField("sFilledContainerToData");
+ f.setAccessible(true);
+ Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData> sFilledContainerToData = (Map<GT_ItemStack, FluidContainerRegistry.FluidContainerData>) f.get(null);
+ HashSet torem = new HashSet();
+ ItemStack toReplace = null;
+ for (Map.Entry<GT_ItemStack, FluidContainerRegistry.FluidContainerData> entry : sFilledContainerToData.entrySet()) {
+ if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) {
+ toReplace = entry.getValue().filledContainer;
+ torem.add(entry);
+ }
+ }
+ torem.clear();
+ sFilledContainerToData.entrySet().removeAll(torem);
+ if (toReplace != null) {
+ for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) {
+ torem.clear();
+ for (GT_Recipe recipe : map.mRecipeList) {
+ for (int i = 0; i < recipe.mInputs.length; i++) {
+ if (GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) {
+ torem.add(recipe);
+ // recipe.mInputs[i] = data.filledContainer;
+ }
+ }
+ for (int i = 0; i < recipe.mOutputs.length; i++) {
+ if (GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) {
+ torem.add(recipe);
+ // recipe.mOutputs[i] = data.filledContainer;
+ if (map == GT_Recipe.GT_Recipe_Map.sFluidCannerRecipes && GT_Utility.areStacksEqual(recipe.mOutputs[i], data.filledContainer) && !recipe.mFluidInputs[0].equals(data.fluid)) {
+ torem.add(recipe);
+ // recipe.mOutputs[i] = data.filledContainer;
+ }
+ }
+ }
+ if (recipe.mSpecialItems instanceof ItemStack) {
+ if (GT_Utility.areStacksEqual((ItemStack) recipe.mSpecialItems, toReplace)) {
+ torem.add(recipe);
+ // recipe.mSpecialItems = data.filledContainer;
+ }
+ }
+ }
+ map.mRecipeList.removeAll(torem);
+ }
+ }
+
+ GT_Utility.addFluidContainerData(data);
+ } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static ArrayListMultimap<SubTag,GT_Recipe> getRecipesToChange(SubTag... GasTags){
+ Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator();
+ ArrayListMultimap<SubTag,GT_Recipe> toAdd = ArrayListMultimap.create();
+ while (it.hasNext()) {
+ GT_Recipe recipe = it.next();
+ if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) {
+ String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", "");
+ Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1));
+ if (mat != Materials._NULL) {
+ for (SubTag tag : GasTags){
+ if (mat.contains(tag))
+ toAdd.put(tag,recipe);
+ }
+ }
+ }
+ }
+ return toAdd;
+ }
+
+ private static HashSet<ItemStack> getNoGasItems(ArrayListMultimap<SubTag,GT_Recipe> base){
+ Iterator<GT_Recipe> it = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.iterator();
+ HashSet<ItemStack> toAdd = new HashSet<>();
+ ArrayListMultimap repToAdd = ArrayListMultimap.create();
+ while (it.hasNext()) {
+ GT_Recipe recipe = it.next();
+ for (SubTag tag : base.keySet())
+ recipeLoop:
+ for (GT_Recipe baseRe : base.get(tag)) {
+ if (recipe.mInputs.length == baseRe.mInputs.length && recipe.mOutputs.length == baseRe.mOutputs.length)
+ for (int i = 0; i < recipe.mInputs.length; i++) {
+ if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) && BW_Util.checkStackAndPrefix(recipe.mInputs[i]) && BW_Util.checkStackAndPrefix(baseRe.mInputs[i]) && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]).mMaterial.mMaterial.equals(GT_OreDictUnificator.getAssociation(baseRe.mInputs[i]).mMaterial.mMaterial) && GT_Utility.areStacksEqual(recipe.mOutputs[0], recipe.mOutputs[0])) {
+ toAdd.add(recipe.mOutputs[0]);
+ repToAdd.put(tag,recipe);
+ continue recipeLoop;
+ }
+ }
+ }
+ }
+ base.putAll(repToAdd);
+ return toAdd;
+ }
+
+ private static void editRecipes(ArrayListMultimap<SubTag,GT_Recipe> base, HashSet<ItemStack> noGas) {
+ HashSet<GT_Recipe> toAdd = new HashSet<>();
+ for (SubTag GasTag : base.keySet()) {
+ for (GT_Recipe recipe : base.get(GasTag)) {
+ if (recipe.mFluidInputs != null && recipe.mFluidInputs.length > 0) {
+ String FluidString = recipe.mFluidInputs[0].getFluid().getName().replaceAll("molten", "").replaceAll("fluid", "");
+ Materials mat = Materials.get(FluidString.substring(0, 1).toUpperCase() + FluidString.substring(1));
+ if (mat != Materials._NULL) {
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashMap.values()) {
+ if (!werkstoff.contains(GasTag))
+ continue;
+ toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(fluids.get(werkstoff), recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons() - (double) werkstoff.getStats().getProtons())), recipe.mEUt, recipe.mSpecialValue));
+ }
+ for (Materials materials : Materials.values()) {
+ if (!materials.contains(GasTag))
+ continue;
+ toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{materials.getGas(recipe.mFluidInputs[0].amount)}, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons() - (double) materials.getProtons())), recipe.mEUt, recipe.mSpecialValue));
+ }
+ for (ItemStack is : noGas)
+ if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) {
+ toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, (int) ((double) recipe.mDuration / 200D * (200D + (double) mat.getProtons())), recipe.mEUt, recipe.mSpecialValue));
+ break;
+ }
+ }
+ }
+ }
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.removeAll(base.get(GasTag));
+ }
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.addAll(toAdd);
+ }
+
private static void addElectricImplosionCompressorRecipes() {
if (eicMap == null) {
eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<GT_Recipe>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java
index f569d62abe..48f7a6d236 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java
@@ -35,7 +35,7 @@ public class SummonRuin extends CommandBase {
@Override
public String getCommandUsage(ICommandSender p_71518_1_) {
- return "SummonRuin x z";
+ return "SummonRuin <x> <z>";
}
@Override
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
index 704dc73c60..dd20bd3a85 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java
@@ -38,9 +38,7 @@ import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEnti
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;
-import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_Diode;
-import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_EnergyDistributor;
+import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.*;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.enums.GT_Values;
@@ -137,6 +135,8 @@ public class ItemRegistry {
public static ItemStack thtr;
public static ItemStack eic;
public static ItemStack cal;
+ public static ItemStack compressedHatch;
+ public static ItemStack giantOutputHatch;
public static void run() {
@@ -180,6 +180,8 @@ public class ItemRegistry {
ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L);
ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L);
ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L);
+ ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L);
+ ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L);
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java
new file mode 100644
index 0000000000..d4382eac7a
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java
@@ -0,0 +1,57 @@
+/*
+ * 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.common.tileentities.tiered;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
+import gregtech.api.util.GT_Utility;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Hatch_Input {
+ public GT_MetaTileEntity_CompressedFluidHatch(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 0);
+ this.mDescriptionArray[1] = "Capacity: 100000000L";
+ }
+
+ public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 100000000;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return GT_Utility.areFluidsEqual(aFluid, Materials.LiquidAir.getFluid(1));
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_CompressedFluidHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java
new file mode 100644
index 0000000000..887b93db54
--- /dev/null
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java
@@ -0,0 +1,49 @@
+/*
+ * 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.common.tileentities.tiered;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+
+public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_Output {
+
+ public GT_MetaTileEntity_GiantOutputHatch(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 0);
+ }
+
+ public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_GiantOutputHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures);
+ }
+
+ @Override
+ public int getCapacity() {
+ return 100000000;
+ }
+}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java
index b3e8417ceb..2990352776 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java
@@ -33,6 +33,7 @@ import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.items.GT_MetaGenerated_Item;
+import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
@@ -52,6 +53,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
+import net.minecraftforge.fluids.FluidContainerRegistry;
import java.util.List;
@@ -76,7 +78,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
for (int i = 0; i < this.aNumToGen; i++) {
ItemStack tStack = new ItemStack(this, 1, i);
Werkstoff w = werkstoffHashMap.get((short) i);
- if (w == null || ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0) || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) )
+ if (w == null || ((w.getGenerationFeatures().blacklist & orePrefixes.mMaterialGenerationBits) != 0) )
+ continue;
+ if ((w.getGenerationFeatures().toGenerate & orePrefixes.mMaterialGenerationBits) == 0 && orePrefixes.mMaterialGenerationBits != 0)
continue;
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(w));
GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip());
@@ -226,4 +230,9 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa
Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage());
return w.getDefaultName();
}
+
+ @Override
+ public int getCapacity(ItemStack aStack) {
+ return this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten ? 144 : 0;
+ }
}
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
index c8e755e3e4..86ddee4fbd 100644
--- 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
@@ -108,7 +108,7 @@ public class BW_Meta_Items {
}
public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){
- CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(tier-2),tier > 2 ? BW_Util.CLEANROOM : 0,(byte)tier), CircuitImprintLoader.getTagFromStack(new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID)));
+ CircuitImprintLoader.bwCircuitTagMap.put(new CircuitData(BW_Util.getMachineVoltageFromTier(Math.min(1,(tier-2))),tier > 2 ? BW_Util.CLEANROOM : 0,(byte)tier), new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,aID));
return this.addItem(aID, aEnglish, aToolTip,SubTag.NO_UNIFICATION);
}
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
index 999711e3fe..3ddadafffd 100644
--- 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
@@ -46,7 +46,7 @@ import java.util.Iterator;
public class CircuitImprintLoader implements Runnable {
public static final ArrayListMultimap<NBTTagCompound,GT_Recipe> recipeTagMap = ArrayListMultimap.create();
- static final HashBiMap<CircuitData,NBTTagCompound> bwCircuitTagMap = HashBiMap.create(20);
+ static final HashBiMap<CircuitData,ItemStack> bwCircuitTagMap = HashBiMap.create(20);
static final HashSet<NBTTagCompound> refs = new HashSet<>();
public static short reverseIDs = Short.MAX_VALUE-1;
public static HashBiMap<Short, ItemList> circuitIIconRefs = HashBiMap.create(20);
@@ -109,7 +109,7 @@ public class CircuitImprintLoader implements Runnable {
for (ItemStack is : newRecipe.mInputs){
int[] oreIDs = OreDictionary.getOreIDs(is);
if(oreIDs == null || oreIDs.length < 1 || !OreDictionary.getOreName(oreIDs[0]).contains("circuit")) {
- is.stackSize = Math.max(64, is.stackSize*4);
+ is.stackSize = 64;
}
}
newRecipe.mFluidInputs[0].amount *= 4;
@@ -191,20 +191,26 @@ public class CircuitImprintLoader implements Runnable {
'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1),
'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)});
}
-// for (NBTTagCompound tag : CircuitImprintLoader.bwCircuitTagMap.values()){
-// CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(tag);
-// ItemStack stack = CircuitImprintLoader.getStackFromTag(tag);
-// GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial());
-// GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe);
-// GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{
-// "DXD",
-// "GPG",
-// "DXD",
-// 'D', WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,1),
-// 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1),
-// 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1),
-// 'X', WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1)
-// });
-// }
+ for (ItemStack stack : CircuitImprintLoader.bwCircuitTagMap.values()){
+ NBTTagCompound tag = CircuitImprintLoader.getTagFromStack(stack);
+ CircuitData data = CircuitImprintLoader.bwCircuitTagMap.inverse().get(stack);
+ GT_Recipe slicingRecipe = new BWRecipes.DynamicGTRecipe(true,new ItemStack[]{stack,ItemList.Shape_Slicer_Flat.get(0)},new ItemStack[]{BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1)},null,null,null,null,300, Math.toIntExact(data.getaVoltage()),data.getaSpecial());
+ GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe);
+ GameRegistry.addRecipe(new BWRecipes.BWNBTDependantCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),
+ " X ",
+ "GPG",
+ " X ",
+ 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1),
+ 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1),
+ 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)));
+ GT_ModHandler.addCraftingRecipe(BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1),GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS ,new Object[]{
+ " X ",
+ "GPG",
+ " X ",
+ 'P', BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,1,1),
+ 'G', WerkstoffLoader.Prasiolite.get(OrePrefixes.gemExquisite,1),
+ 'X', BW_Meta_Items.getNEWCIRCUITS().getStack(3)
+ });
+ }
}
} \ No newline at end of file
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 dbb42d004d..64822f25fe 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
@@ -33,6 +33,7 @@ import gregtech.api.objects.GT_Fluid;
import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
import java.nio.ByteBuffer;
import java.util.*;
@@ -53,8 +54,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
private byte[] rgb = new byte[3];
private final String defaultName;
private String toolTip;
- private Fluid fluid;
- private Fluid gas;
private Werkstoff.Stats stats;
private final Werkstoff.Types type;
@@ -99,7 +98,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
type = Werkstoff.Types.UNDEFINED;
this.defaultName = defaultName;
-
+ this.stats = stats;
this.type = type;
this.mID = (short) mID;
this.generationFeatures = generationFeatures;
@@ -132,32 +131,30 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
} else
this.toolTip = toolTip;
- long tmpprotons = 0;
- for (Pair<ISubTagContainer, Integer> p : contents) {
- if (p.getKey() instanceof Materials) {
- tmpprotons += ((Materials) p.getKey()).getProtons() * p.getValue();
- } else if (p.getKey() instanceof Werkstoff) {
- tmpprotons += ((Werkstoff) p.getKey()).getStats().protons * p.getValue();
+ if (this.stats.protons == 0) {
+ long tmpprotons = 0;
+ for (Pair<ISubTagContainer, Integer> p : contents) {
+ if (p.getKey() instanceof Materials) {
+ tmpprotons += ((Materials) p.getKey()).getProtons() * p.getValue();
+ } else if (p.getKey() instanceof Werkstoff) {
+ tmpprotons += ((Werkstoff) p.getKey()).getStats().protons * p.getValue();
+ }
}
+ this.stats = stats.setProtons(tmpprotons);
}
- this.stats = stats.setProtons(tmpprotons);
-
- long tmpmass = 0;
- for (Pair<ISubTagContainer, Integer> p : contents) {
- if (p.getKey() instanceof Materials) {
- tmpmass += ((Materials) p.getKey()).getMass() * p.getValue();
- } else if (p.getKey() instanceof Werkstoff) {
- tmpprotons += ((Werkstoff) p.getKey()).getStats().mass * p.getValue();
+ if (this.stats.mass == 0) {
+ long tmpmass = 0;
+ for (Pair<ISubTagContainer, Integer> p : contents) {
+ if (p.getKey() instanceof Materials) {
+ tmpmass += ((Materials) p.getKey()).getMass() * p.getValue();