diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-08-19 22:43:54 +0200 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-08-19 22:43:54 +0200 |
commit | cf932b2cfd44f3ae0df11259f37bb3f3e7891bf2 (patch) | |
tree | 944e1d2877dc67ac43a4c14576a6dd805c30901a | |
parent | 4c6858c45f178ff2aa0cb5a74947e90fa5540ca9 (diff) | |
download | GT5-Unofficial-cf932b2cfd44f3ae0df11259f37bb3f3e7891bf2.tar.gz GT5-Unofficial-cf932b2cfd44f3ae0df11259f37bb3f3e7891bf2.tar.bz2 GT5-Unofficial-cf932b2cfd44f3ae0df11259f37bb3f3e7891bf2.zip |
added Noble Gasses
+fixed fluid generation system
+fixed UnificationEnforcer
+added MoltenCells
+added NobleGas EBF Recipes
+added Replicator/Scanner Recipes
+started working on Giant Hatches
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Former-commit-id: 8a5a261297188387671ce994e3cc02f81eedb7ff
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(); + } else if (p.getKey() instanceof Werkstoff) { + tmpmass += ((Werkstoff) p.getKey()).getStats().mass * p.getValue(); + } } + this.stats = stats.setMass(tmpmass); } - this.stats = stats.setMass(tmpmass); - this.texSet = texSet; - if (this.getStats().meltingPoint > 0 && !this.getStats().isGas()) { - this.fluid = new GT_Fluid("molten" + this.getDefaultName().replaceAll(" ", ""), "molten.autogenerated", this.getRGBA()); - this.getGenerationFeatures().toGenerate |= 16; - } if (this.getGenerationFeatures().enforceUnification) { for (OrePrefixes prefix : OrePrefixes.values()) BWUnificationEnforcer.addUnificationTarget(prefix+this.getDefaultName()); @@ -310,12 +307,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this); } + public FluidStack getFluidOrGas(int fluidAmount) { + return new FluidStack(WerkstoffLoader.fluids.get(this),fluidAmount); + } + public FluidStack getMolten(int fluidAmount) { + return new FluidStack(WerkstoffLoader.molten.get(this),fluidAmount); + } + + public ItemStack get(OrePrefixes prefixes, int amount) { return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount); } public enum Types { - MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, UNDEFINED; + MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) { switch (T) { @@ -338,8 +343,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { gem 100 ore 1000 cell 10000 + plasma 100000 + molten 1000000 */ public byte toGenerate = 0b0001001; + + //public byte toGenerateSecondary = 0b0000000; public byte blacklist; public boolean enforceUnification; @@ -435,6 +444,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public boolean hasMolten() { + return (this.toGenerate & 0b1000000) != 0; + } + + public Werkstoff.GenerationFeatures addMolten() { + this.toGenerate = (byte) (this.toGenerate | 0b1000000); + return this; + } + public Werkstoff.GenerationFeatures addGems() { this.toGenerate = (byte) (this.toGenerate | 0x4); return this; @@ -457,6 +475,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return this; } + public long getMass() { + return this.mass; + } + + public long getProtons() { + return this.protons; + } + public int getMeltingPoint() { return this.meltingPoint; } @@ -511,7 +537,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setMass(long mass) { - this.mass = this.protons; + this.mass = mass; return this; } @@ -521,7 +547,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isSublimation() { - return (this.quality & 0b1) == 0b1; + return (this.quality & 0b1) != 0; } public Werkstoff.Stats setSublimation(boolean sublimation) { @@ -533,7 +559,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isToxic() { - return (this.quality >> 1 & 0b1) == 0b1; + return (this.quality & 0b10) != 0; } public Werkstoff.Stats setToxic(boolean toxic) { @@ -545,7 +571,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isRadioactive() { - return (this.quality >> 2 & 0b1) == 0b1; + return (this.quality & 0b100) != 0; } public Werkstoff.Stats setRadioactive(boolean radioactive) { @@ -557,7 +583,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isBlastFurnace() { - return (this.quality >> 3 & 0b1) == 0b1; + return (this.quality & 0b1000) != 0; } public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { @@ -569,7 +595,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isElektrolysis() { - return (this.quality >> 4 & 0b1) == 0b1; + return (this.quality & 0x10) != 0; } public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { @@ -581,7 +607,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isCentrifuge() { - return (this.quality >> 5 & 0b1) == 0b1; + return (this.quality & 0x20) != 0; } public Werkstoff.Stats setCentrifuge(boolean centrifuge) { @@ -593,7 +619,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public boolean isGas() { - return (this.quality >> 6 & 0b1) == 0b1; + return (this.quality & 0x40) != 0; } public Werkstoff.Stats setGas(boolean gas) { 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 4fcf361c9d..2b19c6a4c4 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 @@ -27,10 +27,11 @@ import com.github.bartimaeusnek.bartworks.MainMod; 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.material.processingLoaders.AdditionalRecipes; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -46,10 +47,8 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.objects.GT_Fluid; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.*; +import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; @@ -57,10 +56,14 @@ import ic2.api.recipe.Recipes; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import java.lang.reflect.Field; import java.util.*; import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; @@ -72,7 +75,23 @@ public class WerkstoffLoader implements Runnable { private WerkstoffLoader() {} public static final WerkstoffLoader INSTANCE = new WerkstoffLoader(); + public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); + public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); + public static final SubTag ANAEROBE_SMELTING = SubTag.getNewSubTag("AnaerobeSmelting"); + public static OrePrefixes cellMolten; + static { + for (OrePrefixes prefix : OrePrefixes.values()){ + if (prefix.toString().equals("cellMolten")) + WerkstoffLoader.cellMolten = prefix; + } + if (WerkstoffLoader.cellMolten == null) { + WerkstoffLoader.cellMolten = EnumHelper.addEnum(OrePrefixes.class,"cellMolten",new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class},new Object[]{"Cells of Molten stuff", "Molten ", " Cell", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, 31}); + // GT_LanguageManager.addStringLocalization(".name", this.getDefaultLocalization(w)); + } else { + WerkstoffLoader.cellMolten.mMaterialGenerationBits = 0b1000000; + } + } //TODO: FREE ID RANGE: 19-32766 public static final Werkstoff Bismutite = new Werkstoff( @@ -461,7 +480,7 @@ public class WerkstoffLoader implements Runnable { "Thorium 232", superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), - Werkstoff.Types.ELEMENT, + Werkstoff.Types.ISOTOPE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 30, TextureSet.SET_METALLIC @@ -536,7 +555,7 @@ public class WerkstoffLoader implements Runnable { "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes(), + new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes().addGems(), 36, TextureSet.SET_MAGNETIC, //No Byproducts @@ -545,21 +564,83 @@ public class WerkstoffLoader implements Runnable { new Pair<>(WerkstoffLoader.CubicZirconia,1), new Pair<>(Materials.SteelMagnetic,1) ); -// public static final Werkstoff Xenon = new Werkstoff( -// new short[]{0x14,0x39,0x7F,0}, -// "Xenon", -// "Xe", -// new Werkstoff.Stats().setProtons(54).setGas(true), -// Werkstoff.Types.ELEMENT, -// new Werkstoff.GenerationFeatures().disable().addCells(), -// 37, -// TextureSet.SET_FLUID -// //No Byproducts -// //No Ingridients -// ); + public static final Werkstoff Xenon = new Werkstoff( + new short[]{0x14,0x39,0x7F,0}, + "Xenon", + "Xe", + new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), + 37, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Oganesson = new Werkstoff( + new short[]{0x14,0x39,0x7F,0}, + "Oganesson", + "Og", + new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells(), + 38, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Californium = new Werkstoff( + new short[]{0xAA,0xAA,0xAA,0}, + "Californium", + "Cf", + new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + 39, + TextureSet.SET_METALLIC + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Calcium = new Werkstoff( + Materials.Calcium.mRGBa, + "Calcium", + "Ca", + new Werkstoff.Stats().setProtons(Element.Ca.mProtons).setMass(Element.Ca.getMass()).setBlastFurnace(true).setMeltingPoint(1115).setBoilingPoint(1757), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten(), + 40, + Materials.Calcium.mIconSet + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Neon = new Werkstoff( + new short[]{0xff,0x07,0x3a}, + "Neon", + "Ne", + new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), + 41, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static final Werkstoff Krypton = new Werkstoff( + new short[]{0xb1,0xff,0x32}, + "Krypton", + "Kr", + new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), + Werkstoff.Types.ELEMENT, + new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), + 42, + TextureSet.SET_FLUID + //No Byproducts + //No Ingredients + ); + public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>(); - public static HashMap<Werkstoff, GT_Fluid> fluids = new HashMap<>(); + public static HashMap<Werkstoff, Fluid> fluids = new HashMap<>(); + public static HashMap<Werkstoff, Fluid> molten = new HashMap<>(); public static Block BWOres; public boolean registered; @@ -568,9 +649,11 @@ public class WerkstoffLoader implements Runnable { } public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { - ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(),orePrefixes,amount); + if (!werkstoff.getGenerationFeatures().enforceUnification) { + ItemStack ret = OreDictHandler.getItemStack(werkstoff.getDefaultName(), orePrefixes, amount); if (ret != null) return ret; + } if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); @@ -617,6 +700,10 @@ public class WerkstoffLoader implements Runnable { this.addOreRecipes(werkstoff); DebugLog.log("Loading Crushed Recipes"+" " +(System.nanoTime()-timepreone)); this.addCrushedRecipes(werkstoff); + DebugLog.log("Loading Cell Recipes"+" " +(System.nanoTime()-timepreone)); + this.addCellRecipes(werkstoff); + DebugLog.log("Loading Meltdown Recipes"+" " +(System.nanoTime()-timepreone)); + this.addMoltenRecipes(werkstoff); if (Loader.isModLoaded("Thaumcraft")) { DebugLog.log("Loading Aspects"+" " +(System.nanoTime()-timepreone)); ThaumcraftHandler.AspectAdder.addAspectToAll(werkstoff); @@ -636,6 +723,21 @@ public class WerkstoffLoader implements Runnable { } private void addSubTags() { + + WerkstoffLoader.Krypton.add(WerkstoffLoader.NOBLE_GAS); + WerkstoffLoader.Xenon.add(WerkstoffLoader.NOBLE_GAS); + WerkstoffLoader.Neon.add(WerkstoffLoader.NOBLE_GAS); + Materials.Helium.add(WerkstoffLoader.NOBLE_GAS); + + Materials.Argon.add(WerkstoffLoader.NOBLE_GAS); + + WerkstoffLoader.Oganesson.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + Materials.Radon.add(WerkstoffLoader.NOBLE_GAS,WerkstoffLoader.ANAEROBE_GAS); + + Materials.Nitrogen.add(WerkstoffLoader.ANAEROBE_GAS); + + WerkstoffLoader.Calcium.add(WerkstoffLoader.ANAEROBE_SMELTING); + for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) { for (Pair<ISubTagContainer, Integer> pair : W.getContents().getValue().toArray(new Pair[0])) { @@ -660,9 +762,29 @@ public class WerkstoffLoader implements Runnable { public static int toGenerateGlobal; private void addItemsForGeneration() { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { - if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0 && FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())){ - DebugLog.log("Adding new Fluid: "+werkstoff.getDefaultName()); - WerkstoffLoader.fluids.put(werkstoff, (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(),"molten.autogenerated",werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas())); + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) != 0){ + if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { + DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); + GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); + FluidRegistry.registerFluid(fluid); + WerkstoffLoader.fluids.put(werkstoff, fluid); + } else { + WerkstoffLoader.fluids.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); + } + } + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) != 0){ + if (!FluidRegistry.isFluidRegistered("molten."+werkstoff.getDefaultName())) { + DebugLog.log("Adding new Molten: " + werkstoff.getDefaultName()); + Fluid fluid = new GT_Fluid("molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); + if (werkstoff.getStats().meltingPoint > 0) + fluid = fluid.setTemperature(werkstoff.getStats().meltingPoint); + FluidRegistry.registerFluid(fluid); + //GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName()); + GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten "+ werkstoff.getDefaultName()); + WerkstoffLoader.molten.put(werkstoff, fluid); + } else { + WerkstoffLoader.molten.put(werkstoff, FluidRegistry.getFluid(werkstoff.getDefaultName())); + } } for (OrePrefixes p : values()) if (!werkstoff.getGenerationFeatures().enforceUnification && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(),p,1) != null) { @@ -672,7 +794,7 @@ public class WerkstoffLoader implements Runnable { WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); //System.out.println(werkstoff.getDefaultName()+": "+werkstoff.getGenerationFeatures().toGenerate); } - + DebugLog.log("GlobalGeneration: "+WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { WerkstoffLoader.items.put(dust, new BW_MetaGenerated_Items(dust)); WerkstoffLoader.items.put(dustTiny, new BW_MetaGenerated_Items(dustTiny)); @@ -701,14 +823,19 @@ public class WerkstoffLoader implements Runnable { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); - // WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - // WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); + //WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100000) != 0) { WerkstoffLoader.items.put(cellPlasma, new BW_MetaGenerated_Items(cellPlasma)); } + if ((WerkstoffLoader.toGenerateGlobal & 0b1000000) != 0) { + WerkstoffLoader.items.put(cellMolten, new BW_MetaGenerated_Items(cellMolten)); + } } + + public void gameRegistryHandler(){ if (FMLCommonHandler.instance().getSide().isClient()) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); @@ -767,14 +894,14 @@ public class WerkstoffLoader implements Runnable { if (werkstoff.getGenerationFeatures().hasSifterRecipes() || ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0)) { GT_Values.RA.addSifterRecipe( - WerkstoffLoader.getCorrespondingItemStack(crushedPurified, werkstoff), + werkstoff.get(crushedPurified), new ItemStack[]{ - WerkstoffLoader.getCorrespondingItemStack(gemExquisite, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gemFlawless, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gem, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gemFlawed, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(gemChipped, werkstoff), - WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) + werkstoff.get(gemExquisite), + werkstoff.get(gemFlawless), + werkstoff.get(gem), + werkstoff.get(gemFlawed), + werkstoff.get(gemChipped), + werkstoff.get(dust) }, new int[]{ 200, 1000, 2500, 2000, 4000, 5000 @@ -828,7 +955,6 @@ public class WerkstoffLoader implements Runnable { private void addDustRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0) { - List<FluidStack> flOutputs = new ArrayList<>(); List<ItemStack> stOutputs = new ArrayList<>(); HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>(); @@ -876,7 +1002,7 @@ public class WerkstoffLoader implements Runnable { } } } - ItemStack input = WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff); + ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.addRecipe(true, new ItemStack[]{input, cells > 0 ? Materials.Empty.getCells(cells) : null}, stOutputs.toArray(new ItemStack[0]), null, null, new FluidStack[]{null}, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, (int) Math.max(1L, Math.abs(werkstoff.getStats().protons * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); @@ -894,35 +1020,80 @@ public class WerkstoffLoader implements Runnable { } } - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ "TTT","TTT","TTT",'T', - WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff) + werkstoff.get(dustTiny) }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), new Object[]{ + GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ "TT ","TT ",'T', WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff) }); GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustSmall, werkstoff, 4), new Object[]{ - " T ", 'T', WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) + " T ", 'T', werkstoff.get(dust) }); GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff) + "T ", 'T', werkstoff.get(dust) }); if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && !werkstoff.getStats().isBlastFurnace()) { - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(dust, werkstoff), WerkstoffLoader.getCorrespondingItemStack(ingot, werkstoff)); - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff), WerkstoffLoader.getCorrespondingItemStack(nugget, werkstoff)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); + GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); + } + else if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().meltingPoint != 0){ + if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)){ + GT_Values.RA.addBlastRecipe(werkstoff.get(dust),GT_Utility.getIntegratedCircuit(11),Materials.Nitrogen.getGas(1000),null,werkstoff.get(ingot),null,(int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + } + else { + GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint, 120, werkstoff.getStats().getMeltingPoint()); + if (werkstoff.getStats().meltingPoint <= 1000) { + GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().meltingPoint); + GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().meltingPoint); + } + } } if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0){ GT_ModHandler.addPulverisationRecipe(werkstoff.get(ingot),werkstoff.get(dust)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(nugget),werkstoff.get(dustTiny)); } + + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + Materials werkstoffBridgeMaterial = null; + boolean ElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals(werkstoff.getToolTip())){ + if (e.mLinkedMaterials.size() > 0) + break; + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + ElementSet = true; + break; + } + } + if (!ElementSet) + return; + + GT_OreDictUnificator.addAssociation(dust,werkstoffBridgeMaterial, werkstoff.get(dust),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(dust)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null,new ItemStack[]{werkstoff.get(dust)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + } } } private void addOreRecipes(Werkstoff werkstoff) { if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0 && (werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0 &&!werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), WerkstoffLoader.getCorrespondingItemStack(ingot, werkstoff)); + GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000) != 0) { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.getGenerationFeatures().hasGems() ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); @@ -994,4 +1165,67 @@ public class WerkstoffLoader implements Runnable { GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Neodymium, 1L), GT_OreDictUnificator.get(nugget, Materials.Neodymium, 1L), new int[]{10000, 4000, 2000}, 400, 24); } + private void addCellRecipes(Werkstoff werkstoff){ + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10000) == 0) + return; + + //Tank "Recipe" + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1))); + + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000)); + + if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { + Materials werkstoffBridgeMaterial = null; + boolean ElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals(werkstoff.getToolTip())){ + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + ElementSet = true; + break; + } + } + if (!ElementSet) + return; + + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput,werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + } + } + private void addMoltenRecipes(Werkstoff werkstoff) { + if ((werkstoff.getGenerationFeatures().toGenerate & 0b1000000) == 0) + return; + + //Tank "Recipe" + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.molten.get(werkstoff), 144),werkstoff.get(cellMolten),Materials.Empty.getCells(1)); + GT_Utility.addFluidContainerData(data); + GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cellMolten), new FluidStack(molten.get(werkstoff),144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(molten.get(werkstoff),144)); + + if ((werkstoff.getGenerationFeatures().toGenerate & 0b10) != 0) { + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate),null,werkstoff.getMolten(144),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick),null,werkstoff.getMolten(72),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget),null,werkstoff.getMolten(16),0,werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), werkstoff.getStats().getMass() > 128 ? 64 : 30, (int) werkstoff.getStats().mass); + } + } }
\ No newline at end of file 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 7678e69faa..fc6964875c 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 @@ -23,18 +23,26 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_CircuitsLoader; +import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; +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.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; +import com.github.bartimaeusnek.bartworks.util.BWRecipes; 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.enums.*; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_DataOrb; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import java.lang.reflect.Field; +import java.util.Map; + +import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; import static gregtech.api.enums.OrePrefixes.*; public class AdditionalRecipes implements Runnable { @@ -68,5 +76,61 @@ public class AdditionalRecipes implements Runnable { 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); - } + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium.getMolten(16), Materials.Beryllium.getMolten(16), WerkstoffLoader.Californium.getMolten(16), 250,49152, 480000000); + GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), WerkstoffLoader.Calcium.getMolten(16), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500,49152, 600000000); + GT_Values.RA.addDistillationTowerRecipe(Materials.LiquidAir.getFluid(100000000),new FluidStack[]{Materials.Nitrogen.getGas(78084000),Materials.Oxygen.getGas(20946000),Materials.Argon.getGas(934000),Materials.CarbonDioxide.getGas(40700),WerkstoffLoader.Neon.getFluidOrGas(1818),Materials.Helium.getGas(524),Materials.Methane.getGas(180),WerkstoffLoader.Krypton.getFluidOrGas(114),Materials.Hydrogen.getGas(55)},null,7500,BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Neon.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gemChipped,9),9000,4500,BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addAutoclaveRecipe(WerkstoffLoader.MagnetoResonaticDust.get(dust),WerkstoffLoader.Krypton.getFluidOrGas(1000),WerkstoffLoader.MagnetoResonaticDust.get(gem),10000,4500,BW_Util.getMachineVoltageFromTier(5)); + + + for (int i = 0; i < 11; i++) { + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( + new BWRecipes.DynamicGTRecipe(false, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + BW_Meta_Items.getNEWCIRCUITS().getStack(i+3), + ItemList.Circuit_Parts_DiodeSMD.get((i+1)*4), + ItemList.Circuit_Parts_CapacitorSMD.get((i+1)*4), + ItemList.Circuit_Parts_TransistorSMD.get((i+1)*4) + }, + new ItemStack[]{ + BW_Meta_Items.getNEWCIRCUITS().getStack(i+4) + },null,null, + new FluidStack[]{ + Materials.SolderingAlloy.getMolten((i+1)*36) + },null,(i+1)*750,BW_Util.getMachineVoltageFromTier((i+1)),CLEANROOM)); + } + + //manual override for older GT + Werkstoff werkstoff = WerkstoffLoader.Oganesson; + Materials werkstoffBridgeMaterial = null; + boolean aElementSet = false; + for (Element e : Element.values()){ + if (e.toString().equals("Uuo")){ + werkstoffBridgeMaterial = new Materials(-1,werkstoff.getTexSet(),0,0,0,false,werkstoff.getDefaultName(),werkstoff.getDefaultName()); + werkstoffBridgeMaterial.mElement = e; + e.mLinkedMaterials.add(werkstoffBridgeMaterial); + aElementSet = true; + break; + } + } + if (!aElementSet) + return; + + GT_OreDictUnificator.addAssociation(cell,werkstoffBridgeMaterial, werkstoff.get(cell),true); + try { + Field f = Materials.class.getDeclaredField("MATERIALS_MAP"); + f.setAccessible(true); + Map<String, Materials> MATERIALS_MAP = (Map<String, Materials>) f.get(null); + MATERIALS_MAP.remove(werkstoffBridgeMaterial.mName); + } catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) { + e.printStackTrace(); + } + ItemStack scannerOutput = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(scannerOutput,"Elemental-Scan"); + Behaviour_DataOrb.setDataName(scannerOutput, werkstoff.getToolTip()); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass()* 8192L),32,0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{Materials.Empty.getCells(1)} ,new ItemStack[]{werkstoff.get(cell)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L),32,0)); + } }
\ No newline at end of file |