diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-09-09 21:34:08 +0200 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2020-09-09 21:34:08 +0200 |
commit | 18e2960ea363a8b947e93fc3eb54fe6eb6a1d731 (patch) | |
tree | 6cb1f69b522e8baabc69e1c802afaf969b94616f /src | |
parent | 5becd672c34d536807e4509ee1e598c7ff2b8d79 (diff) | |
download | GT5-Unofficial-18e2960ea363a8b947e93fc3eb54fe6eb6a1d731.tar.gz GT5-Unofficial-18e2960ea363a8b947e93fc3eb54fe6eb6a1d731.tar.bz2 GT5-Unofficial-18e2960ea363a8b947e93fc3eb54fe6eb6a1d731.zip |
Renamed Casings
+ added GT++ warning
+ updated TT
+ fixed forestry capsules
+ fixed eic
Former-commit-id: 319fc8b86aaf8d6c07954f0f3b56119c10f10cb3
Diffstat (limited to 'src')
7 files changed, 152 insertions, 64 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index e2ad0b6416..6ba2dec96d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -47,6 +47,8 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; @@ -63,7 +65,7 @@ import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader. import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; import static gregtech.api.enums.GT_Values.VN; -@SuppressWarnings("unused") +@SuppressWarnings("ALL") @Mod( modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, dependencies = "required-after:IC2; " @@ -89,8 +91,15 @@ public final class MainMod { public static MainMod instance; public static BW_Network BW_Network_instance = new BW_Network(); + @SideOnly(Side.CLIENT) + private void ClientGTppWarning() { + javax.swing.JOptionPane.showMessageDialog(null, + "BartWorks was NOT meant to be played with GT++," + + " since GT++'s Multiblocks break the Platinum Processing chain. " + + "Feel free to continue, but be aware of this.","GT++ Warning", javax.swing.JOptionPane.ERROR_MESSAGE); + } + @Mod.EventHandler - @SuppressWarnings("ALL") public void preInit(FMLPreInitializationEvent preinit) { if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { @@ -99,6 +108,15 @@ public final class MainMod { LoaderReference.init(); //Check for ALL the mods. + if (LoaderReference.miscutils) { + if (SideReference.Side.Client) + ClientGTppWarning(); + + MainMod.LOGGER.error("BartWorks was NOT meant to be played with GT++," + + " since GT++'s Multiblocks break the Platinum Processing chain. " + + "Feel free to continue, but be aware of this."); + } + if (LoaderReference.miscutils && ConfigHandler.GTppLogDisabler) { STFUGTPPLOG.replaceLogger(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 8eac4a7f09..0502a4a82e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -43,7 +43,7 @@ import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_ImplosionCompressor { public static GT_Recipe.GT_Recipe_Map eicMap; - private boolean piston; + private Boolean piston = null; public GT_TileEntity_ElectricImplosionCompressor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -109,7 +109,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - this.piston = true; + if (this.piston == null) + this.piston = true; } private void resetPiston() { @@ -148,8 +149,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } } - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - this.piston = !this.piston; } else { for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { @@ -157,9 +156,9 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.getBaseMetaTileEntity().getWorld().setBlock(xDir + aX + x, aY + 2, zDir + aZ + z, GregTech_API.sBlockMetal5, 2, 3); } } - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); - this.piston = !this.piston; } + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(5), 10, 1.0F, aX, aY, aZ); + this.piston = !this.piston; if (hax) this.explodeMultiblock(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java index a688664efd..c1fa1fbc85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing.java @@ -1,6 +1,6 @@ package com.github.bartimaeusnek.bartworks.system.material; -import com.github.technus.tectech.mechanics.structure.ICustomMetaBlock; +import com.github.technus.tectech.mechanics.structure.ICustomBlockSetting; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; @@ -17,8 +17,8 @@ import net.minecraft.world.World; import java.util.List; import java.util.Optional; -@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomMetaBlock") -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomMetaBlock { +@cpw.mods.fml.common.Optional.Interface(modid = "tectech", striprefs = true, iface = "com.github.technus.tectech.mechanics.structure.ICustomBlockSetting") +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements ICustomBlockSetting { public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName, OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); @@ -51,16 +51,12 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); - } + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { - if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { - GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); - } + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @Override @@ -89,12 +85,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { Werkstoff.werkstoffHashSet.stream() - .filter(pMaterial -> - pMaterial != null - && ( - pMaterial.hasItemType(OrePrefixes.plate) && pMaterial.hasItemType(OrePrefixes.screw) && pMaterial.hasItemType(OrePrefixes.plateDouble) - ) - ) + .filter(pMaterial -> (pMaterial.hasItemType(WerkstoffLoader.blockCasing))) .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index d9d4ac7dbe..8838d9dc3d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -40,14 +40,18 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; +import java.util.HashSet; import java.util.List; +import java.util.Set; import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; public class BWGTMetaItems extends BW_MetaGenerated_Items { private boolean hasList; + private final Set<Integer> hiddenThings = new HashSet<>(); public BWGTMetaItems(OrePrefixes orePrefixes, List<Materials> noSubIDMaterials) { super(orePrefixes,null); @@ -60,10 +64,16 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) continue materialloop; + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + hiddenThings.add(i); + continue; + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } + if (noSubIDMaterials != null){ hasList = true; materialloop: @@ -75,9 +85,13 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) continue materialloop; + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + hiddenThings.add(i); + continue; + } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".name", getDefaultLocalization(w)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(tStack) + ".tooltip", w.getToolTip()); - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); } } } @@ -116,6 +130,8 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + else if (hiddenThings.contains(i)) + continue; aList.add(new ItemStack(this, 1, i)); } if (hasList) @@ -125,6 +141,8 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { continue; else if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + else if (hiddenThings.contains(i)) + continue; aList.add(new ItemStack(this, 1, i + 1001)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index fe66b74c40..75a2846172 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.API.LoaderReference; -import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -36,6 +35,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; import java.util.List; import java.util.stream.Collectors; @@ -52,48 +52,53 @@ public class GTMetaItemEnhancer { Materials[] values = Materials.values(); for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { Materials m = values[i]; - if (m != null && m.mStandardMoltenFluid != null) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), new ItemStack(moltenCell, 1, i), m.getMolten(144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Values.NF, m.getMolten(144)); - } + if (m == null || m.mStandardMoltenFluid == null) + continue; + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), new ItemStack(moltenCell, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L), GT_Values.NF, m.getMolten(144)); } } - if (LoaderReference.Forestry) { - NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); - Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); - Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); - //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); + if (!LoaderReference.Forestry) { + return; + } + NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); + Item moltenCapsuls = new BWGTMetaItems(WerkstoffLoader.capsuleMolten, null); + Item capsuls = new BWGTMetaItems(OrePrefixes.capsule, NoMetaValue); + //Item bottles = new BWGTMetaItems(OrePrefixes.bottle, NoMetaValue); - Materials[] values = Materials.values(); - for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { - Materials m = values[i]; - if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); - } - if (m.getFluid(1) != null || m.getGas(1) != null) { - addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i,true); - // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i,false); - } - } - for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { - Materials m = NoMetaValue.get(i); - if (m.getFluid(1) != null || m.getGas(1) != null) { - addFluidData(m,GT_ModHandler.getModItem("Forestry", "waxCapsule", 1),capsuls,1000,i + 1001,true); - // addFluidData(m,new ItemStack(Items.glass_bottle),bottles,250,i + 1001,false); - } + Materials[] values = Materials.values(); + for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { + Materials m = values[i]; + if (m.mStandardMoltenFluid != null && GT_OreDictUnificator.get(WerkstoffLoader.cellMolten, m, 1) != null) { + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCapsuls, 1, i), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer(emptyData); + GT_Utility.addFluidContainerData(emptyData); + GT_Values.RA.addFluidCannerRecipe(GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1), new ItemStack(moltenCapsuls, 1, i), m.getMolten(144), GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe(new ItemStack(moltenCapsuls, 1, i), GT_Values.NI, GT_Values.NF, m.getMolten(144)); } - + if (m.getFluid(1) == null && m.getGas(1) == null) + continue; + if (OreDictionary.doesOreNameExist("capsule"+m.mName)) + continue; + addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i, true); + // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i, false); } + for (int i = 0, valuesLength = NoMetaValue.size(); i < valuesLength; i++) { + Materials m = NoMetaValue.get(i); + if (m.getFluid(1) == null && m.getGas(1) == null) + continue; + if (OreDictionary.doesOreNameExist("capsule"+m.mName)) + continue; + addFluidData(m, GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), capsuls, 1000, i + 1001, true); + // addFluidData(m, new ItemStack(Items.glass_bottle), bottles, 250, i + 1001, false); + } + } - private static void addFluidData(Materials m, ItemStack container, Item filled,int amount, int it, boolean empty){ + private static void addFluidData(Materials m, ItemStack container, Item filled, int amount, int it, boolean empty){ Fluid f = m.getFluid(1) != null ? m.getFluid(1).getFluid() : m.getGas(1).getFluid(); final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(f, amount), new ItemStack(filled, 1, it), container); FluidContainerRegistry.registerFluidContainer(emptyData); @@ -102,4 +107,24 @@ public class GTMetaItemEnhancer { GT_Values.RA.addFluidCannerRecipe(new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, GT_Values.NF, new FluidStack(f, amount)); } + public static void addAdditionalOreDictToForestry(){ + if (!LoaderReference.Forestry) + return; + OreDictionary.registerOre("capsuleWater", getForestryItem("waxCapsuleWater")); + OreDictionary.registerOre("capsuleIce", getForestryItem("waxCapsuleIce")); + OreDictionary.registerOre("capsuleHoney", getForestryItem("waxCapsuleHoney")); + OreDictionary.registerOre("capsuleJuice", getForestryItem("waxCapsuleJuice")); + OreDictionary.registerOre("capsuleSeedOil", getForestryItem("waxCapsuleSeedOil")); + OreDictionary.registerOre("capsuleEthanol", getForestryItem("waxCapsuleEthanol")); + OreDictionary.registerOre("capsuleBiomass", getForestryItem("waxCapsuleBiomass")); + OreDictionary.registerOre("capsuleShortMead", getForestryItem("waxCapsuleShortMead")); + OreDictionary.registerOre("capsuleMead", getForestryItem("waxCapsuleMead")); + OreDictionary.registerOre("capsuleFuel", getForestryItem("waxCapsuleFuel")); + OreDictionary.registerOre("capsuleOil", getForestryItem("waxCapsuleOil")); + OreDictionary.registerOre("capsuleLava", getForestryItem("refractoryLava")); + } + + private static ItemStack getForestryItem(String itemName){ + return GT_ModHandler.getModItem("Forestry", itemName, 1); + } } 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 bf744178d9..5c5698afdc 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 @@ -34,6 +34,7 @@ import net.minecraftforge.fluids.FluidStack; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; +import java.util.stream.Collectors; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -75,6 +76,41 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { Werkstoff.default_null_Werkstoff = new Werkstoff(new short[3], "_NULL", "Default null Werkstoff", Werkstoff.DEFAULT_NULL_STATS, Werkstoff.Types.UNDEFINED, Werkstoff.DEFAULT_NULL_GENERATION_FEATURES, -1, TextureSet.SET_NONE); } + public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID){ + this( materials.mRGBa, + materials.getToolTip(), + materials.mDefaultLocalName, + type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, + generationFeatures, + mID, + materials.mIconSet, + (List) materials.mOreByProducts, + materials.mMaterialList + .stream() + .map(ml -> new Pair<ISubTagContainer, Integer>(ml.mMaterial, (int) ml.mAmount)) + .collect(Collectors.toList()) + .<Pair<ISubTagContainer, Integer>>toArray(new Pair[0]) + ); + this.stats.mass = materials.getMass(); + this.stats.protons = materials.getProtons(); + this.stats.meltingPoint = materials.mMeltingPoint; + this.stats.neutrons = materials.getNeutrons(); + this.stats.speedOverride = materials.mToolSpeed; + this.stats.durOverride = materials.mDurability; + this.stats.qualityOverride = materials.mToolQuality; + this.stats.setGas(materials.mHasGas); + this.stats.setRadioactive(materials.isRadioactive()); + this.stats.setBlastFurnace(materials.mBlastFurnaceRequired); + if (type == Types.COMPOUND){ + this.stats.setElektrolysis(type == Types.COMPOUND); + this.generationFeatures.addChemicalRecipes(); + } + else if (type == Types.MIXTURE) { + this.stats.setCentrifuge(type == Types.MIXTURE); + this.generationFeatures.addMixerRecipes(); + } + } + public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, contents); } 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 6065c78a5a..07bef2bcf1 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 @@ -78,7 +78,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers; import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers; import static gregtech.api.enums.OrePrefixes.*; -@SuppressWarnings({"unchecked", "unused", "deprecation"}) +@SuppressWarnings({"unchecked", "deprecation"}) public class WerkstoffLoader { private WerkstoffLoader() { } @@ -148,7 +148,7 @@ public class WerkstoffLoader { Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); blockCasing = EnumUtils.addNewOrePrefix("blockCasing", "A Casing block for a Multiblock-Machine", - "", " Casing", + "Bolted ", " Casing", true, true, true, @@ -165,7 +165,7 @@ public class WerkstoffLoader { -1); blockCasingAdvanced = EnumUtils.addNewOrePrefix("blockCasingAdvanced", "An Advanced Casing block for a Multiblock-Machine", - "Advanced ", " Casing", + "Rebolted ", " Casing", true, true, true, @@ -1740,6 +1740,7 @@ public class WerkstoffLoader { GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); + GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); } |