diff options
author | Raven Szewczyk <git@kubasz.xyz> | 2022-08-27 10:56:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 11:56:37 +0200 |
commit | b5fb58403e9feb92018a737b9b6a77c559c5eda7 (patch) | |
tree | 6c6ea8f8cede561a81404826bdc5bd66d8bf509c /src/main/java | |
parent | 52b0805be619d2ada4dd2ec7def12a80cc595d35 (diff) | |
download | GT5-Unofficial-b5fb58403e9feb92018a737b9b6a77c559c5eda7.tar.gz GT5-Unofficial-b5fb58403e9feb92018a737b9b6a77c559c5eda7.tar.bz2 GT5-Unofficial-b5fb58403e9feb92018a737b9b6a77c559c5eda7.zip |
Update buildscript & apply spotless (#192)
* Update dependencies
* updateBuildscript & spotlessApply
Former-commit-id: f780e1a8d0f0bd192ba977eef17d41ee6fcd4b12
Diffstat (limited to 'src/main/java')
252 files changed, 18127 insertions, 10149 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java index 3839d28038..679e4f9cd3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_ConfigValues.java @@ -23,6 +23,6 @@ package com.github.bartimaeusnek.bartworks.API; public class API_ConfigValues { - //One-Side-Only + // One-Side-Only public static boolean debugLog = true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 909489a0c6..e7696f25ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -33,7 +33,8 @@ public final class AcidGenFuelAdder { } public static void addLiquidFuel(FluidStack fluidStack, int burn) { - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(fluidStack, burn); + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) + .addLiquidFuel(fluidStack, burn); } public static void addMoltenFuel(Materials M, int burn) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index c8806d269b..e8e9bf1f09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -30,18 +30,19 @@ import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_Utility; +import java.awt.*; import net.minecraft.item.EnumRarity; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.awt.*; @SuppressWarnings("ALL") public final class BioObjectAdder { -// @Deprecated -// public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity){ -// return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); -// } + // @Deprecated + // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, + // BioDNA dna, EnumRarity rarity){ + // return BioCulture.createAndRegisterBioCulture(color,name,ID,plasmid,dna,rarity); + // } /** * @param color the color of the Culture @@ -52,11 +53,14 @@ public final class BioObjectAdder { * @param rarity visual * @return */ - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); else - new Exception("Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception( + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -70,11 +74,14 @@ public final class BioObjectAdder { * @param breedable if the culture can be inserted into the BacterialVat * @return */ - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { if (BioCulture.BIO_CULTURE_ARRAY_LIST.size() > 1) return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); else - new Exception("Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception( + "Too Early to register a BioCulture! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -90,7 +97,8 @@ public final class BioObjectAdder { public static BioData createAndRegisterBioData(String aName, EnumRarity rarity, int chance, int tier) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioData.createAndRegisterBioData(aName, rarity, chance, tier); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -102,9 +110,9 @@ public final class BioObjectAdder { * @return */ public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { - if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) - return BioDNA.createAndRegisterBioDNA(aName, rarity); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioDNA.createAndRegisterBioDNA(aName, rarity); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -116,9 +124,9 @@ public final class BioObjectAdder { * @return */ public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { - if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) - return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -130,9 +138,9 @@ public final class BioObjectAdder { * @return */ public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { - if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) - return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -146,7 +154,8 @@ public final class BioObjectAdder { public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity, int chance, int tier) { if (BioData.BIO_DATA_ARRAY_LIST.size() > 1) return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); - new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!").printStackTrace(); + new Exception("Too Early to register a BioData! You MUST run this either after:bartworks OR in the init Phase!") + .printStackTrace(); return null; } @@ -162,15 +171,34 @@ public final class BioObjectAdder { * If you get NPE's related to BioCultures (most likely because of Load Order or creating BioCultures after the postinit Phase) execute this. */ public static void regenerateBioFluids() { - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 100) + : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.getFluidNotSet()) { - B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); + B.setFluid(new GT_Fluid( + B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[] { + (short) B.getColor().getRed(), + (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() + })); if (!FluidRegistry.registerFluid(B.getFluid())) new Exception("FAILED TO REGISTER FLUID FOR: " + B.getName()).printStackTrace(); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(10), + GT_Values.NI, + new FluidStack(B.getFluid(), 1000), + dnaFluid, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 500, + 120); } } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index 11ebdccb3d..145f762e30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -27,11 +27,10 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; +import java.util.Collection; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Collection; - @SuppressWarnings("ALL") public final class BioObjectGetter { @@ -83,7 +82,7 @@ public final class BioObjectGetter { return BioObjectGetter.convertDataToDNA(BioObjectGetter.convertBioPlasmidToData(bioPlasmid)); } - //UNSAFE needs to be reworked! + // UNSAFE needs to be reworked! public static Collection<ItemStack> getAllPetriDishes() { return BioItemList.getAllPetriDishes(); @@ -121,5 +120,4 @@ public final class BioObjectGetter { public static ItemStack getOther(int selection) { return BioItemList.getOther(selection); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 7fb06e019e..7a355b332d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -25,11 +25,10 @@ package com.github.bartimaeusnek.bartworks.API; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BioCulture; import gregtech.api.enums.Materials; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public final class BioRecipeAdder { @@ -38,8 +37,18 @@ public final class BioRecipeAdder { public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; - public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return BWRecipes.instance.addBioLabRecipe(aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + public static boolean addBioLabRecipe( + ItemStack[] aInputs, + ItemStack aOutput, + ItemStack aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return BWRecipes.instance.addBioLabRecipe( + aInputs, aOutput, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); } /** @@ -54,8 +63,16 @@ public final class BioRecipeAdder { * @param aSpecialValue 0 = STANDART, -100 = LowGravity, -200 = Cleanroom * @return if the recipe was added. */ - public static boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return BWRecipes.instance.addBioLabRecipeIncubation(aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); + public static boolean addBioLabRecipeIncubation( + ItemStack aInput, + BioCulture aOutput, + int[] aChances, + FluidStack aFluidInputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return BWRecipes.instance.addBioLabRecipeIncubation( + aInput, aOutput, aChances, aFluidInputs, aDuration, aEUt, aSpecialValue); } /** @@ -71,8 +88,19 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ - public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, int Sv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { - return BWRecipes.instance.addBacterialVatRecipe(aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, Sv, glasTier, aSpecialValue, exactSv); + public static boolean addBacterialVatRecipe( + ItemStack[] aInputs, + @Nonnull BioCulture aCulture, + @Nonnull FluidStack[] aFluidInputs, + @Nonnull FluidStack[] aFluidOutputs, + @Nonnegative int aDuration, + @Nonnegative int aEUt, + int Sv, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { + return BWRecipes.instance.addBacterialVatRecipe( + aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, Sv, glasTier, aSpecialValue, exactSv); } /** @@ -88,38 +116,69 @@ public final class BioRecipeAdder { * @param exactSv if the recipe needs EXACTLY the Sv or can use less... * @return */ - public static boolean addBacterialVatRecipe(ItemStack[] aInputs, @Nonnull BioCulture aCulture, @Nonnull FluidStack[] aFluidInputs, @Nonnull FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { - return BWRecipes.instance.addBacterialVatRecipe(aInputs, aCulture, aFluidInputs, aFluidOutputs, aDuration, aEUt, material, glasTier, aSpecialValue, exactSv); + public static boolean addBacterialVatRecipe( + ItemStack[] aInputs, + @Nonnull BioCulture aCulture, + @Nonnull FluidStack[] aFluidInputs, + @Nonnull FluidStack[] aFluidOutputs, + @Nonnegative int aDuration, + @Nonnegative int aEUt, + Materials material, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { + return BWRecipes.instance.addBacterialVatRecipe( + aInputs, + aCulture, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + material, + glasTier, + aSpecialValue, + exactSv); } -// public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { -// return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert); -// } - -// @Deprecated -// public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } -// -// @Deprecated -// public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ -// return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); -// } + // public static boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] + // aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSievert) { + // return BWRecipes.instance.addBacterialVatRecipe(aInputs, aOutputs, aFluidInputs, aFluidOutputs, aDuration, + // aEUt, aSievert); + // } + // @Deprecated + // public static boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipeDNAExtraction(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipePCRThermoclycling(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipePlasmidSynthesis(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, + // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipeTransformation(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } + // + // @Deprecated + // public static boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] + // aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue){ + // return BWRecipes.instance.addBioLabRecipeClonalCellularSynthesis(aInputs, aOutput, aChances, aFluidInputs, + // aFluidOutputs, aDuration, aEUt, aSpecialValue); + // } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index 36d4e04503..e850e4135b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -22,27 +22,25 @@ package com.github.bartimaeusnek.bartworks.API; +import static cpw.mods.fml.common.registry.GameRegistry.findBlock; + import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; import java.util.Objects; - -import static cpw.mods.fml.common.registry.GameRegistry.findBlock; +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; @SuppressWarnings("ALL") public final class BioVatLogicAdder { - public static class RadioHatch { public static void runBasicItemIntegration() { @@ -62,9 +60,12 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_2.get(1), Materials.Uranium, 6); giveItemStackRadioHatchAbilites(ItemList.Uraniumcell_4.get(1), Materials.Uranium, 12); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12); giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.TheCoreCell.get(1), Materials.Naquadah, 96); @@ -76,19 +77,38 @@ public final class BioVatLogicAdder { giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_2.get(1), Materials.Naquadah, 6, 10); giveItemStackRadioHatchAbilites(ItemList.Depleted_Naquadah_4.get(1), Materials.Naquadah, 12, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXSimpledepleted",1), Materials.Plutonium, 3, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXDualdepleted",1), Materials.Plutonium, 6, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorMOXQuaddepleted",1), Materials.Plutonium, 12, 10); - - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumSimpledepleted",1), Materials.Uranium, 3, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumDualdepleted",1), Materials.Uranium, 6, 10); - giveItemStackRadioHatchAbilites(GT_ModHandler.getModItem("IC2","reactorUraniumQuaddepleted",1), Materials.Uranium, 12, 10); - - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 3, 10); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 6, 10); - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), WerkstoffLoader.Tiberium.getBridgeMaterial(), 12, 10); - - giveItemStackRadioHatchAbilites(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorMOXSimpledepleted", 1), Materials.Plutonium, 3, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorMOXDualdepleted", 1), Materials.Plutonium, 6, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorMOXQuaddepleted", 1), Materials.Plutonium, 12, 10); + + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorUraniumSimpledepleted", 1), Materials.Uranium, 3, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorUraniumDualdepleted", 1), Materials.Uranium, 6, 10); + giveItemStackRadioHatchAbilites( + GT_ModHandler.getModItem("IC2", "reactorUraniumQuaddepleted", 1), Materials.Uranium, 12, 10); + + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 3, + 10); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 6, + 10); + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + WerkstoffLoader.Tiberium.getBridgeMaterial(), + 12, + 10); + + giveItemStackRadioHatchAbilites( + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), Materials.Naquadah, 96, 10); if (WerkstoffLoader.gtnhGT) { giveItemStackRadioHatchAbilites(ItemList.MNqCell_1.get(1), Materials.Naquadria, 3); @@ -158,16 +178,13 @@ public final class BioVatLogicAdder { public static int getMaxSv() { int ret = MaxSV; for (MaterialSvPair pair : RadioHatch.getMaSv()) { - if (pair.getSievert() > ret) - ret = pair.getSievert(); + if (pair.getSievert() > ret) ret = pair.getSievert(); } for (ItemStack is : RadioHatch.IsSv.keySet()) { - if (RadioHatch.IsSv.get(is) > ret) - ret = RadioHatch.IsSv.get(is); + if (RadioHatch.IsSv.get(is) > ret) ret = RadioHatch.IsSv.get(is); } return ret; } - } public static class BioVatGlass { @@ -184,10 +201,11 @@ public final class BioVatLogicAdder { public static boolean addCustomGlass(String sModname, String sUnlocBlockName, int meta, int tier) { Block block = findBlock(sModname, sUnlocBlockName); boolean ret = block != null; - if (ret) - BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); + if (ret) BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); else - new IllegalArgumentException("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); + new IllegalArgumentException( + "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!") + .printStackTrace(); block = null; return ret; } @@ -236,8 +254,8 @@ public final class BioVatLogicAdder { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioVatLogicAdder.MaterialSvPair that = (BioVatLogicAdder.MaterialSvPair) o; - return Objects.equals(this.getMaterials(), that.getMaterials()) && - Objects.equals(this.getSievert(), that.getSievert()); + return Objects.equals(this.getMaterials(), that.getMaterials()) + && Objects.equals(this.getSievert(), that.getSievert()); } @Override @@ -252,8 +270,6 @@ public final class BioVatLogicAdder { public Integer getSievert() { return this.sievert; } - - } public static class BlockMetaPair { @@ -270,8 +286,7 @@ public final class BioVatLogicAdder { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioVatLogicAdder.BlockMetaPair that = (BioVatLogicAdder.BlockMetaPair) o; - return Objects.equals(this.getBlock(), that.getBlock()) && - Objects.equals(this.getaByte(), that.getaByte()); + return Objects.equals(this.getBlock(), that.getBlock()) && Objects.equals(this.getaByte(), that.getaByte()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java index 178ab6f475..27d6f30e0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -1,17 +1,16 @@ package com.github.bartimaeusnek.bartworks.API; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; + import com.gtnewhorizon.structurelib.structure.IStructureElement; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.Block; -import org.apache.commons.lang3.tuple.Pair; - import java.util.ArrayList; import java.util.List; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Collectors; - -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import net.minecraft.block.Block; +import org.apache.commons.lang3.tuple.Pair; /** * API for bartworks borosilicate glass. @@ -27,8 +26,7 @@ public class BorosilicateGlass { private static List<Pair<Block, Integer>> representatives; private static Block getGlassBlock() { - if (block == null) - block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); + if (block == null) block = GameRegistry.findBlock("bartworks", "BW_GlasBlocks"); return block; } @@ -91,8 +89,10 @@ public class BorosilicateGlass { * * @param initialValue the value set before structure check started */ - public static <T> IStructureElement<T> ofBoroGlass(byte initialValue, BiConsumer<T, Byte> setter, Function<T, Byte> getter) { - return lazy(t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); + public static <T> IStructureElement<T> ofBoroGlass( + byte initialValue, BiConsumer<T, Byte> setter, Function<T, Byte> getter) { + return lazy( + t -> ofBlocksTiered(BorosilicateGlass::getTier, getRepresentatives(), initialValue, setter, getter)); } /** @@ -102,15 +102,18 @@ public class BorosilicateGlass { * @param minTier minimal accepted tier. inclusive. must be greater than 0. * @param maxTier maximal accepted tier. inclusive. */ - public static <T> IStructureElement<T> ofBoroGlass(byte initialValue, byte minTier, byte maxTier, BiConsumer<T, Byte> setter, Function<T, Byte> getter) { + public static <T> IStructureElement<T> ofBoroGlass( + byte initialValue, byte minTier, byte maxTier, BiConsumer<T, Byte> setter, Function<T, Byte> getter) { if (minTier > maxTier || minTier < 0) throw new IllegalArgumentException(); return lazy(t -> ofBlocksTiered( (block1, meta) -> checkWithinBound(getTier(block1, meta), minTier, maxTier), - getRepresentatives().stream().skip(Math.max(minTier - 3, 0)).limit(maxTier - minTier + 1).collect(Collectors.toList()), + getRepresentatives().stream() + .skip(Math.max(minTier - 3, 0)) + .limit(maxTier - minTier + 1) + .collect(Collectors.toList()), initialValue, setter, - getter - )); + getter)); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 96a075d9c7..61ce6d2c8a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -24,10 +24,15 @@ package com.github.bartimaeusnek.bartworks.API; public interface INoiseGen { - double getNoise(int x, int z); - double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd); - void setOctaves(int octaves); - void setFrequency(double freq); - void setSeed(long seed); - void setAmplitude(double amplitude); + double getNoise(int x, int z); + + double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd); + + void setOctaves(int octaves); + + void setFrequency(double freq); + + void setSeed(long seed); + + void setAmplitude(double amplitude); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index c10f7ffb39..22403b5cc1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -25,8 +25,7 @@ package com.github.bartimaeusnek.bartworks.API; import net.minecraft.inventory.ISidedInventory; public interface ITileDropsContent extends ISidedInventory { - default int[] getDropSlots(){ + default int[] getDropSlots() { return new int[] {0}; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index 369a403dc1..473908c7a3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -28,7 +28,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; - public interface ITileHasDifferentTextureSides { IIcon[] texture = new IIcon[7]; @@ -45,5 +44,4 @@ public interface ITileHasDifferentTextureSides { @SideOnly(Side.CLIENT) void registerBlockIcons(IIconRegister par1IconRegister); - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java index 1318cb919f..38b762fa9a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -42,7 +42,13 @@ public interface ITileWithGUI { */ default boolean openGUI(TileEntity tileEntity, EntityPlayer player) { if (!tileEntity.getWorldObj().isRemote) - player.openGui(MainMod.MOD_ID, getGUIID(), tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + player.openGui( + MainMod.MOD_ID, + getGUIID(), + tileEntity.getWorldObj(), + tileEntity.xCoord, + tileEntity.yCoord, + tileEntity.zCoord); return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java index 09ba5e6dfd..14c56e7ad9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/LoaderReference.java @@ -28,7 +28,7 @@ import cpw.mods.fml.common.Loader; * DO NOT CALL THIS IN THE CORE MOD! IT WILL __NOT__ WORK AND FUCK EVERYTHING UP! */ public class LoaderReference { - private LoaderReference(){} + private LoaderReference() {} public static boolean Natura; public static boolean RandomThings; @@ -60,7 +60,6 @@ public class LoaderReference { public static boolean ProjRedIllumination; public static boolean Botania; - public static void init() { Natura = Loader.isModLoaded("Natura"); RandomThings = Loader.isModLoaded("RandomThings"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java index 8a753938bf..a11e0c4a03 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/SideReference.java @@ -27,11 +27,16 @@ import cpw.mods.fml.common.FMLCommonHandler; public class SideReference { public static class EffectiveSide { - public static final boolean Server = FMLCommonHandler.instance().getEffectiveSide().isServer(); - public static final boolean Client = FMLCommonHandler.instance().getEffectiveSide().isClient(); + public static final boolean Server = + FMLCommonHandler.instance().getEffectiveSide().isServer(); + public static final boolean Client = + FMLCommonHandler.instance().getEffectiveSide().isClient(); } + public static class Side { - public static final boolean Server = FMLCommonHandler.instance().getSide().isServer(); - public static final boolean Client = FMLCommonHandler.instance().getSide().isClient(); + public static final boolean Server = + FMLCommonHandler.instance().getSide().isServer(); + public static final boolean Client = + FMLCommonHandler.instance().getSide().isClient(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java index 468885d454..29b84ae5ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/VoidMinerDropAdder.java @@ -23,24 +23,25 @@ package com.github.bartimaeusnek.bartworks.API; import gregtech.api.interfaces.ISubTagContainer; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class VoidMinerDropAdder { - private static Method getExtraDropsDimMap; + private static Method getExtraDropsDimMap; - static { - try { - getExtraDropsDimMap = Class.forName("com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base").getMethod("addMatierialToDimensionList",int.class, ISubTagContainer.class, float.class); - } catch (NoSuchMethodException | ClassNotFoundException e) { - e.printStackTrace(); - } - } + static { + try { + getExtraDropsDimMap = Class.forName( + "com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base") + .getMethod("addMatierialToDimensionList", int.class, ISubTagContainer.class, float.class); + } catch (NoSuchMethodException | ClassNotFoundException e) { + e.printStackTrace(); + } + } - public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) throws InvocationTargetException, IllegalAccessException { + public static void addDropsToDim(int dimID, ISubTagContainer material, float chance) + throws InvocationTargetException, IllegalAccessException { getExtraDropsDimMap.invoke(null, dimID, material, chance); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index bb3400512c..f8079ff6ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -40,5 +40,4 @@ public final class WerkstoffAPI { public static Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException { return (Werkstoff) w.getField(aName).get(null); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 9eabdee449..577e9621ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -28,15 +28,13 @@ public final class WerkstoffAdderRegistry { private static final HashSet<Runnable> toRun = new HashSet<>(); - private WerkstoffAdderRegistry() { - } + private WerkstoffAdderRegistry() {} public static void addWerkstoffAdder(Runnable adder) { toRun.add(adder); } public static void run() { - for (Runnable r : toRun) - r.run(); + for (Runnable r : toRun) r.run(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java index 78f721e950..7dabe8be07 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/package-info.java @@ -22,4 +22,4 @@ @API(owner = "bartworks", apiVersion = API_REFERENCE.VERSION, provides = "bartworks API") package com.github.bartimaeusnek.bartworks.API; -import cpw.mods.fml.common.API;
\ No newline at end of file +import cpw.mods.fml.common.API; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java index 48a8f49d5c..5f618c6955 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/ASMUtils.java @@ -22,19 +22,17 @@ package com.github.bartimaeusnek.bartworks.ASM; -import org.objectweb.asm.tree.MethodNode; - import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import org.objectweb.asm.tree.MethodNode; public class ASMUtils { public static String matchAny(String toCompare, String... args) { for (String arg : args) { - if (toCompare.equalsIgnoreCase(arg)) - return arg; + if (toCompare.equalsIgnoreCase(arg)) return arg; } return ""; } @@ -44,16 +42,15 @@ public class ASMUtils { */ public static boolean isCorrectMethod(MethodNode methodNode, String... args) { for (String arg : args) { - if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) - return true; + if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) return true; } return false; } public static boolean writeClassToDisk(byte[] towrite, String Classname, String Path) { try { - if (Path.charAt(Path.length()-1) == '/' || Path.charAt(Path.length()-1) == '\\') - Path = Path.substring(0,Path.length()-1); + if (Path.charAt(Path.length() - 1) == '/' || Path.charAt(Path.length() - 1) == '\\') + Path = Path.substring(0, Path.length() - 1); OutputStream os = new FileOutputStream(new File(Path + '/' + Classname + ".class")); os.write(towrite); } catch (IOException e) { @@ -62,5 +59,4 @@ public class ASMUtils { } return true; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java index e97de8cf21..f4251f2cd5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCore.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.ASM; +import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; @@ -33,13 +35,10 @@ import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - import java.util.ArrayList; import java.util.List; - -import static com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer.shouldTransform; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; @SuppressWarnings("ALL") public class BWCore extends DummyModContainer { @@ -65,7 +64,7 @@ public class BWCore extends DummyModContainer { shouldTransform[4] = true; shouldTransform[5] = ConfigHandler.enabledPatches[5]; shouldTransform[6] = ConfigHandler.enabledPatches[6]; - //shouldTransform[6] = true; + // shouldTransform[6] = true; BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]); BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]); BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java index 37a64add7c..9f68bfd1c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCorePlugin.java @@ -25,13 +25,12 @@ package com.github.bartimaeusnek.bartworks.ASM; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import cpw.mods.fml.relauncher.FMLInjectionData; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; -import net.minecraftforge.common.config.Configuration; - import java.io.File; import java.util.ArrayList; import java.util.Map; +import net.minecraftforge.common.config.Configuration; -@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE)//Load as late as possible (after fastcraft/OptiFine). +@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE) // Load as late as possible (after fastcraft/OptiFine). @IFMLLoadingPlugin.MCVersion("1.7.10") @IFMLLoadingPlugin.TransformerExclusions("com.github.bartimaeusnek.bartworks.ASM") @IFMLLoadingPlugin.Name(BWCorePlugin.BWCORE_PLUGIN_NAME) @@ -42,18 +41,17 @@ public class BWCorePlugin implements IFMLLoadingPlugin { public static File minecraftDir; public BWCorePlugin() { - //Injection Code taken from CodeChickenLib - if (BWCorePlugin.minecraftDir != null) - return;//get called twice, once for IFMLCallHook + // Injection Code taken from CodeChickenLib + if (BWCorePlugin.minecraftDir != null) return; // get called twice, once for IFMLCallHook BWCorePlugin.minecraftDir = (File) FMLInjectionData.data()[6]; - //do all the configuration already now... + // do all the configuration already now... new ConfigHandler(new Configuration(new File(new File(BWCorePlugin.minecraftDir, "config"), "bartworks.cfg"))); BWCoreTransformer.shouldTransform[2] = false; } @Override public String[] getASMTransformerClass() { - return new String[]{BWCoreTransformer.class.getName()}; + return new String[] {BWCoreTransformer.class.getName()}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java index e4b14820c7..04932c3281 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -25,6 +25,9 @@ package com.github.bartimaeusnek.bartworks.ASM; import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashSet; import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityList; import com.github.bartimaeusnek.bartworks.util.accessprioritylist.AccessPriorityListNode; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -32,12 +35,9 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - public class BWCoreStaticReplacementMethodes { - private static ThreadLocal<AccessPriorityList<IRecipe>> RECENTLYUSEDRECIPES = ThreadLocal.withInitial(AccessPriorityList::new); + private static ThreadLocal<AccessPriorityList<IRecipe>> RECENTLYUSEDRECIPES = + ThreadLocal.withInitial(AccessPriorityList::new); public static void clearRecentlyUsedRecipes() { // the easiest way to ensure the cache is flushed without causing synchronization overhead @@ -52,31 +52,30 @@ public class BWCoreStaticReplacementMethodes { ItemStack itemstack1 = null; int j; - for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) - { + for (j = 0; j < inventoryCrafting.getSizeInventory(); ++j) { ItemStack itemstack2 = inventoryCrafting.getStackInSlot(j); - if (itemstack2 != null) - { - if (i == 0) - itemstack = itemstack2; + if (itemstack2 != null) { + if (i == 0) itemstack = itemstack2; - if (i == 1) - itemstack1 = itemstack2; + if (i == 1) itemstack1 = itemstack2; ++i; } } - if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) { + if (i == 2 + && itemstack.getItem() == itemstack1.getItem() + && itemstack.stackSize == 1 + && itemstack1.stackSize == 1 + && itemstack.getItem().isRepairable()) { Item item = itemstack.getItem(); int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); int l = j1 + k + item.getMaxDamage() * 5 / 100; int i1 = item.getMaxDamage() - l; - if (i1 < 0) - i1 = 0; + if (i1 < 0) i1 = 0; return new ItemStack(itemstack.getItem(), 1, i1); @@ -90,8 +89,7 @@ public class BWCoreStaticReplacementMethodes { AccessPriorityListNode<IRecipe> recipeNode = it.next(); iPossibleRecipe = recipeNode.getELEMENT(); - if (!iPossibleRecipe.matches(inventoryCrafting, world)) - continue; + if (!iPossibleRecipe.matches(inventoryCrafting, world)) continue; cache.addPrioToNode(recipeNode); return iPossibleRecipe.getCraftingResult(inventoryCrafting); @@ -104,29 +102,23 @@ public class BWCoreStaticReplacementMethodes { for (int k = 0; k < recipeList.size(); k++) { IRecipe r = (IRecipe) recipeList.get(k); - if (r.matches(inventoryCrafting, world)) - recipeSet.add(r); + if (r.matches(inventoryCrafting, world)) recipeSet.add(r); } Object[] arr = recipeSet.toArray(); - if (arr.length == 0) - return null; + if (arr.length == 0) return null; IRecipe recipe = (IRecipe) arr[0]; stack = recipe.getCraftingResult(inventoryCrafting); - if (arr.length != 1) - return stack; + if (arr.length != 1) return stack; - if (stack != null) - cache.addLast(recipe); + if (stack != null) cache.addLast(recipe); return stack; } } - private BWCoreStaticReplacementMethodes() { - } - -}
\ No newline at end of file + private BWCoreStaticReplacementMethodes() {} +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java index 223a067ce6..5fdace3319 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreTransformer.java @@ -22,36 +22,35 @@ package com.github.bartimaeusnek.bartworks.ASM; +import static org.objectweb.asm.Opcodes.*; + +import java.util.Arrays; +import java.util.List; import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.*; -import java.util.Arrays; -import java.util.List; - -import static org.objectweb.asm.Opcodes.*; - public class BWCoreTransformer implements IClassTransformer { public static final String[] DESCRIPTIONFORCONFIG = { - "REMOVING RAIN FROM LAST MILLENIUM (EXU)", - "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", - "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", - "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", - "DUCTTAPING RWG WORLDEN FAILS", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" - // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" + "REMOVING RAIN FROM LAST MILLENIUM (EXU)", + "REMVOING CREATURES FROM LAST MILLENIUM (EXU)", + "PATCHING GLOBAL RENDERER FOR USE WITH MY GALACTIC DIMS", + "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", + "PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API", + "DUCTTAPING RWG WORLDEN FAILS", + "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" + // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER" }; public static final String[] CLASSESBEEINGTRANSFORMED = { - "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", - "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", - "net.minecraft.client.renderer.RenderGlobal", - "thaumcraft.common.tiles.TileWandPedestal", - "gregtech.GT_Mod", - "rwg.world.ChunkGeneratorRealistic", - "net.minecraft.item.crafting.CraftingManager" - // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" + "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", + "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", + "net.minecraft.client.renderer.RenderGlobal", + "thaumcraft.common.tiles.TileWandPedestal", + "gregtech.GT_Mod", + "rwg.world.ChunkGeneratorRealistic", + "net.minecraft.item.crafting.CraftingManager" + // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter" }; static boolean obfs; @@ -71,8 +70,17 @@ public class BWCoreTransformer implements IClassTransformer { AbstractInsnNode beginning = method.instructions.get(j - 7); LabelNode label = new LabelNode(); nu.insertBefore(beginning, new VarInsnNode(ALOAD, 0)); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "thaumcraft/common/tiles/TileWandPedestal", obfs ? "field_145850_b" : "worldObj", "Lnet/minecraft/world/World;")); - nu.insertBefore(beginning, new FieldInsnNode(GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); + nu.insertBefore( + beginning, + new FieldInsnNode( + GETFIELD, + "thaumcraft/common/tiles/TileWandPedestal", + obfs ? "field_145850_b" : "worldObj", + "Lnet/minecraft/world/World;")); + nu.insertBefore( + beginning, + new FieldInsnNode( + GETFIELD, "net/minecraft/world/World", obfs ? "field_72995_K" : "isRemote", "Z")); nu.insertBefore(beginning, new JumpInsnNode(IFNE, label)); nu.add(new InsnNode(POP)); nu.add(label); @@ -86,7 +94,8 @@ public class BWCoreTransformer implements IClassTransformer { public static byte[] transform(int id, byte[] basicClass) { if (!BWCoreTransformer.shouldTransform[id]) { - BWCore.BWCORE_LOG.info("Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); + BWCore.BWCORE_LOG.info( + "Patch: " + BWCoreTransformer.DESCRIPTIONFORCONFIG[id] + " is disabled, will not patch!"); return basicClass; } @@ -112,11 +121,8 @@ public class BWCoreTransformer implements IClassTransformer { } } BWCore.BWCORE_LOG.info("Creating new " + name_deObfs + "!"); - MethodNode nu = new MethodNode(ACC_PUBLIC, name_deObfs, - /*obfs ? dsc_Obfs :*/ dsc_deObfs, - null, - new String[0] - ); + MethodNode nu = new MethodNode( + ACC_PUBLIC, name_deObfs, /*obfs ? dsc_Obfs :*/ dsc_deObfs, null, new String[0]); InsnList insnList = new InsnList(); insnList.add(new InsnNode(ICONST_0)); insnList.add(new InsnNode(IRETURN)); @@ -135,7 +141,8 @@ public class BWCoreTransformer implements IClassTransformer { String dsc_Obfs = "(Lsx;III)Ljava/util/List;"; for (int i = 0; i < methods.size(); i++) { - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) + && ASMUtils.isCorrectMethod(methods.get(i), dsc_deObfs, dsc_Obfs)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); MethodNode toPatch = methods.get(i); InsnList insnList = new InsnList(); @@ -158,7 +165,8 @@ public class BWCoreTransformer implements IClassTransformer { String field_src = "field_110928_i"; BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) + && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -170,35 +178,95 @@ public class BWCoreTransformer implements IClassTransformer { String nameFieldToPatch; for (int j = 0; j < toPatch.instructions.size(); j++) { - if (toPatch.instructions.get(j) instanceof FieldInsnNode && toPatch.instructions.get(j).getOpcode() == GETSTATIC && !(nameFieldToPatch = ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j)).name, field_deObfs, field_src)).isEmpty()) { + if (toPatch.instructions.get(j) instanceof FieldInsnNode + && toPatch.instructions.get(j).getOpcode() == GETSTATIC + && !(nameFieldToPatch = ASMUtils.matchAny( + ((FieldInsnNode) toPatch.instructions.get(j)).name, + field_deObfs, + field_src)) + .isEmpty()) { boolean useSrc = nameFieldToPatch.equals(field_src); if (useSrc) - BWCore.BWCORE_LOG.info("Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); + BWCore.BWCORE_LOG.info( + "Found either Optifine or Fastcraft... this patch was annoying to make compatible to them..."); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? theWorld_src : "theWorld", "Lnet/minecraft/client/multiplayer/WorldClient;")); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/multiplayer/WorldClient", useSrc ? provider_src : "provider", "Lnet/minecraft/world/WorldProvider;")); - nu.add(new TypeInsnNode(INSTANCEOF, "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? theWorld_src : "theWorld", + "Lnet/minecraft/client/multiplayer/WorldClient;")); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/multiplayer/WorldClient", + useSrc ? provider_src : "provider", + "Lnet/minecraft/world/WorldProvider;")); + nu.add( + new TypeInsnNode( + INSTANCEOF, + "com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace")); nu.add(new JumpInsnNode(IFEQ, LabelNodes[0])); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", "sunTex", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? renderEngine_src : "renderEngine", + "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode( + GETSTATIC, + "com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b", + "sunTex", + "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode( + INVOKEVIRTUAL, + "net/minecraft/client/renderer/texture/TextureManager", + useSrc ? bindTexture_src : "bindTexture", + "(Lnet/minecraft/util/ResourceLocation;)V", + false)); nu.add(new JumpInsnNode(GOTO, LabelNodes[1])); nu.add(LabelNodes[0]); nu.add(new VarInsnNode(ALOAD, 0)); - nu.add(new FieldInsnNode(GETFIELD, "net/minecraft/client/renderer/RenderGlobal", useSrc ? renderEngine_src : "renderEngine", "Lnet/minecraft/client/renderer/texture/TextureManager;")); - nu.add(new FieldInsnNode(GETSTATIC, "net/minecraft/client/renderer/RenderGlobal", useSrc ? field_src : "locationSunPng", "Lnet/minecraft/util/ResourceLocation;")); - nu.add(new MethodInsnNode(INVOKEVIRTUAL, "net/minecraft/client/renderer/texture/TextureManager", useSrc ? bindTexture_src : "bindTexture", "(Lnet/minecraft/util/ResourceLocation;)V", false)); + nu.add(new FieldInsnNode( + GETFIELD, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? renderEngine_src : "renderEngine", + "Lnet/minecraft/client/renderer/texture/TextureManager;")); + nu.add(new FieldInsnNode( + GETSTATIC, + "net/minecraft/client/renderer/RenderGlobal", + useSrc ? field_src : "locationSunPng", + "Lnet/minecraft/util/ResourceLocation;")); + nu.add(new MethodInsnNode( + INVOKEVIRTUAL, + "net/minecraft/client/renderer/texture/TextureManager", + useSrc ? bindTexture_src : "bindTexture", + "(Lnet/minecraft/util/ResourceLocation;)V", + false)); nu.add(LabelNodes[1]); j++; } else { if (j < toPatch.instructions.size() - 2) { - if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode && toPatch.instructions.get(j + 2).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 2)).name, field_deObfs, field_src).isEmpty()) - continue; - if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode && toPatch.instructions.get(j + 1).getOpcode() == GETSTATIC && !ASMUtils.matchAny(((FieldInsnNode) toPatch.instructions.get(j + 1)).name, field_deObfs, field_src).isEmpty()) - continue; + if (toPatch.instructions.get(j + 2) instanceof FieldInsnNode + && toPatch.instructions + .get(j + 2) + .getOpcode() + == GETSTATIC + && !ASMUtils.matchAny( + ((FieldInsnNode) toPatch.instructions.get(j + 2)).name, + field_deObfs, + field_src) + .isEmpty()) continue; + if (toPatch.instructions.get(j + 1) instanceof FieldInsnNode + && toPatch.instructions + .get(j + 1) + .getOpcode() + == GETSTATIC + && !ASMUtils.matchAny( + ((FieldInsnNode) toPatch.instructions.get(j + 1)).name, + field_deObfs, + field_src) + .isEmpty()) continue; } nu.add(toPatch.instructions.get(j)); } @@ -216,14 +284,15 @@ public class BWCoreTransformer implements IClassTransformer { String dsc_universal = "()V"; for (int i = 0; i < methods.size(); i++) { - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { + if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) + && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); methods.set(i, BWCoreTransformer.transformThaumcraftWandPedestal(methods.get(i))); break scase; } } } - case 4 : { + case 4: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "<clinit>"; for (MethodNode toPatch : methods) { @@ -234,11 +303,19 @@ public class BWCoreTransformer implements IClassTransformer { for (int j = 0; j < 2; j++) { nu.add(toPatch.instructions.get(j)); } - nu.add(new FieldInsnNode(GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); - nu.add(new TypeInsnNode(NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); + nu.add(new FieldInsnNode( + GETSTATIC, "gregtech/api/GregTech_API", "sBeforeGTPreload", "Ljava/util/List;")); + nu.add(new TypeInsnNode( + NEW, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload")); nu.add(new InsnNode(DUP)); - nu.add(new MethodInsnNode(INVOKESPECIAL, "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", "<init>", "()V", false)); - nu.add(new MethodInsnNode(INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); + nu.add(new MethodInsnNode( + INVOKESPECIAL, + "com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload", + "<init>", + "()V", + false)); + nu.add(new MethodInsnNode( + INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z", true)); nu.add(new InsnNode(POP)); for (int j = 2; j < toPatch.instructions.size(); j++) { nu.add(toPatch.instructions.get(j)); @@ -290,11 +367,16 @@ public class BWCoreTransformer implements IClassTransformer { String name_Obfs = "a"; String name_src = "func_82787_a"; for (MethodNode toPatch : methods) { - if (ASMUtils.isCorrectMethod(toPatch,name_deObfs,name_Obfs,name_src)){ + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src)) { toPatch.instructions = new InsnList(); - toPatch.instructions.add(new VarInsnNode(ALOAD,1)); - toPatch.instructions.add(new VarInsnNode(ALOAD,2)); - toPatch.instructions.add(new MethodInsnNode(INVOKESTATIC,"com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes","findCachedMatchingRecipe","(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;",false)); + toPatch.instructions.add(new VarInsnNode(ALOAD, 1)); + toPatch.instructions.add(new VarInsnNode(ALOAD, 2)); + toPatch.instructions.add(new MethodInsnNode( + INVOKESTATIC, + "com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes", + "findCachedMatchingRecipe", + "(Lnet/minecraft/inventory/InventoryCrafting;Lnet/minecraft/world/World;)Lnet/minecraft/item/ItemStack;", + false)); toPatch.instructions.add(new InsnNode(ARETURN)); toPatch.localVariables.clear(); toPatch.maxStack = 2; @@ -304,11 +386,12 @@ public class BWCoreTransformer implements IClassTransformer { } } -// case 6: { -// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); -// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; -// break scase; -// } + // case 6: { + // BWCore.BWCORE_LOG.info("Could find: " + + // BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); + // ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000; + // break scase; + // } default: { BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); return basicClass; @@ -329,7 +412,8 @@ public class BWCoreTransformer implements IClassTransformer { @Override public byte[] transform(String name, String transformedName, byte[] basicClass) { for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) { - if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) + if (name.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i]) + || transformedName.equalsIgnoreCase(BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i])) return BWCoreTransformer.transform(i, basicClass); } return basicClass; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 63fb597213..d074e32c53 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -53,7 +53,8 @@ public class GuiHandler implements IGuiHandler { } } case 3: - return new BW_Container_HeatedWaterPump((BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player); + return new BW_Container_HeatedWaterPump( + (BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player); } return null; } @@ -69,14 +70,15 @@ public class GuiHandler implements IGuiHandler { case 2: { if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); - return new BW_GUIContainer_RadLevel(new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); + return new BW_GUIContainer_RadLevel( + new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity())); } } case 3: - return new BW_GUIContainer_HeatedWaterPump(new BW_Container_HeatedWaterPump((BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player)); + return new BW_GUIContainer_HeatedWaterPump(new BW_Container_HeatedWaterPump( + (BW_TileEntity_HeatedWaterPump) world.getTileEntity(x, y, z), player)); } - } else - return getServerGuiElement(ID, player, world, x, y, z); + } else return getServerGuiElement(ID, player, world, x, y, z); return null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f0b1be2d03..78fafff410 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; +import static gregtech.api.enums.GT_Values.VN; import com.github.bartimaeusnek.bartworks.API.*; import com.github.bartimaeusnek.bartworks.client.ClientEventHandler.TooltipEventHandler; @@ -50,22 +53,19 @@ import cpw.mods.fml.common.network.NetworkRegistry; import gregtech.api.GregTech_API; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import java.io.IOException; +import java.util.Map; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.io.IOException; -import java.util.Map; - -import static com.github.bartimaeusnek.bartworks.common.loaders.BioRecipeLoader.runOnServerStarted; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.removeIC2Recipes; -import static gregtech.api.enums.GT_Values.VN; - @SuppressWarnings("ALL") @Mod( - modid = MainMod.MOD_ID, name = MainMod.NAME, version = MainMod.VERSION, + modid = MainMod.MOD_ID, + name = MainMod.NAME, + version = MainMod.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + "after:berriespp; " @@ -75,8 +75,7 @@ import static gregtech.api.enums.GT_Values.VN; + "after:Forestry; " + "after:ProjRed|Illumination; " + "after:RandomThings; " - + "before:miscutils; " - ) + + "before:miscutils; ") public final class MainMod { public static final String NAME = "BartWorks"; public static final String VERSION = "GRADLETOKEN_VERSION"; @@ -90,6 +89,7 @@ public final class MainMod { @Mod.Instance(MainMod.MOD_ID) public static MainMod instance; + public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler @@ -99,14 +99,13 @@ public final class MainMod { MainMod.LOGGER.error("Something has loaded an old API. Please contact the Mod authors to update!"); } - LoaderReference.init(); //Check for ALL the mods. + LoaderReference.init(); // Check for ALL the mods. if (LoaderReference.miscutils) { MainMod.LOGGER.info("Found GT++, continuing"); } - if (LoaderReference.dreamcraft) - ConfigHandler.hardmode = true; + if (LoaderReference.dreamcraft) ConfigHandler.hardmode = true; ConfigHandler.hardmode = ConfigHandler.ezmode != ConfigHandler.hardmode; @@ -122,8 +121,7 @@ public final class MainMod { WerkstoffLoader.setUp(); } - if (ConfigHandler.hardmode) - MainMod.LOGGER.info(". . . ACTIVATED HARDMODE."); + if (ConfigHandler.hardmode) MainMod.LOGGER.info(". . . ACTIVATED HARDMODE."); if (ConfigHandler.BioLab) { BioCultureLoader.run(); @@ -132,10 +130,8 @@ public final class MainMod { if (ConfigHandler.newStuff) { Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); - if (SideReference.Side.Client) - GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); + if (SideReference.Side.Client) GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); } - } @Mod.EventHandler @@ -147,8 +143,7 @@ public final class MainMod { MinecraftForge.EVENT_BUS.register(serverEventHandler); } FMLCommonHandler.instance().bus().register(serverEventHandler); - if (ConfigHandler.BioLab) - BioLabLoader.run(); + if (ConfigHandler.BioLab) BioLabLoader.run(); if (ConfigHandler.newStuff) { WerkstoffLoader.runInit(); } @@ -162,8 +157,11 @@ public final class MainMod { NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); if (ConfigHandler.BioLab) { GTNHBlocks.run(); - for (Map.Entry<BioVatLogicAdder.BlockMetaPair, Byte> pair : BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { - GT_OreDictUnificator.registerOre("blockGlass" + VN[pair.getValue()], new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); + for (Map.Entry<BioVatLogicAdder.BlockMetaPair, Byte> pair : + BioVatLogicAdder.BioVatGlass.getGlassMap().entrySet()) { + GT_OreDictUnificator.registerOre( + "blockGlass" + VN[pair.getValue()], + new ItemStack(pair.getKey().getBlock(), 1, pair.getKey().getaByte())); } } ArtificialMicaLine.runArtificialMicaRecipe(); @@ -201,22 +199,19 @@ public final class MainMod { CircuitImprintLoader.run(); BioVatLogicAdder.RadioHatch.runBasicItemIntegration(); if (!recipesAdded) { - if (!disableExtraGasRecipes) - StaticRecipeChangeLoaders.addEBFGasRecipes(); + if (!disableExtraGasRecipes) StaticRecipeChangeLoaders.addEBFGasRecipes(); - if (classicMode) - DownTierLoader.run(); + if (classicMode) DownTierLoader.run(); - //StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification(); + // StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification(); recipesAdded = true; } StaticRecipeChangeLoaders.fixEnergyRequirements(); - //StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); + // StaticRecipeChangeLoaders.synchroniseCircuitUseMulti(); - //Accept recipe map changes into Buffers + // Accept recipe map changes into Buffers GT_Recipe.GT_Recipe_Map.sMappings.forEach(GT_Recipe.GT_Recipe_Map::reInit); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index 24b8834c47..c571fdbef2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -23,21 +23,19 @@ package com.github.bartimaeusnek.bartworks.client.ClientEventHandler; import com.github.bartimaeusnek.bartworks.util.Pair; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; class TooltipCache { private static final HashMap<Pair<Integer, Short>, char[]> cache = new HashMap<>(); - static boolean put(ItemStack itemStack, List<String> tooltip){ + static boolean put(ItemStack itemStack, List<String> tooltip) { Pair<Integer, Short> p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - if (TooltipCache.cache.containsKey(p)) - return false; + if (TooltipCache.cache.containsKey(p)) return false; if (!tooltip.isEmpty()) { StringBuilder sb = new StringBuilder(); @@ -46,7 +44,7 @@ class TooltipCache { sb.append(System.lineSeparator()); } char[] rettype = sb.toString().toCharArray(); - return TooltipCache.cache.put(p,rettype) == rettype; + return TooltipCache.cache.put(p, rettype) == rettype; } else { return false; } @@ -54,17 +52,16 @@ class TooltipCache { static List<String> getTooltip(ItemStack itemStack) { Pair<Integer, Short> p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - char[] toTest= TooltipCache.cache.get(p); - if (toTest == null){ + char[] toTest = TooltipCache.cache.get(p); + if (toTest == null) { return new ArrayList<>(); } return Arrays.asList(new String(toTest).split(System.lineSeparator())); } - private static void checkSize(){ - if (TooltipCache.cache.size()> Short.MAX_VALUE*2 ){ + private static void checkSize() { + if (TooltipCache.cache.size() > Short.MAX_VALUE * 2) { TooltipCache.cache.clear(); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 6c55b603e8..33892d57ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -39,6 +39,9 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -47,10 +50,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - @SideOnly(Side.CLIENT) public class TooltipEventHandler { @@ -58,29 +57,35 @@ public class TooltipEventHandler { @SubscribeEvent(priority = EventPriority.HIGHEST) public void getTooltip(ItemTooltipEvent event) { - if (event == null || event.itemStack == null || event.itemStack.getItem() == null) - return; + if (event == null || event.itemStack == null || event.itemStack.getItem() == null) return; if (TooltipCache.getTooltip(event.itemStack).isEmpty()) { ItemStack tmp = event.itemStack.copy(); - Pair<Integer,Short> abstractedStack = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + Pair<Integer, Short> abstractedStack = + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); List<String> tooAdd = new ArrayList<>(); - if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache().contains(abstractedStack)) { - for (Pair<Integer,Short> pair : OreDictHandler.getNonBWCache()) { + if (ConfigHandler.sharedItemStackTooltip + && OreDictHandler.getNonBWCache().contains(abstractedStack)) { + for (Pair<Integer, Short> pair : OreDictHandler.getNonBWCache()) { if (pair.equals(abstractedStack)) { GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); if (UI != null) { for (ModContainer modContainer : Loader.instance().getModList()) { - if (UI.modId.equals(MainMod.MOD_ID) || UI.modId.equals(BartWorksCrossmod.MOD_ID) || UI.modId.equals("BWCore")) - break; + if (UI.modId.equals(MainMod.MOD_ID) + || UI.modId.equals(BartWorksCrossmod.MOD_ID) + || UI.modId.equals("BWCore")) break; if (UI.modId.equals(modContainer.getModId())) { - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + modContainer.getName()); + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + + ChatColorHelper.GRAY + " and " + ChatColorHelper.RED + + modContainer.getName()); } } } else - tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + ChatColorHelper.GRAY + " and another Mod, that doesn't use the ModContainer propperly!"); + tooAdd.add("Shared ItemStack between " + ChatColorHelper.DARKGREEN + "BartWorks" + + ChatColorHelper.GRAY + + " and another Mod, that doesn't use the ModContainer propperly!"); } } } @@ -91,17 +96,15 @@ public class TooltipEventHandler { TooltipCache.put(event.itemStack, tooAdd); return; } - BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); + BioVatLogicAdder.BlockMetaPair PAIR = + new BioVatLogicAdder.BlockMetaPair(BLOCK, (byte) event.itemStack.getItemDamage()); HashMap<BioVatLogicAdder.BlockMetaPair, Byte> GLASSMAP = BioVatLogicAdder.BioVatGlass.getGlassMap(); if (GLASSMAP.containsKey(PAIR)) { int tier = GLASSMAP.get(PAIR); - tooAdd.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + - " " - + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); + tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier] + ChatColorHelper.RESET); } else if (BLOCK.getMaterial().equals(Material.glass)) { - tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + - " " + tooAdd.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(3) + GT_Values.VN[3] + ChatColorHelper.RESET); } } @@ -112,4 +115,4 @@ public class TooltipEventHandler { event.toolTip.addAll(TooltipCache.getTooltip(event.itemStack)); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index 68c82fc7cc..d80aa74a11 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -36,5 +36,4 @@ public class bartworksTab extends CreativeTabs { public Item getTabIconItem() { return ItemRegistry.ROCKCUTTER_HV; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index 16cafa256d..d92ed0012f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -30,7 +30,8 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { - private static final ResourceLocation furnaceGuiTextures = new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/GUIheatedPump.png"); + private static final ResourceLocation furnaceGuiTextures = + new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/GUIheatedPump.png"); final BW_Container_HeatedWaterPump container; public BW_GUIContainer_HeatedWaterPump(Container p_i1072_1_) { @@ -45,7 +46,8 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); -// this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, 0xffffff); + // this.drawString(this.fontRendererObj, "Fuel:" + container.fuel + " Water:" + container.water, k, l, + // 0xffffff); if (this.container.fuel > 0) { this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); @@ -54,10 +56,10 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); } -// if (this.container.water > 0){ -// this.mc.getTextureManager().bindTexture( new ResourceLocation("textures/blocks/water_still.png")); -// this.drawTexturedModalRect(k+85,l+32,32,32,18,18); -// } + // if (this.container.water > 0){ + // this.mc.getTextureManager().bindTexture( new ResourceLocation("textures/blocks/water_still.png")); + // this.drawTexturedModalRect(k+85,l+32,32,32,18,18); + // } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 7a9603ee61..6d234b69dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -41,7 +41,6 @@ public class BW_GUIContainer_RadLevel extends GuiContainer { this.container = (BW_Container_RadioHatch) p_i1072_1_; } - @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(1, 1, 1); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 90923deee4..c3339e156d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -44,27 +44,39 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { } protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); + this.fontRendererObj.drawString( + this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 6, 2157374); if (this.container.base.checkrotor()) { if (!this.container.base.rotorspace()) { - this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 27, 52, 2157374); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotorspace"), 27, 52, 2157374); } else if (this.container.base.checkrotor() && !this.container.base.guiisminWindStrength()) { - this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.windweak1"), 27, 52, 2157374); } else { this.fontRendererObj.drawString(this.container.base.getRotorhealth() + " %", 46, 52, 2157374); if (this.container.base.guiisoverload()) { - GuiTooltipHelper.drawAreaTooltip(p_146979_1_ - this.guiLeft, p_146979_2_ - this.guiTop, StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), 44, 27, 79, 52); + GuiTooltipHelper.drawAreaTooltip( + p_146979_1_ - this.guiLeft, + p_146979_2_ - this.guiTop, + StatCollector.translateToLocal("ic2.WindKineticGenerator.error.overload"), + 44, + 27, + 79, + 52); } } } else { - this.fontRendererObj.drawString(StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("ic2.WindKineticGenerator.gui.rotormiss"), 27, 52, 2157374); } - } protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor3f(0.5f, 0.25f, 0.07f); - this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); + this.mc + .getTextureManager() + .bindTexture(new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; this.drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index 77d290504f..5b6c40c20a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -41,8 +41,7 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine { } protected void drawGuiContainerForegroundLayer(int par1, int par2) { - if (!(this.mContainer instanceof GT_Container_MultiMachine)) - return; + if (!(this.mContainer instanceof GT_Container_MultiMachine)) return; if ((this.mContainer.mDisplayErrorCode & 64) != 0) this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); @@ -70,11 +69,10 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainerMetaTile_Machine { this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 32), 32, 32); else if (System.currentTimeMillis() / DIVIDER % 40 == 0) this.drawTexturedModalRect(x + 85, y + 27, 176, (last = 0), 32, 32); - else - this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32); + else this.drawTexturedModalRect(x + 85, y + 27, 176, last, 32, 32); } - //Soft Mallet + // Soft Mallet if (this.mContainer.mDisplayErrorCode == 0) { if (this.mContainer.mActive == 0) { this.drawTexturedModalRect(x + 66, y + 66, 176, 128, 15, 15); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 80970c254c..e575474b72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -35,7 +35,8 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); + public static final ResourceLocation texture = + new ResourceLocation(MainMod.MOD_ID, "textures/GUI/GUI_CircuitP.png"); public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { super(new GT_Container_CircuitProgrammer(p_i1072_1_)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index aa13bb4ee1..7b050d64b7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -34,7 +34,8 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GT_GUIContainer_Destructopack extends GuiContainer { - public static final ResourceLocation texture = new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); + public static final ResourceLocation texture = + new ResourceLocation(MainMod.MOD_ID, "textures/GT2/gui/Destructopack.png"); public GT_GUIContainer_Destructopack(InventoryPlayer inventory) { super(new GT_Container_Item_Destructopack(inventory)); @@ -48,8 +49,5 @@ public class GT_GUIContainer_Destructopack extends GuiContainer { } @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - } - - + protected void drawGuiContainerForegroundLayer(int par1, int par2) {} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 570fe9c0b4..acab43a06e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -31,14 +31,13 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; +import java.awt.*; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import java.awt.*; - @SideOnly(Side.CLIENT) public class GT_GUIContainer_LESU extends GT_GUIContainer { @@ -57,16 +56,52 @@ public class GT_GUIContainer_LESU extends GT_GUIContainer { this.drawString(this.fontRendererObj, "L.E.S.U.", 11, 8, 16448255); if (this.mContainer != null) { String percell = String.valueOf(ConfigHandler.energyPerCell).substring(1); - this.drawString(this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255); - this.drawString(this.fontRendererObj, "MAX: " + (this.c.getBaseMetaTileEntity().isActive() ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell : Integer.toString(0)), 11, 24, 16448255); - this.drawString(this.fontRendererObj, "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), 11, 32, 16448255); - this.drawString(this.fontRendererObj, "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), 11, 40, 16448255); - this.drawString(this.fontRendererObj, "AMP/t IN/OUT: " + GT_Utility.formatNumbers(this.c.getBaseMetaTileEntity().getInputAmperage()), 11, 48, 16448255); + this.drawString( + this.fontRendererObj, "EU: " + GT_Utility.formatNumbers(this.mContainer.mEnergy), 11, 16, 16448255); + this.drawString( + this.fontRendererObj, + "MAX: " + + (this.c.getBaseMetaTileEntity().isActive() + ? GT_Utility.formatNumbers(this.mContainer.mOutput) + percell + : Integer.toString(0)), + 11, + 24, + 16448255); + this.drawString( + this.fontRendererObj, + "MAX EU/t IN: " + GT_Utility.formatNumbers(this.mContainer.mInput), + 11, + 32, + 16448255); + this.drawString( + this.fontRendererObj, + "EU/t OUT: " + GT_Utility.formatNumbers(this.mContainer.mOutput), + 11, + 40, + 16448255); + this.drawString( + this.fontRendererObj, + "AMP/t IN/OUT: " + + GT_Utility.formatNumbers( + this.c.getBaseMetaTileEntity().getInputAmperage()), + 11, + 48, + 16448255); if (this.c.maxEUStore() >= Long.MAX_VALUE - 1) { - this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.0.name"), 11, 56, Color.YELLOW.getRGB()); + this.drawString( + this.fontRendererObj, + StatCollector.translateToLocal("tooltip.LESU.0.name"), + 11, + 56, + Color.YELLOW.getRGB()); } if (!this.c.getBaseMetaTileEntity().isActive()) { - this.drawString(this.fontRendererObj, StatCollector.translateToLocal("tooltip.LESU.1.name"), 11, 56, Color.RED.getRGB()); + this.drawString( + this.fontRendererObj, + StatCollector.translateToLocal("tooltip.LESU.1.name"), + 11, + 56, + Color.RED.getRGB()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index cfa0180442..13dd85c5c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -31,43 +31,60 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.nio.ByteBuffer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import java.nio.ByteBuffer; - @SideOnly(Side.CLIENT) public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine { private static int maxSv; private final String mName; public GT_GUIContainer_RadioHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { - super(new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); + super( + new GT_Container_RadioHatch(aInventoryPlayer, aTileEntity), + MainMod.MOD_ID + ":textures/GUI/RadHatch.png"); this.mName = "Radio Hatch"; this.mContainer.detectAndSendChanges(); GT_GUIContainer_RadioHatch.maxSv = BioVatLogicAdder.RadioHatch.getMaxSv(); } protected void drawGuiContainerForegroundLayer(int par1, int par2) { - long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer).getLong(); - double maxT = ((GT_Container_RadioHatch) this.mContainer).mass * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert)); + long timer = ByteBuffer.wrap(((GT_Container_RadioHatch) this.mContainer).teTimer) + .getLong(); + double maxT = ((GT_Container_RadioHatch) this.mContainer).mass + * (GT_MetaTileEntity_RadioHatch.calcDecayTicks(((GT_Container_RadioHatch) this.mContainer).sievert)); double rem = maxT - timer % maxT; this.fontRendererObj.drawString(this.mName, 8, 4, 4210752); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.MOD_ID + ":textures/GUI/RadHatch.png")); if (((GT_Container_RadioHatch) this.mContainer).mass > 0) { - GL11.glColor3f(((GT_Container_RadioHatch) this.mContainer).r / 255f, ((GT_Container_RadioHatch) this.mContainer).g / 255f, ((GT_Container_RadioHatch) this.mContainer).b / 255f); + GL11.glColor3f( + ((GT_Container_RadioHatch) this.mContainer).r / 255f, + ((GT_Container_RadioHatch) this.mContainer).g / 255f, + ((GT_Container_RadioHatch) this.mContainer).b / 255f); this.drawTexturedModalRect(124, 18, 124, 18, 16, 48); } GL11.glColor3f(1f, 1f, 1f); this.drawTexturedModalRect(124, 18, 176, 0, 16, 48 - MathUtils.ceilInt(48 * (rem / maxT))); - this.drawTexturedModalRect(65, 13, 192, 0, (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), 16); + this.drawTexturedModalRect( + 65, + 13, + 192, + 0, + (48 * (((GT_Container_RadioHatch) this.mContainer).sv)) / (GT_GUIContainer_RadioHatch.maxSv), + 16); - -// this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); -// this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + // this.fontRendererObj.drawString("Sv: " + ((GT_Container_RadioHatch) mContainer).sievert, 8, 50, + // BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, + // ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + // this.fontRendererObj.drawString("Kg: " + ((GT_Container_RadioHatch) mContainer).mass, 8, 68, + // BW_ColorUtil.getColorFromRGBArray(new short[]{((GT_Container_RadioHatch) mContainer).r, + // ((GT_Container_RadioHatch) mContainer).g, ((GT_Container_RadioHatch) mContainer).b})); + // this.fontRendererObj.drawString("Time: " + timer, 8, 76, BW_ColorUtil.getColorFromRGBArray(new + // short[]{((GT_Container_RadioHatch) mContainer).r, ((GT_Container_RadioHatch) mContainer).g, + // ((GT_Container_RadioHatch) mContainer).b})); } @@ -77,5 +94,4 @@ public class GT_GUIContainer_RadioHatch extends GT_GUIContainerMetaTile_Machine int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java index dd5787a871..c1880bfca0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_CropVisualizer.java @@ -24,12 +24,18 @@ public class BW_CropVisualizer extends EntityFX { @Override public void onUpdate() { - if (this.particleAge++ >= this.particleMaxAge) - this.setDead(); + if (this.particleAge++ >= this.particleMaxAge) this.setDead(); } @Override - public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { + public void renderParticle( + Tessellator p_70539_1_, + float p_70539_2_, + float p_70539_3_, + float p_70539_4_, + float p_70539_5_, + float p_70539_6_, + float p_70539_7_) { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); @@ -51,5 +57,4 @@ public class BW_CropVisualizer extends EntityFX { public boolean shouldRenderInPass(int pass) { return pass == 2; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index f11167a6bc..ab9a04fc18 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -46,25 +46,30 @@ public class BW_GT_ItemRenderer implements IItemRenderer { for (BW_Meta_Items.BW_GT_MetaGen_Item_Hook tItem : BW_Meta_Items.BW_GT_MetaGen_Item_Hook.sInstances) { MinecraftForgeClient.registerItemRenderer(tItem, this); } - } @Override public boolean handleRenderType(ItemStack aStack, IItemRenderer.ItemRenderType aType) { if (!GT_Utility.isStackInvalid(aStack) && aStack.getItemDamage() >= 0) { - return aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON || aType == IItemRenderer.ItemRenderType.INVENTORY || aType == IItemRenderer.ItemRenderType.EQUIPPED || aType == IItemRenderer.ItemRenderType.ENTITY; + return aType == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON + || aType == IItemRenderer.ItemRenderType.INVENTORY + || aType == IItemRenderer.ItemRenderType.EQUIPPED + || aType == IItemRenderer.ItemRenderType.ENTITY; } else { return false; } } + @Override - public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { + public boolean shouldUseRenderHelper( + IItemRenderer.ItemRenderType aType, ItemStack aStack, IItemRenderer.ItemRendererHelper aHelper) { if (GT_Utility.isStackInvalid(aStack)) { return false; } else { return aType == IItemRenderer.ItemRenderType.ENTITY; } } + @Override public void renderItem(IItemRenderer.ItemRenderType type, ItemStack aStack, Object... data) { if (!GT_Utility.isStackInvalid(aStack)) { @@ -90,18 +95,38 @@ public class BW_GT_ItemRenderer implements IItemRenderer { GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); else { for (int i = 0; i < 4; i++) { - GT_RenderUtil.renderItemIcon(tIcon, 0.0D+i*2D,0.0D+i*2D,10.0D+i*2D,10.0D+i*2D, 0.001D, 0.0F, 0.0F, -1.0F); + GT_RenderUtil.renderItemIcon( + tIcon, + 0.0D + i * 2D, + 0.0D + i * 2D, + 10.0D + i * 2D, + 10.0D + i * 2D, + 0.001D, + 0.0F, + 0.0F, + -1.0F); } } } else { if (aMetaData < CircuitImprintLoader.reverseIDs) - ItemRenderer.renderItemIn2D(Tessellator.instance,tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); -// else { -// for (int i = 0; i < 4; i++) { -// ItemRenderer.renderItemIn2D(Tessellator.instance, 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); -// } -// } -// ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tIcon.getMaxU(), + tIcon.getMinV(), + tIcon.getMinU(), + tIcon.getMaxV(), + tIcon.getIconWidth(), + tIcon.getIconHeight(), + 0.0625F); + // else { + // for (int i = 0; i < 4; i++) { + // ItemRenderer.renderItemIn2D(Tessellator.instance, + // 0.0F+i*2F,0.0F+i*2F,10.0F+i*2F,10.0F+i*2F, tIcon.getIconWidth(), tIcon.getIconHeight(),0.0625F); + // } + // } + // ItemRenderer.renderItemIn2D(Tessellator.instance, tIcon.getMaxU(), + // tIcon.getMinV(), tIcon.getMinU(), tIcon.getMaxV(), tIcon.getIconWidth(), tIcon.getIconHeight(), + // 0.0625F); } IIcon tOverlay = (IIcon) BW_Util.get2DCoordFrom1DArray(aMetaData, 1, 2, aItem.mIconList); @@ -112,7 +137,15 @@ public class BW_GT_ItemRenderer implements IItemRenderer { if (type.equals(IItemRenderer.ItemRenderType.INVENTORY)) { GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F); } else { - ItemRenderer.renderItemIn2D(Tessellator.instance, tOverlay.getMaxU(), tOverlay.getMinV(), tOverlay.getMinU(), tOverlay.getMaxV(), tOverlay.getIconWidth(), tOverlay.getIconHeight(), 0.0625F); + ItemRenderer.renderItemIn2D( + Tessellator.instance, + tOverlay.getMaxU(), + tOverlay.getMinV(), + tOverlay.getMinU(), + tOverlay.getMaxV(), + tOverlay.getIconWidth(), + tOverlay.getIconHeight(), + 0.0625F); } } } @@ -120,4 +153,4 @@ public class BW_GT_ItemRenderer implements IItemRenderer { GL11.glDisable(3042); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 02983419a3..a55ed8be41 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.client.renderer; +import static gregtech.common.render.GT_Renderer_Block.*; + import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block_TE; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; @@ -33,8 +35,6 @@ import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; -import static gregtech.common.render.GT_Renderer_Block.*; - public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { public static BW_Renderer_Block_Ores INSTANCE = new BW_Renderer_Block_Ores(); public final int mRenderID = RenderingRegistry.getNextAvailableRenderId(); @@ -43,7 +43,7 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { - BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; aRenderer.enableAO = false; aRenderer.useInventoryTint = true; @@ -64,8 +64,9 @@ public class BW_Renderer_Block_Ores implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { - BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); + public boolean renderWorldBlock( + IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int modelId, RenderBlocks aRenderer) { + BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks) aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = ((BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ)).mMetaData; aRenderer.useInventoryTint = false; aBlock.setBlockBounds(blockMin, blockMin, blockMin, blockMax, blockMax, blockMax); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index a054273f6b..f464b249d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -75,11 +75,19 @@ public class RendererGlasBlock implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - //renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); + public boolean renderWorldBlock( + IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + // renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999); renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); - //renderer.setRenderBounds(0,0,0,1,1,1); - renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + // renderer.setRenderBounds(0,0,0,1,1,1); + renderer.renderStandardBlockWithColorMultiplier( + block, + x, + y, + z, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, + ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 612bd33b98..e659a6d2f9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -56,7 +56,8 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler int count = 0; float end = 0.0f; for (float aFlow : flow) { - if (aFlow >= RendererSwitchingColorFluid.THREE_QUARTERS_FILLED && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { + if (aFlow >= RendererSwitchingColorFluid.THREE_QUARTERS_FILLED + && end != RendererSwitchingColorFluid.LIGHT_Y_POS) { end = aFlow; } if (aFlow >= 0.0f) { @@ -81,17 +82,17 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler return RendererSwitchingColorFluid.THREE_QUARTERS_FILLED; } } - return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block) ? RendererSwitchingColorFluid.LIGHT_Y_POS : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED); - } - - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + return (!world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y + 1, z) == block) + ? RendererSwitchingColorFluid.LIGHT_Y_POS + : (block.getQuantaPercentage(world, x, y, z) * RendererSwitchingColorFluid.THREE_QUARTERS_FILLED); } + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @SideOnly(Side.CLIENT) - public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - if ((!(block instanceof BioFluidBlock))) - return false; + public boolean renderWorldBlock( + IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + if ((!(block instanceof BioFluidBlock))) return false; Tessellator tessellator = Tessellator.instance; Coords blockat = new Coords(x, y, z, iBlockAccess.getTileEntity(x, y, z).getWorldObj().provider.dimensionId); Integer rgb = GT_TileEntity_BioVat.staticColorMap.get(blockat); @@ -111,14 +112,13 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler BlockFluidBase blockFluidBase = (BlockFluidBase) block; boolean renderTop = iBlockAccess.getBlock(x, y + 1, z) != blockFluidBase; - boolean renderBottom = - block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) - && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; + boolean renderBottom = block.shouldSideBeRendered(iBlockAccess, x, y - 1, z, 0) + && iBlockAccess.getBlock(x, y - 1, z) != blockFluidBase; boolean[] renderSides = { - block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), - block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), - block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), - block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) + block.shouldSideBeRendered(iBlockAccess, x, y, z - 1, 2), + block.shouldSideBeRendered(iBlockAccess, x, y, z + 1, 3), + block.shouldSideBeRendered(iBlockAccess, x - 1, y, z, 4), + block.shouldSideBeRendered(iBlockAccess, x + 1, y, z, 5) }; if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) { return false; @@ -136,10 +136,18 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler float fluidHeightForRender6 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z - 1, blockFluidBase); float fluidHeightForRender7 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z, blockFluidBase); float fluidHeightForRender8 = this.getFluidHeightForRender(iBlockAccess, x + 1, y, z + 1, blockFluidBase); - heightNW = this.getFluidHeightAverage(new float[]{fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, fluidHeightForRender}); - heightSW = this.getFluidHeightAverage(new float[]{fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, fluidHeightForRender}); - heightSE = this.getFluidHeightAverage(new float[]{fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, fluidHeightForRender}); - heightNE = this.getFluidHeightAverage(new float[]{fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, fluidHeightForRender}); + heightNW = this.getFluidHeightAverage(new float[] { + fluidHeightForRender1, fluidHeightForRender2, fluidHeightForRender4, fluidHeightForRender + }); + heightSW = this.getFluidHeightAverage(new float[] { + fluidHeightForRender2, fluidHeightForRender3, fluidHeightForRender5, fluidHeightForRender + }); + heightSE = this.getFluidHeightAverage(new float[] { + fluidHeightForRender5, fluidHeightForRender7, fluidHeightForRender8, fluidHeightForRender + }); + heightNE = this.getFluidHeightAverage(new float[] { + fluidHeightForRender4, fluidHeightForRender6, fluidHeightForRender7, fluidHeightForRender + }); } else { heightNW = fluidHeightForRender; heightSW = fluidHeightForRender; @@ -157,7 +165,14 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler heightSE -= RendererSwitchingColorFluid.RENDER_OFFSET; heightNE -= RendererSwitchingColorFluid.RENDER_OFFSET; - double dInterpolatedU, dInterpolatedV, dInterpolatedU2, dInterpolatedV2, dInterpolatedU3, dInterpolatedV3, dInterpolatedU4, dInterpolatedV4; + double dInterpolatedU, + dInterpolatedV, + dInterpolatedU2, + dInterpolatedV2, + dInterpolatedU3, + dInterpolatedV3, + dInterpolatedU4, + dInterpolatedV4; if (flowDir < -999.0f) { dInterpolatedU = iconStill.getInterpolatedU(0.0); @@ -181,7 +196,10 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); - tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * red, RendererSwitchingColorFluid.LIGHT_Y_POS * green, RendererSwitchingColorFluid.LIGHT_Y_POS * blue); + tessellator.setColorOpaque_F( + RendererSwitchingColorFluid.LIGHT_Y_POS * red, + RendererSwitchingColorFluid.LIGHT_Y_POS * green, + RendererSwitchingColorFluid.LIGHT_Y_POS * blue); tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); @@ -191,14 +209,21 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); - } if (renderer.renderAllFaces || renderBottom) { rendered = true; tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); - tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_NEG * red, RendererSwitchingColorFluid.LIGHT_Y_NEG * green, RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); - renderer.renderFaceYNeg(block, x, y + RendererSwitchingColorFluid.RENDER_OFFSET, z, this.getNullCheckedIiconOrFallbackTexture()); + tessellator.setColorOpaque_F( + RendererSwitchingColorFluid.LIGHT_Y_NEG * red, + RendererSwitchingColorFluid.LIGHT_Y_NEG * green, + RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); + renderer.renderFaceYNeg( + block, + x, + y + RendererSwitchingColorFluid.RENDER_OFFSET, + z, + this.getNullCheckedIiconOrFallbackTexture()); } for (int side = 0; side < 4; ++side) { @@ -267,7 +292,10 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } else { sideLighting = RendererSwitchingColorFluid.LIGHT_XZ_POS; } - tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); + tessellator.setColorOpaque_F( + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, + RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); @@ -293,6 +321,11 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } private IIcon getNullCheckedIiconOrFallbackTexture() { - return FluidLoader.autogenIIcon != null ? FluidLoader.autogenIIcon : ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + return FluidLoader.autogenIIcon != null + ? FluidLoader.autogenIIcon + : ((TextureMap) Minecraft.getMinecraft() + .getTextureManager() + .getTexture(TextureMap.locationBlocksTexture)) + .getAtlasSprite("missingno"); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 82f0cc02dc..a849ac11ac 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -30,7 +30,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; - import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -45,40 +44,40 @@ public class PrefixTextureLinker implements Runnable { private static void fillBlockTexMap() { blockTexMap.put(TextureSet.SET_QUARTZ, TextureSet.INDEX_block4); - Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced).forEach( - prefixes -> { + Stream.of(WerkstoffLoader.blockCasing, WerkstoffLoader.blockCasingAdvanced) + .forEach(prefixes -> { HashMap<TextureSet, IIconContainer> curr = new HashMap<>(); Arrays.stream(TextureSet.class.getFields()) .filter(field -> field.getName().contains("SET")) .forEach(SET -> { try { - curr.put((TextureSet) SET.get(null), - new Textures.BlockIcons.CustomIcon( - "materialicons/" + SET.getName().substring(4) + "/" + prefixes) - ); + curr.put( + (TextureSet) SET.get(null), + new Textures.BlockIcons.CustomIcon("materialicons/" + + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } }); texMapBlocks.put(prefixes, curr); - } - ); + }); } private static void fillItemTexMap() { Arrays.stream(OrePrefixes.values()) .filter(prefixes -> prefixes != OrePrefixes.rod - && prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) + && prefixes.mTextureIndex == -1 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes) != 0) .forEach(prefixes -> { HashMap<TextureSet, Textures.ItemIcons.CustomIcon> curr = new HashMap<>(); Arrays.stream(TextureSet.class.getFields()) .filter(field -> field.getName().contains("SET")) .forEach(SET -> { try { - curr.put((TextureSet) SET.get(null), - new Textures.ItemIcons.CustomIcon( - "materialicons/" + SET.getName().substring(4) + "/" + prefixes) - ); + curr.put( + (TextureSet) SET.get(null), + new Textures.ItemIcons.CustomIcon("materialicons/" + + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index 24f3aad588..22b58a28be 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -38,12 +39,11 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class BW_Blocks extends Block { @SideOnly(Side.CLIENT) protected IIcon[] texture; + String[] textureNames; protected String name; @@ -139,4 +139,4 @@ public class BW_Blocks extends Block { public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { return false; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 3661d8e3d7..451d435286 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -47,8 +47,8 @@ public class BW_GlasBlocks extends BW_Blocks { this.connectedTex = false; } - - public BW_GlasBlocks(String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { + public BW_GlasBlocks( + String name, String[] texture, short[][] color, CreativeTabs tabs, boolean connectedTex, boolean fake) { super(name, texture, tabs, Material.glass); this.connectedTex = connectedTex; this.color = color; @@ -67,12 +67,10 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { - if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks) - return false; + if (worldClient.getBlock(xCoord, yCoord, zCoord) instanceof BW_GlasBlocks) return false; return super.shouldSideBeRendered(worldClient, xCoord, yCoord, zCoord, aSide); } - @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { @@ -96,10 +94,7 @@ public class BW_GlasBlocks extends BW_Blocks { String[] splitname = this.textureNames[0].split(":"); for (int j = 0; j < 16; j++) { this.connectedTexture[j] = par1IconRegister.registerIcon( - splitname[0] - + ":connectedTex/" - + splitname[1] + '/' - + splitname[1] + '_' + j); + splitname[0] + ":connectedTex/" + splitname[1] + '/' + splitname[1] + '_' + j); } } } @@ -107,8 +102,7 @@ public class BW_GlasBlocks extends BW_Blocks { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess worldClient, int xCoord, int yCoord, int zCoord, int aSide) { - if (!this.connectedTex) - return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); + if (!this.connectedTex) return super.getIcon(worldClient, xCoord, yCoord, zCoord, aSide); ForgeDirection dir = ForgeDirection.getOrientation(aSide); byte sides = 0; @@ -146,7 +140,6 @@ public class BW_GlasBlocks extends BW_Blocks { if (worldClient.getBlock(xCoord, yCoord, zCoord + 1) instanceof BW_GlasBlocks) sides = (byte) (sides | 0b1000); break; - } case NORTH: { if (worldClient.getBlock(xCoord, yCoord + 1, zCoord) instanceof BW_GlasBlocks) @@ -186,10 +179,8 @@ public class BW_GlasBlocks extends BW_Blocks { @Override public int getRenderType() { - if (!this.fake && SideReference.Side.Client) - return RendererGlasBlock.RID; - else - return 0; + if (!this.fake && SideReference.Side.Client) return RendererGlasBlock.RID; + else return 0; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index 8f2d60ef39..e14ff9f491 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -66,14 +66,27 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + public boolean onBlockActivated( + World worldObj, + int x, + int y, + int z, + EntityPlayer player, + int p_149727_6_, + float p_149727_7_, + float p_149727_8_, + float p_149727_9_) { if (worldObj.isRemote) { return false; } TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile instanceof BW_TileEntity_HeatedWaterPump) { - if (player.getHeldItem() != null && (player.getHeldItem().getItem().equals(Items.bucket) || player.getHeldItem().getItem() instanceof IFluidContainerItem) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) - if (player.getHeldItem().getItem().equals(Items.bucket) && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { + if (player.getHeldItem() != null + && (player.getHeldItem().getItem().equals(Items.bucket) + || player.getHeldItem().getItem() instanceof IFluidContainerItem) + && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false) != null) + if (player.getHeldItem().getItem().equals(Items.bucket) + && ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, false).amount == 1000) { ((BW_TileEntity_HeatedWaterPump) tile).drain(1000, true); player.getHeldItem().stackSize--; if (player.getHeldItem().stackSize <= 0) @@ -125,7 +138,8 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI int[] dropSlots = ((ITileDropsContent) t).getDropSlots(); for (int dropSlot : dropSlots) { if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) - world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); + world.spawnEntityInWorld(new EntityItem( + world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); @@ -141,8 +155,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI e.printStackTrace(); return super.getIcon(side, meta); } - } else - return super.getIcon(side, meta); + } else return super.getIcon(side, meta); } @Override @@ -154,8 +167,7 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); } - } else - super.registerBlockIcons(par1IconRegister); + } else super.registerBlockIcons(par1IconRegister); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java index 45f67ccfcb..ed4680dde8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_MachineBlock.java @@ -30,7 +30,8 @@ import net.minecraft.world.World; public class BW_TileEntityContainer_MachineBlock extends BW_TileEntityContainer { - public BW_TileEntityContainer_MachineBlock(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + public BW_TileEntityContainer_MachineBlock( + Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); GregTech_API.registerMachineBlock(this, -1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index 6a8c62bb83..61429f10e1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -29,6 +29,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ic2.core.IHasGui; +import java.util.List; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -45,17 +46,21 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class BW_TileEntityContainer_Multiple extends BlockContainer { protected final String[] textureNames; protected final String name; protected final Class<? extends TileEntity>[] tileEntityArray; + @SideOnly(Side.CLIENT) protected IIcon[] texture; - public BW_TileEntityContainer_Multiple(Material p_i45386_1_, Class<? extends TileEntity>[] tileEntity, String blockName, String[] textureNames, CreativeTabs tabs) { + public BW_TileEntityContainer_Multiple( + Material p_i45386_1_, + Class<? extends TileEntity>[] tileEntity, + String blockName, + String[] textureNames, + CreativeTabs tabs) { super(p_i45386_1_); this.setHardness(15.0F); this.setResistance(30.0F); @@ -68,7 +73,16 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { } @Override - public boolean onBlockActivated(World worldObj, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { + public boolean onBlockActivated( + World worldObj, + int x, + int y, + int z, + EntityPlayer player, + int p_149727_6_, + float p_149727_7_, + float p_149727_8_, + float p_149727_9_) { if (worldObj.isRemote) { return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index a135e7e315..5d06247dbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -41,7 +41,7 @@ public class BioFluidBlock extends BlockFluidBase implements ITileEntityProvider public BioFluidBlock() { super(FluidLoader.ff, Material.water); this.setBlockName("BioFluidBlock"); - //this.setCreativeTab(MainMod.BioTab); + // this.setCreativeTab(MainMod.BioTab); this.textureName = "gregtech:fluids/fluid.molten.autogenerated"; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index a49fbc5ae4..8b8d4c15d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -23,12 +23,11 @@ package com.github.bartimaeusnek.bartworks.common.commands; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import java.lang.reflect.Field; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; -import java.lang.reflect.Field; - public class ChangeConfig extends CommandBase { @Override public String getCommandName() { @@ -43,7 +42,7 @@ public class ChangeConfig extends CommandBase { @Override @SuppressWarnings("rawtypes") public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - try{ + try { Field f = ConfigHandler.class.getField(p_71515_2_[0]); Class c = f.getType(); if (c.equals(int.class)) { @@ -55,28 +54,26 @@ public class ChangeConfig extends CommandBase { return; } f.setInt(null, l); - } - else if (c.equals(long.class)) { + } else if (c.equals(long.class)) { long l; - try{ + try { l = Long.parseLong(p_71515_2_[1]); - }catch (NumberFormatException e){ + } catch (NumberFormatException e) { p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } f.setLong(null, l); - } - else if (c.equals(boolean.class)){ - if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1") ) - f.setBoolean(null,true); - else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0") ) - f.setBoolean(null,false); + } else if (c.equals(boolean.class)) { + if (p_71515_2_[1].equalsIgnoreCase("true") || p_71515_2_[1].equalsIgnoreCase("1")) + f.setBoolean(null, true); + else if (p_71515_2_[1].equalsIgnoreCase("false") || p_71515_2_[1].equalsIgnoreCase("0")) + f.setBoolean(null, false); else { p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); } } p_71515_1_.addChatMessage(new ChatComponentText("Set " + p_71515_2_[0] + " to " + p_71515_2_[1])); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java index 0b179f0332..f41c1d384d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/GetWorkingDirectory.java @@ -40,6 +40,7 @@ public class GetWorkingDirectory extends CommandBase { @Override public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - p_71515_1_.addChatMessage(new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); + p_71515_1_.addChatMessage( + new ChatComponentText(Minecraft.getMinecraft().mcDataDir.getAbsolutePath())); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java index 9b85abbedb..1a924e7322 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/PrintRecipeListToFile.java @@ -22,15 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.commands; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; - import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; public class PrintRecipeListToFile extends CommandBase { @Override @@ -50,9 +49,10 @@ public class PrintRecipeListToFile extends CommandBase { try { BufferedWriter fw = new BufferedWriter(new FileWriter(file)); - CraftingManager.getInstance().getRecipeList().forEach( e -> { + CraftingManager.getInstance().getRecipeList().forEach(e -> { try { - fw.write(e.toString() + " = " +((IRecipe)e).getRecipeOutput().getDisplayName() +"\n"); + fw.write(e.toString() + " = " + + ((IRecipe) e).getRecipeOutput().getDisplayName() + "\n"); } catch (IOException ex) { ex.printStackTrace(); } 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 aedddf54f8..02f3454a03 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 @@ -41,14 +41,14 @@ public class SummonRuin extends CommandBase { @Override public void processCommand(ICommandSender iCommandSender, String[] p_71515_2_) { try { - new MapGenRuins.RuinsBase().generate( - iCommandSender.getEntityWorld(), - iCommandSender.getEntityWorld().rand, - Integer.parseInt(p_71515_2_[0]), - 256, - Integer.parseInt(p_71515_2_[1]) - ); - }catch (Exception e){ + new MapGenRuins.RuinsBase() + .generate( + iCommandSender.getEntityWorld(), + iCommandSender.getEntityWorld().rand, + Integer.parseInt(p_71515_2_[0]), + 256, + Integer.parseInt(p_71515_2_[1])); + } catch (Exception e) { e.printStackTrace(); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index fdef73f046..6c918fb4e5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -22,15 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.configs; - import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.ASM.BWCoreTransformer; -import net.minecraftforge.common.config.Configuration; - import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; +import net.minecraftforge.common.config.Configuration; public class ConfigHandler { @@ -83,108 +81,320 @@ public class ConfigHandler { public static boolean disablePistonInEIC = false; private static final int[][] METAFORTIERS_ENERGY = { - {100, 101, 102, 105}, - {1110, 1115, 1120, 1127}, - {1111, 12726, 1116, 1121, 1128}, - {1112, 12727, 1117, 1122, 1129}, - {12728, 1190, 1130, 12685}, - {1191, 1174, 695, 12686}, + {100, 101, 102, 105}, + {1110, 1115, 1120, 1127}, + {1111, 12726, 1116, 1121, 1128}, + {1112, 12727, 1117, 1122, 1129}, + {12728, 1190, 1130, 12685}, + {1191, 1174, 695, 12686}, }; private static final int[][] METAFORTIERS_BUFFER = { - {5133, 5123}, - {161, 171, 181, 191}, - {162, 172, 182, 192}, - {163, 173, 183, 193}, - {164, 174, 184, 194}, - {165, 175, 185, 195}, + {5133, 5123}, + {161, 171, 181, 191}, + {162, 172, 182, 192}, + {163, 173, 183, 193}, + {164, 174, 184, 194}, + {165, 175, 185, 195}, }; private static final int[][] METAFORTIERS_CABLE = { - {5133, 5123}, - {1210, 1230, 1250, 1270, 1290}, - {1310, 1330, 1350, 1370, 1390}, - {1410, 1430, 1450, 1470, 1490}, - {1510, 1530, 1550, 1570, 1590}, - {1650, 1670, 1690}, + {5133, 5123}, + {1210, 1230, 1250, 1270, 1290}, + {1310, 1330, 1350, 1370, 1390}, + {1410, 1430, 1450, 1470, 1490}, + {1510, 1530, 1550, 1570, 1590}, + {1650, 1670, 1690}, }; private static final int[][] METAFORTIERS_MACHINE = { - {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119}, - {201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, 621, 631, 641, 651, 661, 671}, - {202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, 622, 632, 642, 652, 662, 672}, - {203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, 623, 633, 643, 653, 663, 673}, - {204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, 624, 634, 644, 654, 664, 674}, - {205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, 625, 635, 645, 655, 665, 675}, + {103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119}, + { + 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, + 411, 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, + 621, 631, 641, 651, 661, 671 + }, + { + 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, + 412, 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, + 622, 632, 642, 652, 662, 672 + }, + { + 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, + 413, 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, + 623, 633, 643, 653, 663, 673 + }, + { + 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, + 414, 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, + 624, 634, 644, 654, 664, 674 + }, + { + 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, + 415, 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, + 625, 635, 645, 655, 665, 675 + }, + }; + private static int[][][] defaultMetasForTiers = { + METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE + }; + private static final String[] VOLTAGE_NAMES = new String[] { + "High Pressure Steam", + "Low Voltage", + "Medium Voltage", + "High Voltage", + "Extreme Voltage", + "Insane Voltage", + "Ludicrous Voltage", + "ZPM Voltage", + "Ultimate Voltage", + "Ultimate High Voltage", + "Ultimate Extreme Voltage", + "Ultimate Insane Voltage", + "Ultimate Mega Voltage", + "Ultimate Extended Mega Voltage", + "Overpowered Voltage", + "Maximum Voltage" }; - private static int[][][] defaultMetasForTiers = {METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, METAFORTIERS_MACHINE}; - private static final String[] VOLTAGE_NAMES = new String[]{"High Pressure Steam", "Low Voltage", "Medium Voltage", "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage"}; private static final String[] names = {"Generators", "Buffers", "Cables", "Machines"}; public ConfigHandler(Configuration C) { ConfigHandler.c = C; - ConfigHandler.classicMode= ConfigHandler.c.get("System", "Enable Classic Mode", false, "Enables the classic Mode (all recipes in normal machines are doable in MV").getBoolean(false); - ConfigHandler.creativeScannerID = ConfigHandler.c.get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block").getInt(0); - - ConfigHandler.tooltips = ConfigHandler.c.get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips").getBoolean(true); - ConfigHandler.sharedItemStackTooltip = ConfigHandler.c.get("System", "BartWorksSharedItemStackToolTips", true, "If you wish to enable \"Shared Item Stack\" tooltips").getBoolean(true); - - ConfigHandler.IDOffset = ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").getInt(12600); - ConfigHandler.ezmode = ConfigHandler.c.get("System", "Mode switch", false, "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.").getBoolean(false); - ConfigHandler.teslastaff = ConfigHandler.c.get("System", "Enable Teslastaff", false, "Enables the Teslastaff, an Item used to destroy Electric Armors").getBoolean(false); - ConfigHandler.newStuff = !ConfigHandler.c.get("System", "Disable non-original-GT-stuff", false, "This switch disables my new content, that is not part of the GT2 compat").getBoolean(false); - ConfigHandler.BioLab = !ConfigHandler.c.get("System", "Disable BioLab", false, "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!").getBoolean(false); - ConfigHandler.cutoffTier = ConfigHandler.c.get("System", "Tier to nerf circuits", 5, "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.",-1, VOLTAGE_NAMES.length).getInt(5); + ConfigHandler.classicMode = ConfigHandler.c + .get( + "System", + "Enable Classic Mode", + false, + "Enables the classic Mode (all recipes in normal machines are doable in MV") + .getBoolean(false); + ConfigHandler.creativeScannerID = ConfigHandler.c + .get("System", "Creative Debug Scanner", 0, "ID for the Creative Debug Scanner Block") + .getInt(0); + + ConfigHandler.tooltips = ConfigHandler.c + .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips") + .getBoolean(true); + ConfigHandler.sharedItemStackTooltip = ConfigHandler.c + .get( + "System", + "BartWorksSharedItemStackToolTips", + true, + "If you wish to enable \"Shared Item Stack\" tooltips") + .getBoolean(true); + + ConfigHandler.IDOffset = ConfigHandler.c + .get( + "System", + "ID Offset", + 12600, + "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + .getInt(12600); + ConfigHandler.ezmode = ConfigHandler.c + .get( + "System", + "Mode switch", + false, + "If GTNH is Loaded, this will enable easy recipes, if not, it will enable harder recipes.") + .getBoolean(false); + ConfigHandler.teslastaff = ConfigHandler.c + .get( + "System", + "Enable Teslastaff", + false, + "Enables the Teslastaff, an Item used to destroy Electric Armors") + .getBoolean(false); + ConfigHandler.newStuff = !ConfigHandler.c + .get( + "System", + "Disable non-original-GT-stuff", + false, + "This switch disables my new content, that is not part of the GT2 compat") + .getBoolean(false); + ConfigHandler.BioLab = !ConfigHandler.c + .get( + "System", + "Disable BioLab", + false, + "This switch disables the BioLab, BioVat etc. If you use GT5.08 or equivalent, this needs to be turned off!") + .getBoolean(false); + ConfigHandler.cutoffTier = ConfigHandler.c + .get( + "System", + "Tier to nerf circuits", + 5, + "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", + -1, + VOLTAGE_NAMES.length) + .getInt(5); ConfigHandler.cutoffTier = (ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier); - ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c.get("System", "Disable Extra Gases for EBF", false, "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen").getBoolean(false); - ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c.get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings").getBoolean(false); - ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c.get("System", "Disable Rebolted Casings", false, "This switch disable the generation of rebolted casings").getBoolean(false); - - ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150).getInt(150); - - ConfigHandler.energyPerCell = ConfigHandler.c.get("Multiblocks", "energyPerLESUCell", 1000000, "This will set Up the Energy per LESU Cell", 1000000, Integer.MAX_VALUE).getInt(1000000); - ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get("Multiblocks", "DEHP Direct Steam Mode", false, "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant").getBoolean(false); - ConfigHandler.megaMachinesMax = ConfigHandler.c.get("Multiblocks", "Mega Machines Maximum Recipes per Operation", 256, "This changes the Maximum Recipes per Operation to the specified Valure").getInt(256); - ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c.get("Multiblocks","BioVat Maximum Bonus on Recipes", 1000,"This are the maximum parallel Operations the BioVat can do, when the output is half full.").getInt(1000); - ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c.get("Multiblocks", "Void Miner Blacklist", new String[0], "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32").getStringList()))); - ConfigHandler.disablePistonInEIC = ConfigHandler.c.get("Multiblocks", "Disable Electric Implosion Compressor piston", false, "This switch completely disables piston animation in Electric Implosion Compressor multiblock").getBoolean(false); - - ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c.get("Pollution", "Pollution produced per second by the water pump", ConfigHandler.pollutionHeatedWaterPumpSecond, "How much should the Simple Stirling Water Pump produce pollution per second").getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); - ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get("Pollution", "Pollution produced per tick by the MBF per ingot", ConfigHandler.basePollutionMBFSecond,"How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel").getInt(ConfigHandler.basePollutionMBFSecond); + ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c + .get( + "System", + "Disable Extra Gases for EBF", + false, + "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen") + .getBoolean(false); + ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c + .get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings") + .getBoolean(false); + ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c + .get( + "System", + "Disable Rebolted Casings", + false, + "This switch disable the generation of rebolted casings") + .getBoolean(false); + + ConfigHandler.mbWaterperSec = ConfigHandler.c + .get("Singleblocks", "mL Water per Sec for the StirlingPump", 150) + .getInt(150); + + ConfigHandler.energyPerCell = ConfigHandler.c + .get( + "Multiblocks", + "energyPerLESUCell", + 1000000, + "This will set Up the Energy per LESU Cell", + 1000000, + Integer.MAX_VALUE) + .getInt(1000000); + ConfigHandler.DEHPDirectSteam = ConfigHandler.c + .get( + "Multiblocks", + "DEHP Direct Steam Mode", + false, + "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") + .getBoolean(false); + ConfigHandler.megaMachinesMax = ConfigHandler.c + .get( + "Multiblocks", + "Mega Machines Maximum Recipes per Operation", + 256, + "This changes the Maximum Recipes per Operation to the specified Valure") + .getInt(256); + ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c + .get( + "Multiblocks", + "BioVat Maximum Bonus on Recipes", + 1000, + "This are the maximum parallel Operations the BioVat can do, when the output is half full.") + .getInt(1000); + ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ConfigHandler.c + .get( + "Multiblocks", + "Void Miner Blacklist", + new String[0], + "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") + .getStringList()))); + ConfigHandler.disablePistonInEIC = ConfigHandler.c + .get( + "Multiblocks", + "Disable Electric Implosion Compressor piston", + false, + "This switch completely disables piston animation in Electric Implosion Compressor multiblock") + .getBoolean(false); + + ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c + .get( + "Pollution", + "Pollution produced per second by the water pump", + ConfigHandler.pollutionHeatedWaterPumpSecond, + "How much should the Simple Stirling Water Pump produce pollution per second") + .getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); + ConfigHandler.basePollutionMBFSecond = ConfigHandler.c + .get( + "Pollution", + "Pollution produced per tick by the MBF per ingot", + ConfigHandler.basePollutionMBFSecond, + "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") + .getInt(ConfigHandler.basePollutionMBFSecond); if (ConfigHandler.IDOffset == 0) { ConfigHandler.IDOffset = 12600; - ConfigHandler.c.get("System", "ID Offset", 12600, "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS").set(12600); + ConfigHandler.c + .get( + "System", + "ID Offset", + 12600, + "ID Offset for this mod. This Mod uses " + ConfigHandler.IDU + + " IDs. DO NOT CHANGE IF YOU DONT KNOW WHAT THIS IS") + .set(12600); } - ConfigHandler.GTppLogDisabler = ConfigHandler.c.get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.").getBoolean(false); - API_ConfigValues.debugLog = ConfigHandler.c.get("System", "Enable Debug Log", false, "Enables or Disables the debug log.").getBoolean(false); + ConfigHandler.GTppLogDisabler = ConfigHandler.c + .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.") + .getBoolean(false); + API_ConfigValues.debugLog = ConfigHandler.c + .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.") + .getBoolean(false); for (int i = 0; i < BWCoreTransformer.CLASSESBEEINGTRANSFORMED.length; i++) - BWCoreTransformer.shouldTransform[i] = ConfigHandler.c.get("ASM fixes", BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], true).getBoolean(true); + BWCoreTransformer.shouldTransform[i] = ConfigHandler.c + .get( + "ASM fixes", + BWCoreTransformer.DESCRIPTIONFORCONFIG[i] + " in class: " + + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[i], + true) + .getBoolean(true); ConfigHandler.enabledPatches = new boolean[BWCoreTransformer.shouldTransform.length]; - ConfigHandler.enabledPatches = Arrays.copyOf(BWCoreTransformer.shouldTransform,BWCoreTransformer.shouldTransform.length); - ConfigHandler.ross128BID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b").getInt(-64); - ConfigHandler.ross128BAID = ConfigHandler.c.get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)").getInt(-63); - ConfigHandler.ross128btier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b").getInt(3); - ConfigHandler.ross128batier = ConfigHandler.c.get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a").getInt(3); - ConfigHandler.ross128bRuinChance = ConfigHandler.c.get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.").getInt(512); - ConfigHandler.Ross128Enabled = ConfigHandler.c.get("CrossMod Interactions", "Galacticraft - Activate Ross128 System", true, "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION").getBoolean(true); - ConfigHandler.landerType = ConfigHandler.c.get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander").getInt(3); - ConfigHandler.disableMagicalForest = ConfigHandler.c.get("CrossMod Interactions", "Disable Magical Forest - Ross128b", false, "True disables the magical Forest Biome on Ross for more performance during World generation.").getBoolean(false); - - ConfigHandler.maxTierRoss = (byte) ConfigHandler.c.get("Ross Ruin Metas", "A_Ruin Machine Tiers",6,"", 0, VOLTAGE_NAMES.length).getInt(6); + ConfigHandler.enabledPatches = + Arrays.copyOf(BWCoreTransformer.shouldTransform, BWCoreTransformer.shouldTransform.length); + ConfigHandler.ross128BID = ConfigHandler.c + .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b") + .getInt(-64); + ConfigHandler.ross128BAID = ConfigHandler.c + .get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)") + .getInt(-63); + ConfigHandler.ross128btier = ConfigHandler.c + .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b") + .getInt(3); + ConfigHandler.ross128batier = ConfigHandler.c + .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a") + .getInt(3); + ConfigHandler.ross128bRuinChance = ConfigHandler.c + .get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.") + .getInt(512); + ConfigHandler.Ross128Enabled = ConfigHandler.c + .get( + "CrossMod Interactions", + "Galacticraft - Activate Ross128 System", + true, + "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION") + .getBoolean(true); + ConfigHandler.landerType = ConfigHandler.c + .get( + "CrossMod Interactions", + "LanderType", + 3, + "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander") + .getInt(3); + ConfigHandler.disableMagicalForest = ConfigHandler.c + .get( + "CrossMod Interactions", + "Disable Magical Forest - Ross128b", + false, + "True disables the magical Forest Biome on Ross for more performance during World generation.") + .getBoolean(false); + + ConfigHandler.maxTierRoss = (byte) ConfigHandler.c + .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length) + .getInt(6); ConfigHandler.metasForTiers = new int[4][maxTierRoss][]; for (int i = 0; i < 4; i++) { if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length) ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0]; for (int j = 0; j < maxTierRoss; j++) - ConfigHandler.metasForTiers[i][j] = ConfigHandler.c.get("Ross Ruin Metas", j+"_Ruin " + names[i] +" Tier " + VOLTAGE_NAMES[j], ConfigHandler.defaultMetasForTiers[i][j]).getIntList(); + ConfigHandler.metasForTiers[i][j] = ConfigHandler.c + .get( + "Ross Ruin Metas", + j + "_Ruin " + names[i] + " Tier " + VOLTAGE_NAMES[j], + ConfigHandler.defaultMetasForTiers[i][j]) + .getIntList(); } ConfigHandler.setUpComments(); - if (ConfigHandler.c.hasChanged()) - ConfigHandler.c.save(); + if (ConfigHandler.c.hasChanged()) ConfigHandler.c.save(); } private static void setUpComments() { @@ -192,7 +402,9 @@ public class ConfigHandler { ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multiblock Options can be set here."); ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); - ConfigHandler.c.addCustomCategoryComment("CrossMod Interactions", "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); + ConfigHandler.c.addCustomCategoryComment( + "CrossMod Interactions", + "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here."); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index 28f7087956..e0565ec316 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -31,6 +31,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.entity.player.EntityPlayer; @@ -39,13 +41,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; -import java.util.Arrays; -import java.util.List; - public class BW_ItemBlocks extends ItemBlock { - private final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - private final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + private final String mNoMobsToolTip = + GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + private final String mNoTileEntityToolTip = + GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public BW_ItemBlocks(Block par1) { super(par1); @@ -70,14 +71,14 @@ public class BW_ItemBlocks extends ItemBlock { public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { byte tier = BorosilicateGlass.getTier(this.field_150939_a, aStack.getItemDamage()); if (tier >= 0) { - aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(tier) + GT_Values.VN[tier]); + aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(tier) + + GT_Values.VN[tier]); } if (this.field_150939_a instanceof ITileAddsInformation) { aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); } aList.add(this.mNoMobsToolTip); - if (!(this.field_150939_a instanceof ITileEntityProvider)) - aList.add(this.mNoTileEntityToolTip); + if (!(this.field_150939_a instanceof ITileEntityProvider)) aList.add(this.mNoTileEntityToolTip); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index ff9f43cdbf..dc606f9e73 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -27,6 +27,7 @@ import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.core.WorldData; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -35,8 +36,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.List; - public class BW_SimpleWindMeter extends Item { public BW_SimpleWindMeter() { @@ -58,20 +57,33 @@ public class BW_SimpleWindMeter extends Item { public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); - list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + list.add(StatCollector.translateToLocal("tooltip.windmeter.1.name") + " " + + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); list.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { - if (entityPlayer.worldObj.isRemote || world == null || WorldData.get(world) == null || WorldData.get(world).windSim == null) - return itemStack; + if (entityPlayer.worldObj.isRemote + || world == null + || WorldData.get(world) == null + || WorldData.get(world).windSim == null) return itemStack; float windStrength = (float) WorldData.get(world).windSim.getWindAt(entityPlayer.posY); - String windS = windStrength < 1f ? StatCollector.translateToLocal("tooltip.windmeter.2.name") : windStrength < 10f ? StatCollector.translateToLocal("tooltip.windmeter.3.name") : windStrength < 20f ? StatCollector.translateToLocal("tooltip.windmeter.4.name") : windStrength < 30f ? StatCollector.translateToLocal("tooltip.windmeter.5.name") : windStrength < 50f ? StatCollector.translateToLocal("tooltip.windmeter.6.name") : StatCollector.translateToLocal("tooltip.windmeter.7.name"); - entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); + String windS = windStrength < 1f + ? StatCollector.translateToLocal("tooltip.windmeter.2.name") + : windStrength < 10f + ? StatCollector.translateToLocal("tooltip.windmeter.3.name") + : windStrength < 20f + ? StatCollector.translateToLocal("tooltip.windmeter.4.name") + : windStrength < 30f + ? StatCollector.translateToLocal("tooltip.windmeter.5.name") + : windStrength < 50f + ? StatCollector.translateToLocal("tooltip.windmeter.6.name") + : StatCollector.translateToLocal("tooltip.windmeter.7.name"); + entityPlayer.addChatMessage( + new ChatComponentText(StatCollector.translateToLocal("tooltip.windmeter.8.name") + " " + windS + ".")); itemStack.damageItem(1, entityPlayer); return itemStack; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 9731b4da3b..f2559f3066 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.items; +import static ic2.api.item.IKineticRotor.GearboxType.WATER; +import static ic2.api.item.IKineticRotor.GearboxType.WIND; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; @@ -29,6 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.IKineticRotor; import ic2.core.block.kineticgenerator.gui.GuiWaterKineticGenerator; import ic2.core.block.kineticgenerator.gui.GuiWindKineticGenerator; +import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -37,11 +41,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import java.util.List; - -import static ic2.api.item.IKineticRotor.GearboxType.WATER; -import static ic2.api.item.IKineticRotor.GearboxType.WIND; - public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final int[] DiaMinMax = new int[3]; @@ -50,7 +49,16 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { private final ResourceLocation tex; private final String itemTex; - public BW_Stonage_Rotors(int diameter, float eff, int min, int max, int durability, IKineticRotor.GearboxType type, ResourceLocation tex, String Name, String itemTex) { + public BW_Stonage_Rotors( + int diameter, + float eff, + int min, + int max, + int durability, + IKineticRotor.GearboxType type, + ResourceLocation tex, + String Name, + String itemTex) { this.DiaMinMax[0] = diameter; this.DiaMinMax[1] = min; this.DiaMinMax[2] = max; @@ -70,7 +78,8 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { - info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); + info.add(StatCollector.translateToLocalFormatted( + "ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; if (Minecraft.getMinecraft().currentScreen instanceof GuiWaterKineticGenerator) { type = WATER; @@ -78,7 +87,8 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { type = WIND; } info.add(StatCollector.translateToLocal("tooltip.rotor.0.name") + " " + this.DiaMinMax[0]); - info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); + info.add(StatCollector.translateToLocal("tooltip.rotor.1.name") + " " + + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); info.add(StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + this.eff); if (type != null) { info.add(StatCollector.translateToLocal(("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type)))); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index c65f9c42ad..fde6eaa2f4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -31,6 +31,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.items.GT_Generic_Item; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -39,8 +40,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.List; - public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem { private static final int COST_PER_USE = 100; @@ -56,8 +55,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem (s, p) -> { ElectricItem.manager.use(s, COST_PER_USE, p); return s; - } - ); + }); } @Override @@ -65,7 +63,10 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) - aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " + (aStack.getTagCompound().getBoolean("HasChip") ? StatCollector.translateToLocal("tooltip.bw.yes.name") : StatCollector.translateToLocal("tooltip.bw.no.name"))); + aList.add(StatCollector.translateToLocal("tooltip.cp.0.name") + " " + + (aStack.getTagCompound().getBoolean("HasChip") + ? StatCollector.translateToLocal("tooltip.bw.yes.name") + : StatCollector.translateToLocal("tooltip.bw.no.name"))); aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @@ -124,5 +125,4 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem public double getTransferLimit(ItemStack itemStack) { return GT_Values.V[1]; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index 15e16008ad..c116290257 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -27,13 +27,12 @@ import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.items.GT_Generic_Item; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import java.util.List; - public class GT_Destructopack_Item extends GT_Generic_Item { public GT_Destructopack_Item() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index a1b222f7c3..d7e0cf19f5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -30,6 +30,9 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.GT_Values; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -46,17 +49,16 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - private static Set<Block> mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private static Set<Block> mineableBlocks = + Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; + @SideOnly(Side.CLIENT) private IIcon icon; + private final int multi; public GT_Rockcutter_Item(int aTier) { @@ -73,6 +75,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { this.setNoRepair(); this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); @@ -89,12 +92,23 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } } - public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + public boolean onItemUse( + ItemStack aStack, + EntityPlayer aPlayer, + World p_77648_3_, + int p_77648_4_, + int p_77648_5_, + int p_77648_6_, + int p_77648_7_, + float p_77648_8_, + float p_77648_9_, + float p_77648_10_) { ElectricItem.manager.use(aStack, 0, aPlayer); return false; } - public boolean onBlockDestroyed(ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { + public boolean onBlockDestroyed( + ItemStack var1, World var2, Block var3, int var4, int var5, int var6, EntityLivingBase var7) { ElectricItem.manager.use(var1, 0, var7); if (ElectricItem.manager.canUse(var1, 500 * this.multi)) { ElectricItem.manager.use(var1, 500 * this.multi, var7); @@ -106,7 +120,14 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) { - return par1Block.getMaterial().equals(Material.glass) || par1Block.getMaterial().equals(Material.clay) || par1Block.getMaterial().equals(Material.packedIce) || par1Block.getMaterial().equals(Material.ice) || par1Block.getMaterial().equals(Material.sand) || par1Block.getMaterial().equals(Material.ground) || par1Block.getMaterial().equals(Material.rock) || mineableBlocks.contains(par1Block); + return par1Block.getMaterial().equals(Material.glass) + || par1Block.getMaterial().equals(Material.clay) + || par1Block.getMaterial().equals(Material.packedIce) + || par1Block.getMaterial().equals(Material.ice) + || par1Block.getMaterial().equals(Material.sand) + || par1Block.getMaterial().equals(Material.ground) + || par1Block.getMaterial().equals(Material.rock) + || mineableBlocks.contains(par1Block); } @SideOnly(Side.CLIENT) @@ -123,7 +144,6 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } } - @Override public boolean canProvideEnergy(ItemStack itemStack) { return false; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index 9b4c1ba51c..00a10b7c9e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -29,6 +29,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import java.util.List; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -42,14 +44,12 @@ import net.minecraft.item.ItemTool; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; -import java.util.List; -import java.util.Set; - public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { private static final Set<Block> effective = Sets.newHashSet(Blocks.web); private final double mCharge; private final double mTransfer; public int mTier; + @SideOnly(Side.CLIENT) private IIcon icon; @@ -77,7 +77,8 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { EntityLiving tTarget = (EntityLiving) aTarget; ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { - if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { + if (tTarget.getEquipmentInSlot(i) != null + && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { tTarget.setCurrentItemOrArmor(i, null); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index 8d0dfcbb60..ad2a780136 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -23,12 +23,11 @@ package com.github.bartimaeusnek.bartworks.common.items; import com.github.bartimaeusnek.bartworks.MainMod; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; -import java.util.List; - public class LabModule extends SimpleSubItemClass { public LabModule(String[] tex) { super(tex); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index c98bdf232a..f22ebf56aa 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -22,12 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.items; +import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.BioCulture; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -35,10 +38,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.common.loaders.BioItemList.*; - public class LabParts extends SimpleSubItemClass { public LabParts(String[] tex) { @@ -49,12 +48,12 @@ public class LabParts extends SimpleSubItemClass { @Override public EnumRarity getRarity(ItemStack itemStack) { - if (itemStack == null || itemStack.getTagCompound() == null) - return EnumRarity.common; + if (itemStack == null || itemStack.getTagCompound() == null) return EnumRarity.common; switch (itemStack.getItemDamage()) { case 0: - return BW_Util.getRarityFromByte(itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); + return BW_Util.getRarityFromByte( + itemStack.getTagCompound().getCompoundTag("DNA").getByte("Rarity")); case 1: case 2: return BW_Util.getRarityFromByte(itemStack.getTagCompound().getByte("Rarity")); @@ -66,7 +65,10 @@ public class LabParts extends SimpleSubItemClass { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int p_82790_2_) { - if (stack.getItemDamage() == 0 && stack.getTagCompound() != null && stack.getTagCompound().getIntArray("Color") != null && stack.getTagCompound().getIntArray("Color").length > 0) { + if (stack.getItemDamage() == 0 + && stack.getTagCompound() != null + && stack.getTagCompound().getIntArray("Color") != null + && stack.getTagCompound().getIntArray("Color").length > 0) { int[] rgb = stack.getTagCompound().getIntArray("Color"); return BW_ColorUtil.getColorFromRGBArray(rgb); } @@ -76,8 +78,7 @@ public class LabParts extends SimpleSubItemClass { @Override @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { - if (itemStack == null) - return; + if (itemStack == null) return; if (itemStack.getTagCompound() == null) { switch (itemStack.getItemDamage()) { @@ -107,16 +108,22 @@ public class LabParts extends SimpleSubItemClass { switch (itemStack.getItemDamage()) { case 0: - list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); + list.add(StatCollector.translateToLocal("tooltip.labparts.5.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); if (!itemStack.getTagCompound().getBoolean("Breedable")) { list.add(StatCollector.translateToLocal("tooltip.labparts.6.name")); } break; case 1: - list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); + list.add(StatCollector.translateToLocal("tooltip.labparts.7.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; case 2: - list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + itemStack.getTagCompound().getString("Name") + (culture != null ? " ("+culture.getLocalisedName()+")" : "")); + list.add(StatCollector.translateToLocal("tooltip.labparts.8.name") + " " + + itemStack.getTagCompound().getString("Name") + + (culture != null ? " (" + culture.getLocalisedName() + ")" : "")); break; default: break; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index 2b9cb9a994..1a45731e6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -38,6 +38,5 @@ public class SimpleIconItem extends Item { @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("bartworks:" + this.tex); - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index a363ab6811..0ae4dc469a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -33,11 +34,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import java.util.List; - public class SimpleSubItemClass extends Item { @SideOnly(Side.CLIENT) protected IIcon[] itemIcon; + String[] tex; public SimpleSubItemClass(String... tex) { @@ -52,7 +52,6 @@ public class SimpleSubItemClass extends Item { for (int i = 0; i < this.tex.length; i++) { this.itemIcon[i] = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.tex[i]); } - } @Override @@ -72,17 +71,13 @@ public class SimpleSubItemClass extends Item { @SideOnly(Side.CLIENT) public IIcon getIconFromDamage(int p_77617_1_) { - if (p_77617_1_ < this.tex.length) - return this.itemIcon[p_77617_1_]; - else - return this.itemIcon[0]; + if (p_77617_1_ < this.tex.length) return this.itemIcon[p_77617_1_]; + else return this.itemIcon[0]; } public String getUnlocalizedName(ItemStack p_77667_1_) { if (p_77667_1_.getItemDamage() < this.tex.length) return "item." + this.tex[p_77667_1_.getItemDamage()].replaceAll("/", "."); - else - return "WrongDamageItemDestroyIt"; + else return "WrongDamageItemDestroyIt"; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java index 86d5239eae..bcb2052d57 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ArtificialMicaLine.java @@ -16,34 +16,172 @@ import net.minecraftforge.fluids.FluidStack; public class ArtificialMicaLine { public static void runArtificialMicaRecipe() { - //Mg + O = MgO - GT_Values.RA.addChemicalRecipe(Materials.Magnesium.getDust(1), null, Materials.Oxygen.getGas(1000), null, Materials.Magnesia.getDust(2), 40, 8); - //Si + 6HF = H2SiF6 + 4H - GT_Values.RA.addChemicalRecipe(Materials.Silicon.getDust(1), Materials.Empty.getCells(4), Materials.HydrofluoricAcid.getFluid(6000), WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.Hydrogen.getCells(4), 400, 120); - //K + Cl = KCl - GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(1), GT_Utility.getIntegratedCircuit(2), Materials.Chlorine.getGas(1000), null, Materials.RockSalt.getDust(2), 20, 8); - //2KCl + H2SiF6 = 2HCl + K2SiF6 - GT_Values.RA.addMixerRecipe(Materials.RockSalt.getDust(4), null, null, null, WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), Materials.HydrochloricAcid.getGas(2000), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9), 20, 8); - //2K + CO2 + O = K2CO3 - GT_Values.RA.addChemicalRecipe(Materials.Potassium.getDust(2), Materials.CarbonDioxide.getCells(1), Materials.Oxygen.getGas(1000), null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1), 40, 8); - //K2O + CO2 = K2CO3 - GT_Values.RA.addChemicalRecipe(Materials.Potash.getDust(3), Materials.CarbonDioxide.getCells(1), null, null, WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), Materials.Empty.getCells(1), 40, 8); - //55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.QuartzSand.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 400, 120); - //55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.Quartzite.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); - GT_Values.RA.addMixerRecipe(Materials.NetherQuartz.getDust(55), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), null, 600, 120); - //62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust - GT_Values.RA.addMixerRecipe(Materials.CertusQuartz.getDust(62), WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), null, GT_Utility.getIntegratedCircuit(4), null, null, null, null, null, WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, null, 600, 120); - //MgO(s) = MgO(l) - GT_Values.RA.addFluidExtractionRecipe(Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); - //27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) - GT_Values.RA.addBlastRecipe(WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), null, BW_GT_MaterialReference.Magnesia.getMolten(720), WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), Materials.Glass.getDust(1), null, 600, 480, 1700); - //144Fluorophlogopite(l) = Fluorophlogopite - GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe(false, new ItemStack[]{ItemList.Shape_Mold_Plate.get(0)}, new ItemStack[]{WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, null, null, new FluidStack[]{WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, null, 10, 120, 0)); - //Fluorophlogopite = 4Insulator Foil + // Mg + O = MgO + GT_Values.RA.addChemicalRecipe( + Materials.Magnesium.getDust(1), + null, + Materials.Oxygen.getGas(1000), + null, + Materials.Magnesia.getDust(2), + 40, + 8); + // Si + 6HF = H2SiF6 + 4H + GT_Values.RA.addChemicalRecipe( + Materials.Silicon.getDust(1), + Materials.Empty.getCells(4), + Materials.HydrofluoricAcid.getFluid(6000), + WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), + Materials.Hydrogen.getCells(4), + 400, + 120); + // K + Cl = KCl + GT_Values.RA.addChemicalRecipe( + Materials.Potassium.getDust(1), + GT_Utility.getIntegratedCircuit(2), + Materials.Chlorine.getGas(1000), + null, + Materials.RockSalt.getDust(2), + 20, + 8); + // 2KCl + H2SiF6 = 2HCl + K2SiF6 + GT_Values.RA.addMixerRecipe( + Materials.RockSalt.getDust(4), + null, + null, + null, + WerkstoffLoader.HexafluorosilicicAcid.getFluidOrGas(1000), + Materials.HydrochloricAcid.getGas(2000), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 9), + 20, + 8); + // 2K + CO2 + O = K2CO3 + GT_Values.RA.addChemicalRecipe( + Materials.Potassium.getDust(2), + Materials.CarbonDioxide.getCells(1), + Materials.Oxygen.getGas(1000), + null, + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), + Materials.Empty.getCells(1), + 40, + 8); + // K2O + CO2 = K2CO3 + GT_Values.RA.addChemicalRecipe( + Materials.Potash.getDust(3), + Materials.CarbonDioxide.getCells(1), + null, + null, + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 6), + Materials.Empty.getCells(1), + 40, + 8); + // 55Quartz Dust + 20K2SiF6 + 12Al2O3 + 4K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe( + Materials.QuartzSand.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), + null, + null, + 400, + 120); + // 55Quartzite/Nether Quartz Dust + 20K2SiF6 + 57Al2O3 + 4K2CO3 = 136Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe( + Materials.Quartzite.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), + null, + 600, + 120); + GT_Values.RA.addMixerRecipe( + Materials.NetherQuartz.getDust(55), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 20), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 57), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 4), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 8), + null, + 600, + 120); + // 62Certus Quartz Dust + 10K2SiF6 + 12Al2O3 + 7K2CO3 = 91Raw Fluorophlogopite Dust + GT_Values.RA.addMixerRecipe( + Materials.CertusQuartz.getDust(62), + WerkstoffLoader.Potassiumfluorosilicate.get(OrePrefixes.dust, 10), + WerkstoffLoader.Alumina.get(OrePrefixes.dust, 12), + WerkstoffLoader.PotassiumCarbonate.get(OrePrefixes.dust, 7), + null, + GT_Utility.getIntegratedCircuit(4), + null, + null, + null, + null, + null, + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 64), + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), + null, + null, + 600, + 120); + // MgO(s) = MgO(l) + GT_Values.RA.addFluidExtractionRecipe( + Materials.Magnesia.getDust(1), null, Materials.Magnesia.getMolten(144), 0, 20, 120); + // 27Raw Fluorophlogopite Dust + 720MgO(l) = 4608Fluorophlogopite(l) + GT_Values.RA.addBlastRecipe( + WerkstoffLoader.RawFluorophlogopite.get(OrePrefixes.dust, 27), + null, + BW_GT_MaterialReference.Magnesia.getMolten(720), + WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(4608), + Materials.Glass.getDust(1), + null, + 600, + 480, + 1700); + // 144Fluorophlogopite(l) = Fluorophlogopite + GT_Recipe.GT_Recipe_Map.sVacuumRecipes.addRecipe(new GT_Recipe( + false, + new ItemStack[] {ItemList.Shape_Mold_Plate.get(0)}, + new ItemStack[] {WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1)}, + null, + null, + new FluidStack[] {WerkstoffLoader.HotFluorophlogopite.getFluidOrGas(144)}, + null, + 10, + 120, + 0)); + // Fluorophlogopite = 4Insulator Foil if (LoaderReference.dreamcraft) - GT_Values.RA.addBenderRecipe(WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), GT_Utility.getIntegratedCircuit(1), GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), 10, 600); + GT_Values.RA.addBenderRecipe( + WerkstoffLoader.Fluorophlogopite.get(OrePrefixes.plate, 1), + GT_Utility.getIntegratedCircuit(1), + GT_ModHandler.getModItem("dreamcraft", "item.MicaInsulatorFoil", 4), + 10, + 600); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index 96fe2a25c5..dca6662c2e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -31,14 +31,13 @@ import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; import ic2.core.Ic2Items; +import java.lang.reflect.Field; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; - /** * This class gets injected into GT via ASM! * DO NOT CALL IT YOURSELF! @@ -49,10 +48,10 @@ public class BeforeGTPreload implements Runnable { @Override public void run() { - if (didrun) - return; - //fixing BorosilicateGlass... -_-' - Materials.BorosilicateGlass.add(SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); + if (didrun) return; + // fixing BorosilicateGlass... -_-' + Materials.BorosilicateGlass.add( + SubTag.CRYSTAL, SubTag.NO_SMASHING, SubTag.NO_RECYCLING, SubTag.SMELTING_TO_FLUID); Field activeContainer = FieldUtils.getDeclaredField(LoadController.class, "activeContainer", true); ModContainer bartworks = null; @@ -73,13 +72,11 @@ public class BeforeGTPreload implements Runnable { if (mod.getModId().equals("bartworks")) { bartworks = mod; } - if (bartworks != null) - break; + if (bartworks != null) break; } if (bartworks == null || gregtech == null) FMLCommonHandler.instance().exitJava(-1, true); - try { activeContainer.set(modController, bartworks); } catch (IllegalAccessException e) { @@ -91,7 +88,9 @@ public class BeforeGTPreload implements Runnable { Block[] bw_glasses; try { - bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry").getField("bw_glasses").get(null); + bw_glasses = (Block[]) Class.forName("com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry") + .getField("bw_glasses") + .get(null); GameRegistry.registerBlock(bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, Short.MAX_VALUE)); OreDictionary.registerOre("blockGlassHV", new ItemStack(bw_glasses[0], 1, 0)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 1ece4fd6cb..6d327f594b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -26,20 +26,25 @@ import com.github.bartimaeusnek.bartworks.util.BioCulture; import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; -import net.minecraft.item.EnumRarity; - import java.awt.*; - +import net.minecraft.item.EnumRarity; public class BioCultureLoader { - public static final BioData BIO_DATA_BETA_LACMATASE = BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); - private static final BioData BIO_DATA_YEAST = BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); - private static final BioDNA BIO_DNA_WHINE_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); - private static final BioDNA BIO_DNA_BEER_YEAST = BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); - private static final BioData eColiData = BioData.createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); - private static final BioDNA BIO_DNA_ANAEROBIC_OIL = BioDNA.createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); - private static final BioData BIO_DATA_ANAEROBIC_OIL = BioData.createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); + public static final BioData BIO_DATA_BETA_LACMATASE = + BioData.createAndRegisterBioData("beta-Lactamase", EnumRarity.uncommon, 10000, 0); + private static final BioData BIO_DATA_YEAST = + BioData.createAndRegisterBioData("Saccharomyces cerevisiae", EnumRarity.common); + private static final BioDNA BIO_DNA_WHINE_YEAST = + BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var bayanus", EnumRarity.uncommon); + private static final BioDNA BIO_DNA_BEER_YEAST = + BioDNA.createAndRegisterBioDNA("Saccharomyces cerevisiae var cerevisiae", EnumRarity.uncommon); + private static final BioData eColiData = + BioData.createAndRegisterBioData("Escherichia koli", EnumRarity.uncommon, 10000, 0); + private static final BioDNA BIO_DNA_ANAEROBIC_OIL = + BioDNA.createAndRegisterBioDNA("Pseudomonas Veronii", EnumRarity.uncommon); + private static final BioData BIO_DATA_ANAEROBIC_OIL = + BioData.createAndRegisterBioData("Pseudomonas Veronii", EnumRarity.uncommon, 5000, 1); public static BioCulture CommonYeast; public static BioCulture WhineYeast; public static BioCulture BeerYeast; @@ -48,15 +53,52 @@ public class BioCultureLoader { public static BioCulture anaerobicOil; public static BioCulture generalPurposeFermentingBacteria; - public static void run() { - BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), true); - BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var bayanus", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), BioCultureLoader.BIO_DNA_WHINE_YEAST,EnumRarity.uncommon, true); - BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture(new Color(255, 248, 200), "Saccharomyces cerevisiae var cerevisiae", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), BioCultureLoader.BIO_DNA_BEER_YEAST, EnumRarity.uncommon,true); - BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture(new Color(110, 40, 25), "Escherichia cadaver", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), false); - BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture(new Color(149, 132, 75), "Escherichia koli", BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), BioDNA.convertDataToDNA(BioCultureLoader.eColiData), true); - BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture(new Color(0, 0, 0), "Pseudomonas Veronii", BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), true); - BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture(new Color(127, 69, 26), "Saccharomyces escherichia", BioCultureLoader.CommonYeast.getPlasmid(), BioCultureLoader.eColi.getdDNA(), EnumRarity.epic,true); + BioCultureLoader.CommonYeast = BioCulture.createAndRegisterBioCulture( + new Color(255, 248, 200), + "Saccharomyces cerevisiae", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_YEAST), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_YEAST), + true); + BioCultureLoader.WhineYeast = BioCulture.createAndRegisterBioCulture( + new Color(255, 248, 200), + "Saccharomyces cerevisiae var bayanus", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_WHINE_YEAST), + BioCultureLoader.BIO_DNA_WHINE_YEAST, + EnumRarity.uncommon, + true); + BioCultureLoader.BeerYeast = BioCulture.createAndRegisterBioCulture( + new Color(255, 248, 200), + "Saccharomyces cerevisiae var cerevisiae", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_BEER_YEAST), + BioCultureLoader.BIO_DNA_BEER_YEAST, + EnumRarity.uncommon, + true); + BioCultureLoader.rottenFleshBacteria = BioCulture.createAndRegisterBioCulture( + new Color(110, 40, 25), + "Escherichia cadaver", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DATA_BETA_LACMATASE), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_BETA_LACMATASE), + false); + BioCultureLoader.eColi = BioCulture.createAndRegisterBioCulture( + new Color(149, 132, 75), + "Escherichia koli", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.eColiData), + BioDNA.convertDataToDNA(BioCultureLoader.eColiData), + true); + BioCultureLoader.anaerobicOil = BioCulture.createAndRegisterBioCulture( + new Color(0, 0, 0), + "Pseudomonas Veronii", + BioPlasmid.convertDataToPlasmid(BioCultureLoader.BIO_DNA_ANAEROBIC_OIL), + BioDNA.convertDataToDNA(BioCultureLoader.BIO_DATA_ANAEROBIC_OIL), + true); + BioCultureLoader.generalPurposeFermentingBacteria = BioCulture.createAndRegisterBioCulture( + new Color(127, 69, 26), + "Saccharomyces escherichia", + BioCultureLoader.CommonYeast.getPlasmid(), + BioCultureLoader.eColi.getdDNA(), + EnumRarity.epic, + true); BioCultureLoader.CommonYeast.setLocalisedName("Common Yeast"); BioCultureLoader.WhineYeast.setLocalisedName("Whine Yeast"); @@ -66,5 +108,4 @@ public class BioCultureLoader { BioCultureLoader.anaerobicOil.setLocalisedName("Anaerobic Oil Bacteria"); BioCultureLoader.generalPurposeFermentingBacteria.setLocalisedName("General Purpose Fermenting Bacteria"); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 72189ce4da..8addea861c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -29,22 +29,34 @@ import com.github.bartimaeusnek.bartworks.util.BioDNA; import com.github.bartimaeusnek.bartworks.util.BioData; import com.github.bartimaeusnek.bartworks.util.BioPlasmid; import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - import java.util.Collection; import java.util.HashSet; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; public class BioItemList { - private BioItemList() { - } - - private static final Item mItemBioLabParts = new LabModule(new String[]{"DNAExtractionModule", "PCRThermoclyclingModule", "PlasmidSynthesisModule", "TransformationModule", "ClonalCellularSynthesisModule"}); - public static final ItemStack[] mBioLabParts = {new ItemStack(BioItemList.mItemBioLabParts), new ItemStack(BioItemList.mItemBioLabParts, 1, 1), new ItemStack(BioItemList.mItemBioLabParts, 1, 2), new ItemStack(BioItemList.mItemBioLabParts, 1, 3), new ItemStack(BioItemList.mItemBioLabParts, 1, 4)}; - private static final Item vanillaBioLabParts = new LabParts(new String[]{"petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane"}); - - public static void registerBioItems(){ + private BioItemList() {} + + private static final Item mItemBioLabParts = new LabModule(new String[] { + "DNAExtractionModule", + "PCRThermoclyclingModule", + "PlasmidSynthesisModule", + "TransformationModule", + "ClonalCellularSynthesisModule" + }); + public static final ItemStack[] mBioLabParts = { + new ItemStack(BioItemList.mItemBioLabParts), + new ItemStack(BioItemList.mItemBioLabParts, 1, 1), + new ItemStack(BioItemList.mItemBioLabParts, 1, 2), + new ItemStack(BioItemList.mItemBioLabParts, 1, 3), + new ItemStack(BioItemList.mItemBioLabParts, 1, 4) + }; + private static final Item vanillaBioLabParts = new LabParts(new String[] { + "petriDish", "DNASampleFlask", "PlasmidCell", "DetergentPowder", "Agarose", "IncubationModule", "PlasmaMembrane" + }); + + public static void registerBioItems() { GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts"); } @@ -74,16 +86,14 @@ public class BioItemList { } public static ItemStack getPetriDish(BioCulture Culture) { - if (Culture == null) - return new ItemStack(BioItemList.vanillaBioLabParts); + if (Culture == null) return new ItemStack(BioItemList.vanillaBioLabParts); ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts); ret.setTagCompound(BioCulture.getNBTTagFromCulture(Culture)); return ret; } public static ItemStack getDNASampleFlask(BioDNA dna) { - if (dna == null) - return new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); + if (dna == null) return new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 1); ret.setTagCompound(BioData.getNBTTagFromBioData(dna)); @@ -91,8 +101,7 @@ public class BioItemList { } public static ItemStack getPlasmidCell(BioPlasmid plasmid) { - if (plasmid == null) - return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); + if (plasmid == null) return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); ItemStack ret = new ItemStack(BioItemList.vanillaBioLabParts, 1, 2); ret.setTagCompound(BioData.getNBTTagFromBioData(plasmid)); return ret; @@ -109,8 +118,7 @@ public class BioItemList { * @return the selected Item */ public static ItemStack getOther(int selection) { - if (selection < 1 || selection > 4) - return null; + if (selection < 1 || selection > 4) return null; return new ItemStack(BioItemList.vanillaBioLabParts, 1, 2 + selection); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index bfb6c5e3fd..dcc43adcbc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -37,6 +37,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -45,172 +46,291 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.List; - public class BioRecipeLoader { @SuppressWarnings("deprecation") public static void run() { - //DNAExtractionModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[0], - RecipeLoader.BITSD, - new Object[]{ - "TET", - "CFC", - "TST", - 'T', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - 'E', ItemList.Emitter_EV.get(1L), - 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), - 'S', ItemList.Sensor_EV.get(1L), - 'F', ItemList.Field_Generator_EV.get(1L) - } - ); - - //PCRThermoclyclingModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[1], - RecipeLoader.BITSD, - new Object[]{ - "NEN", - "CFC", - "NSN", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), - 'E', ItemList.Emitter_EV.get(1L), - 'C', GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), - 'S', ItemList.Sensor_EV.get(1L), - 'F', ItemList.Field_Generator_EV.get(1L) - } - ); - - //PlasmidSynthesisModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[2], - RecipeLoader.BITSD, - new Object[]{ - "SFE", - "CPC", - "NFN", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), - 'C', "circuit" + Materials.Data, - 'F', ItemList.Field_Generator_EV.get(1L), - 'E', ItemList.Emitter_EV.get(1L), - 'S', ItemList.Sensor_EV.get(1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - } - ); - //TransformationModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[3], - RecipeLoader.BITSD, - new Object[]{ - "SFE", - "CPC", - "NFN", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), - 'C', "circuit" + Materials.Master, - 'F', ItemList.Field_Generator_LuV.get(1L), - 'E', ItemList.Emitter_LuV.get(1L), - 'S', ItemList.Sensor_LuV.get(1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), - } - ); - - //ClonalCellularSynthesisModule - GT_ModHandler.addCraftingRecipe( - BioItemList.mBioLabParts[4], - RecipeLoader.BITSD, - new Object[]{ - "FEF", - "CPC", - "FSF", - 'N', GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), - 'C', "circuit" + Materials.Master, - 'F', ItemList.Field_Generator_LuV.get(1L), - 'E', ItemList.Emitter_LuV.get(1L), - 'S', ItemList.Sensor_LuV.get(1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), - } - ); + // DNAExtractionModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[0], RecipeLoader.BITSD, new Object[] { + "TET", + "CFC", + "TST", + 'T', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + 'E', + ItemList.Emitter_EV.get(1L), + 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), + 'S', + ItemList.Sensor_EV.get(1L), + 'F', + ItemList.Field_Generator_EV.get(1L) + }); + + // PCRThermoclyclingModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[1], RecipeLoader.BITSD, new Object[] { + "NEN", + "CFC", + "NSN", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), + 'E', + ItemList.Emitter_EV.get(1L), + 'C', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, Materials.Aluminium, 1L), + 'S', + ItemList.Sensor_EV.get(1L), + 'F', + ItemList.Field_Generator_EV.get(1L) + }); + + // PlasmidSynthesisModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[2], RecipeLoader.BITSD, new Object[] { + "SFE", + "CPC", + "NFN", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Nichrome, 1L), + 'C', + "circuit" + Materials.Data, + 'F', + ItemList.Field_Generator_EV.get(1L), + 'E', + ItemList.Emitter_EV.get(1L), + 'S', + ItemList.Sensor_EV.get(1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + }); + // TransformationModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[3], RecipeLoader.BITSD, new Object[] { + "SFE", + "CPC", + "NFN", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), + 'C', + "circuit" + Materials.Master, + 'F', + ItemList.Field_Generator_LuV.get(1L), + 'E', + ItemList.Emitter_LuV.get(1L), + 'S', + ItemList.Sensor_LuV.get(1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), + }); + + // ClonalCellularSynthesisModule + GT_ModHandler.addCraftingRecipe(BioItemList.mBioLabParts[4], RecipeLoader.BITSD, new Object[] { + "FEF", + "CPC", + "FSF", + 'N', + GT_OreDictUnificator.get(OrePrefixes.wireGt04, Materials.Naquadah, 1L), + 'C', + "circuit" + Materials.Master, + 'F', + ItemList.Field_Generator_LuV.get(1L), + 'E', + ItemList.Emitter_LuV.get(1L), + 'S', + ItemList.Sensor_LuV.get(1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Chrome, 1L), + }); List<ItemStack> oreCropVine = OreDictionary.getOres("cropVine", false); if (LoaderReference.croploadcore && !oreCropVine.isEmpty()) for (ItemStack stack : oreCropVine) { - GT_Values.RA.addExtractorRecipe(BW_Util.setStackSize(stack, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addExtractorRecipe( + BW_Util.setStackSize(stack, 12), + BioItemList.getOther(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); } else - GT_Values.RA.addExtractorRecipe(new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addExtractorRecipe(ItemList.Circuit_Chip_Stemcell.get(1L), BioItemList.getOther(4), 500, BW_Util.getMachineVoltageFromTier(6)); - - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); - GT_Values.RA.addMixerRecipe(GT_Utility.getIntegratedCircuit(17), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), null, null, dnaFluid, new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), Materials.Empty.getCells(1), 500, BW_Util.getMachineVoltageFromTier(3)); - - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), BioItemList.getOther(4), null, null, null, null, null, new int[]{1000}, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), null, null, null, null, null, null, null, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(17), null, new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), null, null, null, null, null, null, null, 60 * 20, BW_Util.getMachineVoltageFromTier(3)); - + GT_Values.RA.addExtractorRecipe( + new ItemStack(Blocks.vine, 12), BioItemList.getOther(1), 500, BW_Util.getMachineVoltageFromTier(3)); + + GT_Values.RA.addExtractorRecipe( + ItemList.Circuit_Chip_Stemcell.get(1L), + BioItemList.getOther(4), + 500, + BW_Util.getMachineVoltageFromTier(6)); + + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L); + GT_Values.RA.addMixerRecipe( + GT_Utility.getIntegratedCircuit(17), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Radon, 1L), + null, + null, + dnaFluid, + new FluidStack(FluidLoader.BioLabFluidMaterials[0], 2000), + Materials.Empty.getCells(1), + 500, + BW_Util.getMachineVoltageFromTier(3)); - ItemStack[] Pistons = {ItemList.Electric_Piston_HV.get(1L), ItemList.Electric_Piston_EV.get(1L), ItemList.Electric_Piston_IV.get(1L), ItemList.Electric_Piston_LuV.get(1L), ItemList.Electric_Piston_ZPM.get(1L), ItemList.Electric_Piston_UV.get(1L)}; + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(BioCultureLoader.eColi.getFluid(), 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[1], 10), + BioItemList.getOther(4), + null, + null, + null, + null, + null, + new int[] {1000}, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(FluidLoader.BioLabFluidMaterials[1], 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[3], 250), + null, + null, + null, + null, + null, + null, + null, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(17), + null, + new FluidStack(BioCultureLoader.CommonYeast.getFluid(), 1000), + new FluidStack(FluidLoader.BioLabFluidMaterials[2], 10), + null, + null, + null, + null, + null, + null, + null, + 60 * 20, + BW_Util.getMachineVoltageFromTier(3)); + + ItemStack[] Pistons = { + ItemList.Electric_Piston_HV.get(1L), + ItemList.Electric_Piston_EV.get(1L), + ItemList.Electric_Piston_IV.get(1L), + ItemList.Electric_Piston_LuV.get(1L), + ItemList.Electric_Piston_ZPM.get(1L), + ItemList.Electric_Piston_UV.get(1L) + }; ItemStack[] BioLab = new ItemStack[GT_Values.VN.length - 3]; ItemStack[] RadioHatch = new ItemStack[GT_Values.VN.length - 3]; - Materials[] cables = {Materials.Gold, Materials.Aluminium, Materials.Tungsten, Materials.VanadiumGallium, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] hulls = {Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, Materials.Chrome, Materials.Iridium, Materials.Osmium, Materials.Naquadah}; - Materials[] wireMat = {Materials.Kanthal, Materials.Nichrome, Materials.TungstenSteel, Materials.Naquadah, Materials.NaquadahAlloy, Materials.Superconductor}; - Materials[] circuits = {Materials.Advanced, Materials.Data, Materials.Elite, Materials.Master, Materials.Ultimate, Materials.Superconductor}; + Materials[] cables = { + Materials.Gold, + Materials.Aluminium, + Materials.Tungsten, + Materials.VanadiumGallium, + Materials.Naquadah, + Materials.NaquadahAlloy, + Materials.Superconductor + }; + Materials[] hulls = { + Materials.StainlessSteel, + Materials.Titanium, + Materials.TungstenSteel, + Materials.Chrome, + Materials.Iridium, + Materials.Osmium, + Materials.Naquadah + }; + Materials[] wireMat = { + Materials.Kanthal, + Materials.Nichrome, + Materials.TungstenSteel, + Materials.Naquadah, + Materials.NaquadahAlloy, + Materials.Superconductor + }; + Materials[] circuits = { + Materials.Advanced, + Materials.Data, + Materials.Elite, + Materials.Master, + Materials.Ultimate, + Materials.Superconductor + }; for (int i = 3; i < GT_Values.VN.length - 1; i++) { - //12625 - BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, "bw.biolab" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), i).getStackForm(1L); - RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, "bw.radiohatch" + GT_Values.VN[i], GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), i).getStackForm(1L); + // 12625 + BioLab[(i - 3)] = new GT_MetaTileEntity_BioLab( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + i, + "bw.biolab" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.biolab.name"), + i) + .getStackForm(1L); + RadioHatch[(i - 3)] = new GT_MetaTileEntity_RadioHatch( + ConfigHandler.IDOffset + GT_Values.VN.length * 7 - 2 + i, + "bw.radiohatch" + GT_Values.VN[i], + GT_Values.VN[i] + " " + StatCollector.translateToLocal("tile.radiohatch.name"), + i) + .getStackForm(1L); try { ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); - GT_ModHandler.addCraftingRecipe( - BioLab[(i - 3)], - RecipeLoader.BITSD, - new Object[]{ - "PFP", - "WCW", - "OGO", - 'F', GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), - 'O', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), - 'G', "circuit" + circuits[(i - 3)], - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - RadioHatch[(i - 3)], - RecipeLoader.BITSD, - new Object[]{ - "DPD", - "DCD", - "DKD", - 'D', GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), - 'C', machinehull, - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), - 'P', Pistons[(i - 3)] - } - ); + GT_ModHandler.addCraftingRecipe(BioLab[(i - 3)], RecipeLoader.BITSD, new Object[] { + "PFP", + "WCW", + "OGO", + 'F', + GT_OreDictUnificator.get(OrePrefixes.frameGt, hulls[(i - 3)], 1L), + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt01, wireMat[(i - 3)], 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), + 'O', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polystyrene, 1L), + 'G', + "circuit" + circuits[(i - 3)], + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(RadioHatch[(i - 3)], RecipeLoader.BITSD, new Object[] { + "DPD", + "DCD", + "DKD", + 'D', + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 1L), + 'C', + machinehull, + 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cables[(i - 3)], 1L), + 'P', + Pistons[(i - 3)] + }); } catch (ArrayIndexOutOfBoundsException e) { - //e.printStackTrace(); + // e.printStackTrace(); } } GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_BioVat(ConfigHandler.IDOffset + GT_Values.VN.length * 7, "bw.biovat", StatCollector.translateToLocal("tile.biovat.name")).getStackForm(1L), + new GT_TileEntity_BioVat( + ConfigHandler.IDOffset + GT_Values.VN.length * 7, + "bw.biovat", + StatCollector.translateToLocal("tile.biovat.name")) + .getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "GCG", - "KHK", - "GCG", - 'G', new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), - 'C', "circuit" + Materials.Data, - 'K', GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), - 'H', ItemList.MACHINE_HULLS[3].get(1L) - } - ); - + new Object[] { + "GCG", + "KHK", + "GCG", + 'G', + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + 'C', + "circuit" + Materials.Data, + 'K', + GT_OreDictUnificator.get(OrePrefixes.wireGt08, Materials.Silver, 1L), + 'H', + ItemList.MACHINE_HULLS[3].get(1L) + }); Materials[] sterilizers = {Materials.Ammonia, Materials.Chlorine, Materials.Ethanol, Materials.Methanol}; for (Materials used : sterilizers) { @@ -220,8 +340,7 @@ public class BioRecipeLoader { BioItemList.getPetriDish(null), 10000, 100, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); GT_Values.RA.addAutoclaveRecipe( new ItemStack(Items.glass_bottle), @@ -229,8 +348,7 @@ public class BioRecipeLoader { BioItemList.getDNASampleFlask(null), 10000, 100, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); } GT_Values.RA.addLaserEngraverRecipe( @@ -238,165 +356,175 @@ public class BioRecipeLoader { GT_Utility.getIntegratedCircuit(17), BioItemList.getPlasmidCell(null), 100, - BW_Util.getMachineVoltageFromTier(1) + BW_Util.getMachineVoltageFromTier(1)); - ); - - - FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + FluidStack[] easyFluids = { + Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }; for (FluidStack fluidStack : easyFluids) { BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Items.rotten_flesh), BioCultureLoader.rottenFleshBacteria, - new int[]{3300}, - new FluidStack[]{fluidStack}, + new int[] {3300}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Items.fermented_spider_eye), BioCultureLoader.eColi, - new int[]{4500}, - new FluidStack[]{fluidStack}, + new int[] {4500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Food_Dough.get(1L), BioCultureLoader.CommonYeast, - new int[]{7500}, - new FluidStack[]{fluidStack}, + new int[] {7500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Food_Dough_Sugar.get(1L), BioCultureLoader.WhineYeast, - new int[]{2500}, - new FluidStack[]{fluidStack}, + new int[] {2500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Wine.get(1L), BioCultureLoader.WhineYeast, - new int[]{3300}, - new FluidStack[]{fluidStack}, + new int[] {3300}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Beer.get(1L), BioCultureLoader.BeerYeast, - new int[]{2500}, - new FluidStack[]{fluidStack}, + new int[] {2500}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( ItemList.Bottle_Dark_Beer.get(1L), BioCultureLoader.BeerYeast, - new int[]{3300}, - new FluidStack[]{fluidStack}, + new int[] {3300}, + new FluidStack[] {fluidStack}, 500, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBioLabRecipeIncubation( new ItemStack(Blocks.dirt), BioCultureLoader.anaerobicOil, - new int[]{100}, - new FluidStack[]{fluidStack}, + new int[] {100}, + new FluidStack[] {fluidStack}, 1500, BW_Util.getMachineVoltageFromTier(4), - BW_Util.STANDART - ); + BW_Util.STANDART); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{new ItemStack(Items.sugar, 64)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] {new ItemStack(Items.sugar, 64)}, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.CommonYeast, - new FluidStack[]{(LoaderReference.berriespp ? FluidRegistry.getFluidStack("potion.ghp", 1) : Materials.Ethanol.getFluid(1L))}, + new FluidStack[] { + (LoaderReference.berriespp + ? FluidRegistry.getFluidStack("potion.ghp", 1) + : Materials.Ethanol.getFluid(1L)) + }, 350, - BW_Util.getMachineVoltageFromTier(4) - ); + BW_Util.getMachineVoltageFromTier(4)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{ItemList.Crop_Drop_Grapes.get(16)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] {ItemList.Crop_Drop_Grapes.get(16)}, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.WhineYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.wine", 12)}, 200, - BW_Util.getMachineVoltageFromTier(2) - ); + BW_Util.getMachineVoltageFromTier(2)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{new ItemStack(Items.sugar, 4), ItemList.IC2_Hops.get(16L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] { + new ItemStack(Items.sugar, 4), + ItemList.IC2_Hops.get(16L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 8L) + }, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.BeerYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.beer", 5)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.beer", 5)}, 600, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L)}, - new FluidStack[]{new FluidStack(fluidStack, 100)}, + new ItemStack[] { + ItemList.IC2_Hops.get(32L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wheat, 16L) + }, + new FluidStack[] {new FluidStack(fluidStack, 100)}, BioCultureLoader.BeerYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.darkbeer", 10)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.darkbeer", 10)}, 600, - BW_Util.getMachineVoltageFromTier(1) - ); - + BW_Util.getMachineVoltageFromTier(1)); } BWRecipes.instance.addBacterialVatRecipe( null, - new FluidStack[]{FluidRegistry.getFluidStack("potion.grapejuice", 100)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.grapejuice", 100)}, BioCultureLoader.WhineYeast, - new FluidStack[]{FluidRegistry.getFluidStack("potion.wine", 12)}, + new FluidStack[] {FluidRegistry.getFluidStack("potion.wine", 12)}, 400, - BW_Util.getMachineVoltageFromTier(1) - ); + BW_Util.getMachineVoltageFromTier(1)); BWRecipes.instance.addBacterialVatRecipe( null, - new FluidStack[]{Materials.FermentedBiomass.getFluid(10000)}, + new FluidStack[] {Materials.FermentedBiomass.getFluid(10000)}, BioCultureLoader.anaerobicOil, - new FluidStack[]{new FluidStack(FluidLoader.fulvicAcid,1000)}, + new FluidStack[] {new FluidStack(FluidLoader.fulvicAcid, 1000)}, 2748, - BW_Util.getMachineVoltageFromTier(3) - ); - GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(10),new FluidStack(FluidLoader.fulvicAcid,1000),new FluidStack(FluidLoader.heatedfulvicAcid,1000),90, BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(10),null,new FluidStack(FluidLoader.heatedfulvicAcid,1000),new FluidStack(FluidLoader.Kerogen,1000),null,75, BW_Util.getMachineVoltageFromTier(2)); - GT_Values.RA.addPyrolyseRecipe(Materials.Wood.getDust(10),new FluidStack(FluidLoader.Kerogen,1000),10,null,Materials.Oil.getFluid(1000),105, BW_Util.getMachineVoltageFromTier(3)); + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidHeaterRecipe( + GT_Utility.getIntegratedCircuit(10), + new FluidStack(FluidLoader.fulvicAcid, 1000), + new FluidStack(FluidLoader.heatedfulvicAcid, 1000), + 90, + BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(10), + null, + new FluidStack(FluidLoader.heatedfulvicAcid, 1000), + new FluidStack(FluidLoader.Kerogen, 1000), + null, + 75, + BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addPyrolyseRecipe( + Materials.Wood.getDust(10), + new FluidStack(FluidLoader.Kerogen, 1000), + 10, + null, + Materials.Oil.getFluid(1000), + 105, + BW_Util.getMachineVoltageFromTier(3)); } - public static void runOnServerStarted(){ + public static void runOnServerStarted() { GT_Recipe.GT_Recipe_Map.sFermentingRecipes.mRecipeList.forEach( - recipe -> - BWRecipes.instance.addBacterialVatRecipe( - new ItemStack[]{null}, - BioCultureLoader.generalPurposeFermentingBacteria, - recipe.mFluidInputs, - recipe.mFluidOutputs, - recipe.mDuration, - recipe.mEUt, - GT_Utility.getTier(recipe.mEUt) - ) - ); + recipe -> BWRecipes.instance.addBacterialVatRecipe( + new ItemStack[] {null}, + BioCultureLoader.generalPurposeFermentingBacteria, + recipe.mFluidInputs, + recipe.mFluidOutputs, + recipe.mDuration, + recipe.mEUt, + GT_Utility.getTier(recipe.mEUt))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 924511cd5d..c1d149c29c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -37,6 +37,8 @@ import gregtech.api.objects.GT_Fluid; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; import ic2.core.item.ItemFluidCell; +import java.awt.*; +import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -44,9 +46,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.awt.*; -import java.util.Arrays; - public class FluidLoader { public static IIcon autogenIIcon; @@ -56,8 +55,8 @@ public class FluidLoader { public static Fluid[] BioLabFluidMaterials; public static ItemStack[] BioLabFluidCells; - //OilProcessing chain - public static Fluid fulvicAcid,heatedfulvicAcid,Kerogen; + // OilProcessing chain + public static Fluid fulvicAcid, heatedfulvicAcid, Kerogen; public static void run() { FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId(); @@ -65,29 +64,53 @@ public class FluidLoader { Arrays.fill(rgb, (short) 255); FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb); FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20)); - FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720); + FluidLoader.heatedfulvicAcid = + FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20), 720); FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85)); - FluidLoader.BioLabFluidMaterials = new Fluid[]{ - new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}), - new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}), - new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}), - new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}), + FluidLoader.BioLabFluidMaterials = new Fluid[] { + new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[] {125, 50, 170, 0}), + new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[] {240, 200, 125, 0}), + new GT_Fluid("Penicillin", "molten.autogenerated", new short[] {255, 255, 255, 0}), + new GT_Fluid("Polymerase", "molten.autogenerated", new short[] {110, 180, 110, 0}), }; FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length]; for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) { FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]); - FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); + FluidLoader.BioLabFluidCells[i] = + ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000)); } -// BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L); + // BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", + // BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB()))); + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 100) + : Materials.Biomass.getFluid(100L); for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (B.isBreedable()) { - B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()})); + B.setFluid(new GT_Fluid( + B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[] { + (short) B.getColor().getRed(), + (short) B.getColor().getBlue(), + (short) B.getColor().getGreen() + })); FluidRegistry.registerFluid(B.getFluid()); - GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid"); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120); + GT_LanguageManager.addStringLocalization( + B.getFluid().getUnlocalizedName(), B.getLocalisedName() + " Fluid"); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(10), + GT_Values.NI, + new FluidStack(B.getFluid(), 1000), + dnaFluid, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 500, + 120); } } @@ -100,14 +123,19 @@ public class FluidLoader { } } - public static Fluid createAndRegisterFluid(String Name,Color color){ - Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + public static Fluid createAndRegisterFluid(String Name, Color color) { + Fluid f = new GT_Fluid(Name, "molten.autogenerated", new short[] { + (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), (short) color.getAlpha() + }); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); FluidRegistry.registerFluid(f); return f; } - public static Fluid createAndRegisterFluid(String Name, Color color, int temperature){ - Fluid f = new GT_Fluid(Name,"molten.autogenerated",new short[]{(short) color.getRed(),(short) color.getGreen(),(short) color.getBlue(), (short) color.getAlpha()}); + + public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) { + Fluid f = new GT_Fluid(Name, "molten.autogenerated", new short[] { + (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(), (short) color.getAlpha() + }); GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), Name); f.setTemperature(temperature); FluidRegistry.registerFluid(f); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 5bdf77e2ce..40de4b8812 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -46,8 +46,7 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlass", 0, 5); BioVatLogicAdder.BioVatGlass.addCustomGlass("Botania", "elfGlassPane", 0, 5); } - if (LoaderReference.Botany) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); + if (LoaderReference.Botany) BioVatLogicAdder.BioVatGlass.addCustomGlass("Botany", "stained", 0, 3); if (LoaderReference.EnderIO) for (int i = 0; i <= 5; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("EnderIO", "blockFusedQuartz", i, 3); @@ -65,29 +64,23 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("HardcoreEnderExpension", "laboratory_glass", 0, 3); if (LoaderReference.Natura) - for (int i = 0; i <= 1; ++i) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); + for (int i = 0; i <= 1; ++i) BioVatLogicAdder.BioVatGlass.addCustomGlass("Natura", "NetherGlass", i, 3); if (LoaderReference.RandomThings) BioVatLogicAdder.BioVatGlass.addCustomGlass("RandomThings", "spectreGlass", 0, 3); - if (LoaderReference.TConstruct) - BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); - if (LoaderReference.tectech) - BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); + if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock", 0, 3); + if (LoaderReference.tectech) BioVatLogicAdder.BioVatGlass.addCustomGlass("tectech", "tile.quantumGlass", 0, 8); - if (LoaderReference.chisel) - BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); + if (LoaderReference.chisel) BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass2", 0, 3); for (int i = 0; i <= 15; ++i) { BioVatLogicAdder.BioVatGlass.addCustomGlass("minecraft", "stained_glass", i, 3); if (LoaderReference.GalaxySpace) BioVatLogicAdder.BioVatGlass.addCustomGlass("GalaxySpace", "futureglasses", i, 3); - if (LoaderReference.Railcraft) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); + if (LoaderReference.Railcraft) BioVatLogicAdder.BioVatGlass.addCustomGlass("Railcraft", "glass", i, 3); if (LoaderReference.TConstruct) BioVatLogicAdder.BioVatGlass.addCustomGlass("TConstruct", "GlassBlock.StainedClear", i, 3); - if (LoaderReference.Ztones) - BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); + if (LoaderReference.Ztones) BioVatLogicAdder.BioVatGlass.addCustomGlass("Ztones", "tile.glaxx", i, 3); if (LoaderReference.chisel) { BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "glass", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_white", i, 3); @@ -96,8 +89,7 @@ public class GTNHBlocks { BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_brown", i, 3); BioVatLogicAdder.BioVatGlass.addCustomGlass("chisel", "stained_glass_forestry", i, 3); } - if (LoaderReference.witchery) - BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); + if (LoaderReference.witchery) BioVatLogicAdder.BioVatGlass.addCustomGlass("witchery", "shadedglass", i, 3); } } } 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 2af3de8c67..4b976838c3 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 @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static com.github.bartimaeusnek.bartworks.MainMod.BWT; +import static com.github.bartimaeusnek.bartworks.MainMod.GT2; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; @@ -56,10 +60,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import static com.github.bartimaeusnek.bartworks.MainMod.BWT; -import static com.github.bartimaeusnek.bartworks.MainMod.GT2; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; - public class ItemRegistry { public static final Item DESTRUCTOPACK = new GT_Destructopack_Item(); @@ -68,66 +68,128 @@ public class ItemRegistry { public static final Item ROCKCUTTER_MV = new GT_Rockcutter_Item(2); public static final Item ROCKCUTTER_HV = new GT_Rockcutter_Item(3); public static final Item CIRCUIT_PROGRAMMER = new Circuit_Programmer(); - public static final Block ROTORBLOCK = new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); - public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors(5, 0.15f, 15, 30, 2400, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), "BW_LeatherRotor", "rotors/itemRotorLeather"); - public static final Item WOOL_ROTOR = new BW_Stonage_Rotors(7, 0.18f, 10, 20, 1600, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), "BW_WoolRotor", "rotors/itemRotorWool"); - public static final Item PAPER_ROTOR = new BW_Stonage_Rotors(9, 0.2f, 1, 10, 800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), "BW_PaperRotor", "rotors/itemRotorPaper"); - public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors(11, 0.22f, 1, 50, 5800, IKineticRotor.GearboxType.WIND, new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), "BW_CombinedRotor", "rotors/itemRotorCombined"); - public static final Item CRAFTING_PARTS = new SimpleSubItemClass("grindstone_top", "grindstone_bottom", "completed_grindstone", "rotors/leatherParts", "rotors/woolParts", "rotors/paperParts", "rotors/combinedParts"); + public static final Block ROTORBLOCK = + new BW_TileEntityContainer_MachineBlock(Material.wood, BW_RotorBlock.class, "BWRotorBlock"); + public static final Item LEATHER_ROTOR = new BW_Stonage_Rotors( + 5, + 0.15f, + 15, + 30, + 2400, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorLeather.png"), + "BW_LeatherRotor", + "rotors/itemRotorLeather"); + public static final Item WOOL_ROTOR = new BW_Stonage_Rotors( + 7, + 0.18f, + 10, + 20, + 1600, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorWool.png"), + "BW_WoolRotor", + "rotors/itemRotorWool"); + public static final Item PAPER_ROTOR = new BW_Stonage_Rotors( + 9, + 0.2f, + 1, + 10, + 800, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorPaper.png"), + "BW_PaperRotor", + "rotors/itemRotorPaper"); + public static final Item COMBINED_ROTOR = new BW_Stonage_Rotors( + 11, + 0.22f, + 1, + 50, + 5800, + IKineticRotor.GearboxType.WIND, + new ResourceLocation(MainMod.MOD_ID, "textures/items/rotors/rotorCombined.png"), + "BW_CombinedRotor", + "rotors/itemRotorCombined"); + public static final Item CRAFTING_PARTS = new SimpleSubItemClass( + "grindstone_top", + "grindstone_bottom", + "completed_grindstone", + "rotors/leatherParts", + "rotors/woolParts", + "rotors/paperParts", + "rotors/combinedParts"); public static final Item TAB = new SimpleIconItem("GT2Coin"); public static final Item WINDMETER = new BW_SimpleWindMeter(); - public static final Block PUMPBLOCK = new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); + public static final Block PUMPBLOCK = + new BW_TileEntityContainer(Material.anvil, BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPump"); public static final Item PUMPPARTS = new SimpleSubItemClass("BWrawtube", "BWmotor"); - public static final Block EXPPUMP = new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); + public static final Block EXPPUMP = + new BW_TileEntityContainer(Material.coral, BW_TileEntity_ExperimentalFloodGate.class, "ExpReversePump"); - public static final Block bw_realglas = new BW_GlasBlocks( + public static final Block bw_realglas = new BW_GlasBlocks( "BW_GlasBlocks", - new String[]{ - MainMod.MOD_ID + ":BoronSilicateGlassBlock", - MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", - MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", - MainMod.MOD_ID + ":ThoriumYttriumGlass", - MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", - MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + new String[] { + MainMod.MOD_ID + ":BoronSilicateGlassBlock", + MainMod.MOD_ID + ":TitaniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":TungstenSteelReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":LuVTierMaterialReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":IridiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":OsmiumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock1", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock2", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock3", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock4", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock5", + MainMod.MOD_ID + ":ColoredBoronSilicateGlassBlock6", + MainMod.MOD_ID + ":ThoriumYttriumGlass", + MainMod.MOD_ID + ":NeutroniumReinforcedBoronSilicateGlassBlock", + MainMod.MOD_ID + ":CosmicNeutroniumReinforcedBoronSilicateGlassBlock", + }, + new short[][] { + Materials.BorosilicateGlass.getRGBA(), + Materials.Titanium.getRGBA(), + Materials.TungstenSteel.getRGBA(), + Materials.Chrome.getRGBA(), + Materials.Iridium.getRGBA(), + Materials.Osmium.getRGBA(), + new short[] {0xff, 0, 0}, + new short[] {0, 0xff, 0}, + new short[] {0x80, 0, 0xff}, + new short[] {0xff, 0xff, 0}, + new short[] {0, 0xff, 0x80}, + new short[] {0x80, 0x33, 0}, + WerkstoffLoader.YttriumOxide.getRGBA(), + Materials.Neutronium.getRGBA(), + Materials.CosmicNeutronium.getRGBA() }, - new short[][]{Materials.BorosilicateGlass.getRGBA(), Materials.Titanium.getRGBA(), Materials.TungstenSteel.getRGBA(), Materials.Chrome.getRGBA(), Materials.Iridium.getRGBA(), Materials.Osmium.getRGBA(), new short[]{0xff, 0, 0}, new short[]{0, 0xff, 0}, new short[]{0x80, 0, 0xff}, new short[]{0xff, 0xff, 0}, new short[]{0, 0xff, 0x80}, new short[]{0x80, 0x33, 0}, WerkstoffLoader.YttriumOxide.getRGBA(), Materials.Neutronium.getRGBA(), Materials.CosmicNeutronium.getRGBA()}, MainMod.BIO_TAB, - true, false - ); + true, + false); - public static final Block[] bw_glasses = { - bw_realglas - }; - public static final Block bw_fake_glasses = - new BW_GlasBlocks("BW_GlasBlocks", new String[]{ - MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos" - }, null, null, true, true); + public static final Block[] bw_glasses = {bw_realglas}; + public static final Block bw_fake_glasses = new BW_GlasBlocks( + "BW_GlasBlocks", new String[] {MainMod.MOD_ID + ":BoronSilicateGlassBlockRandlos"}, null, null, true, true); public static final Block[] BW_BLOCKS = { - new BW_Blocks("BW_ItemBlocks", new String[] - { - MainMod.MOD_ID + ":EtchedLapisCell", - MainMod.MOD_ID + ":PlatedLapisCell", - }, GT2), - - new BW_Blocks("GT_LESU_CASING", new String[]{ + new BW_Blocks( + "BW_ItemBlocks", + new String[] { + MainMod.MOD_ID + ":EtchedLapisCell", MainMod.MOD_ID + ":PlatedLapisCell", + }, + GT2), + new BW_Blocks( + "GT_LESU_CASING", + new String[] { MainMod.MOD_ID + ":LESU_CELL", - }, GT2), - new BW_Blocks("BW_Machinery_Casings", new String[]{ - MainMod.MOD_ID + ":NickelFerriteBlocks", - MainMod.MOD_ID + ":TransformerCoil", + }, + GT2), + new BW_Blocks( + "BW_Machinery_Casings", + new String[] { + MainMod.MOD_ID + ":NickelFerriteBlocks", MainMod.MOD_ID + ":TransformerCoil", // MainMod.MOD_ID+":DEHP_Casing", // MainMod.MOD_ID+":DEHP_Casing_Base" - }, BWT), - + }, + BWT), }; public static ItemStack[] diode2A = new ItemStack[GT_Values.VN.length]; @@ -171,7 +233,7 @@ public class ItemRegistry { GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock"); } - //GT2 stuff + // GT2 stuff GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks"); GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING"); if (ConfigHandler.teslastaff) @@ -183,61 +245,181 @@ public class ItemRegistry { GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2"); if (newStuff) { if (ConfigHandler.creativeScannerID != 0) - new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20); - ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L); - ItemRegistry.THTR = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L); + new CreativeScanner( + ConfigHandler.creativeScannerID, "Creative Debug Scanner", "Creative Debug Scanner", 20); + ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, + "ElectricImplosionCompressor", + "Electric Implosion Compressor") + .getStackForm(1L); + ItemRegistry.THTR = new GT_TileEntity_THTR( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, + "THTR", + "Thorium High Temperature Reactor") + .getStackForm(1L); GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials(); - ItemRegistry.HTGR = new GT_TileEntity_HTGR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, "HTGR", "High Temperature Gas-cooled Reactor").getStackForm(1L); + ItemRegistry.HTGR = new GT_TileEntity_HTGR( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 48, + "HTGR", + "High Temperature Gas-cooled Reactor") + .getStackForm(1L); GT_TileEntity_HTGR.HTGRMaterials.registeraTHR_Materials(); - ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, "EIG", "Extreme Industrial Greenhouse").getStackForm(1L); - GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); - GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); + ItemRegistry.EIG = new GT_TileEntity_ExtremeIndustrialGreenhouse( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15 + 49, + "EIG", + "Extreme Industrial Greenhouse") + .getStackForm(1L); + GT_OreDictUnificator.add( + OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0)); + GT_OreDictUnificator.registerOre( + OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2])); for (int i = 0; i < GT_Values.VN.length - 1; i++) { - ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode" + "8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode" + "12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode" + "16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], i).getStackForm(1L); - ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], i).getStackForm(1L); + ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, + "diode" + "2A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, + "diode" + "4A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, + "diode" + "8A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, + "diode" + "12A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode( + ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, + "diode" + "16A" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], + i) + .getStackForm(1L); + ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor( + ConfigHandler.IDOffset + 1 + i, + "energydistributor" + GT_Values.VN[i], + StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], + i) + .getStackForm(1L); } for (int i = 0; i < 3; i++) { - ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1); + ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, + "acidgenerator" + GT_Values.VN[i + 2], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], + i + 2) + .getStackForm(1); } - ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, "acidgenerator" + GT_Values.VN[1], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + 1).getStackForm(1L); - - ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L); - 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); - ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L); - ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor(ConfigHandler.IDOffset+GT_Values.VN.length * 8 + 638, "MegaChemicalReactor", "Mega Chemical Reactor").getStackForm(1L); - ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker(ConfigHandler.IDOffset+GT_Values.VN.length * 8 + 639, "MegaOilCracker", "Mega Oil Cracker").getStackForm(1L); + ItemRegistry.acidGensLV = new GT_MetaTileEntity_AcidGenerator( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 65, + "acidgenerator" + GT_Values.VN[1], + StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[1], + +1) + .getStackForm(1L); + ItemRegistry.dehp = new GT_TileEntity_DEHP( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump") + .getStackForm(1L); + 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); + ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, + "MegaDistillationTower", + "Mega Distillation Tower") + .getStackForm(1L); + ItemRegistry.megaMachines[3] = new GT_TileEntity_MegaChemicalReactor( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 638, + "MegaChemicalReactor", + "Mega Chemical Reactor") + .getStackForm(1L); + ItemRegistry.megaMachines[4] = new GT_TileEntity_MegaOilCracker( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 639, + "MegaOilCracker", + "Mega Oil Cracker") + .getStackForm(1L); if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) { - ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L); - ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II").getStackForm(1L); - ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I").getStackForm(1L); + ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III") + .getStackForm(1L); + ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II") + .getStackForm(1L); + ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I") + .getStackForm(1L); } if (LoaderReference.tectech) { - TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, "pipe.lowpowerlaser", "Low Power Laser Pipe").getStackForm(1L); + TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower( + ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, + "pipe.lowpowerlaser", + "Low Power Laser Pipe") + .getStackForm(1L); int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15; for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox(startID++, GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", tier, amps).getStackForm(1L); + TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( + startID++, + GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", + tier, + amps) + .getStackForm(1L); } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch(startID++, GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L); + TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( + startID++, + GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", + tier, + amps) + .getStackForm(1L); } } for (int amps = 32; amps <= 128; amps += 32) { for (int tier = 4; tier < 8; tier++) { - TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo(startID++, GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L); + TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( + startID++, + GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, + GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", + tier, + amps) + .getStackForm(1L); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java index 733ba9b67b..9ca7cedec8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LocalisationLoader.java @@ -26,30 +26,42 @@ import gregtech.api.util.GT_LanguageManager; public class LocalisationLoader { - private LocalisationLoader() { - } + private LocalisationLoader() {} - private static void localiseTooltips(){ - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.purify.2","Throw into Cauldron to get clean crushed Ore"); - GT_LanguageManager.addStringLocalization("metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); + private static void localiseTooltips() { + GT_LanguageManager.addStringLocalization( + "metaitem.01.tooltip.purify.2", "Throw into Cauldron to get clean crushed Ore"); + GT_LanguageManager.addStringLocalization( + "metaitem.01.tooltip.nqgen", "Can be used as Enriched Naquadah Fuel Substitute"); } - private static void localiseAchivements(){ - 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!"); + private static void localiseAchivements() { + 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!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.dehp.desc", "Get ALL the thermal energy!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.circuitassemblyline", "Cheaper Circuits?"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.circuitassemblyline.desc", "Well, yes, but actually no..."); GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1", "Ores from deep below!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo"); - GT_LanguageManager.addStringLocalization("achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer1.desc", "Is this some kind of Ex-Nihilo?"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer2", "Ores from deep below 2! Electric Boogaloo!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer2.desc", "Ex-Nihilo, but faster!"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer3", "Ores from deep below 3! Trinity Ex-Nihilo"); + GT_LanguageManager.addStringLocalization( + "achievement.gt.blockmachines.voidminer3.desc", "3x the trouble, 3x the fun!"); } - public static void localiseAll(){ + public static void localiseAll() { localiseAchivements(); localiseTooltips(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index a126fea811..2876e70b7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.*; @@ -46,11 +48,11 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.newStuff; - public class RecipeLoader { - protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; + protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.REVERSIBLE; @SuppressWarnings("deprecation") public static void run() { @@ -60,33 +62,77 @@ public class RecipeLoader { * GTNH "hardmode" Recipes */ - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(Blocks.lapis_block), Materials.Iron.getMolten(1296L), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), 100, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), Materials.Lapis.getPlates(9), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), GT_Utility.getIntegratedCircuit(17)}, FluidRegistry.getFluidStack("ic2coolant", 1000), new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), 100, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), Materials.Lapis.getBlocks(8), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(Blocks.lapis_block), + Materials.Iron.getMolten(1296L), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + 100, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), + Materials.Lapis.getPlates(9), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Advanced, 2L), + GT_Utility.getIntegratedCircuit(17) + }, + FluidRegistry.getFluidStack("ic2coolant", 1000), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + 100, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + Materials.Lapis.getBlocks(8), + GT_Utility.getIntegratedCircuit(17) + }, + GT_Values.NF, + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(3)); } else { /* * Vanilla Recipes */ + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + Materials.Lapis.getBlocks(8), + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), + GT_Utility.getIntegratedCircuit(17) + }, + GT_Values.NF, + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{Materials.Lapis.getBlocks(8), GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Basic, 1L), GT_Utility.getIntegratedCircuit(17)}, GT_Values.NF, new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), RecipeLoader.BITSD, new Object[] { + "LLL", "LCL", "LLL", 'L', Materials.Lapis.getBlocks(1), 'C', "circuitBasic" + }); - GT_ModHandler.addCraftingRecipe( + GT_Values.RA.addCutterRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), + GT_Values.NI, + 100, + BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addCompressorRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 100, + BW_Util.getMachineVoltageFromTier(1)); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, - new Object[]{ - "LLL", - "LCL", - "LLL", - 'L', Materials.Lapis.getBlocks(1), - 'C', "circuitBasic" - }); - - GT_Values.RA.addCutterRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[1]), new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), GT_Values.NI, 100, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 1), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addCompressorRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 9, 0), new ItemStack(ItemRegistry.BW_BLOCKS[1]), 100, BW_Util.getMachineVoltageFromTier(1)); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); - GT_ModHandler.addShapelessCraftingRecipe(new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), RecipeLoader.BITSD, new Object[]{new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); + new Object[] {new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1)}); + GT_ModHandler.addShapelessCraftingRecipe( + new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 1), + RecipeLoader.BITSD, + new Object[] {new ItemStack(ItemRegistry.BW_BLOCKS[0], 1, 0)}); } /* @@ -96,468 +142,700 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new GT_TileEntity_LESU(ConfigHandler.IDOffset, "LESU", "L.E.S.U.").getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "CDC", - "SBS", - "CFC", - 'C', ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", - 'D', ItemList.Cover_Screen.get(1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.cableGt12, ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, 1L), - 'B', new ItemStack(ItemRegistry.BW_BLOCKS[1]), - 'F', ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) + new Object[] { + "CDC", + "SBS", + "CFC", + 'C', + ConfigHandler.hardmode ? "circuitAdvanced" : "circuitBasic", + 'D', + ItemList.Cover_Screen.get(1L), + 'S', + GT_OreDictUnificator.get( + OrePrefixes.cableGt12, + ConfigHandler.hardmode ? Materials.Platinum : Materials.AnnealedCopper, + 1L), + 'B', + new ItemStack(ItemRegistry.BW_BLOCKS[1]), + 'F', + ConfigHandler.hardmode ? ItemList.Field_Generator_HV.get(1L) : ItemList.Field_Generator_LV.get(1L) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "CPC", - "PLP", - "CPC", - 'C', "circuitAdvanced", - 'P', GT_OreDictUnificator.get(ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, Materials.Aluminium, 1L), - 'L', new ItemStack(Items.lava_bucket) + new ItemStack(ItemRegistry.DESTRUCTOPACK), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "CPC", + "PLP", + "CPC", + 'C', + "circuitAdvanced", + 'P', + GT_OreDictUnificator.get( + ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, + Materials.Aluminium, + 1L), + 'L', + new ItemStack(Items.lava_bucket) }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.DESTRUCTOPACK), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "CPC", - "PLP", - "CPC", - 'C', "circuitAdvanced", - 'P', GT_OreDictUnificator.get(ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, 1L), - 'L', new ItemStack(Items.lava_bucket) + new ItemStack(ItemRegistry.DESTRUCTOPACK), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "CPC", + "PLP", + "CPC", + 'C', + "circuitAdvanced", + 'P', + GT_OreDictUnificator.get( + ConfigHandler.hardmode ? OrePrefixes.plateDouble : OrePrefixes.plate, + ConfigHandler.hardmode ? Materials.Steel : Materials.Iron, + 1L), + 'L', + new ItemStack(Items.lava_bucket) }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_MV), - RecipeLoader.BITSD, - new Object[]{ - "DS ", - "DP ", - "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), - 'C', "circuitGood", - 'B', ItemList.IC2_AdvBattery.get(1L) - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_MV), RecipeLoader.BITSD, new Object[] { + "DS ", + "DP ", + "DCB", + 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.TungstenSteel, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 1L), + 'C', + "circuitGood", + 'B', + ItemList.IC2_AdvBattery.get(1L) + }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_LV), - RecipeLoader.BITSD, - new Object[]{ - "DS ", - "DP ", - "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), - 'C', "circuitBasic", - 'B', ItemList.IC2_ReBattery.get(1L) - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_LV), RecipeLoader.BITSD, new Object[] { + "DS ", + "DP ", + "DCB", + 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Titanium, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 1L), + 'C', + "circuitBasic", + 'B', + ItemList.IC2_ReBattery.get(1L) + }); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROCKCUTTER_HV), - RecipeLoader.BITSD, - new Object[]{ - "DS ", - "DP ", - "DCB", - 'D', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), - 'C', "circuitAdvanced", - 'B', ItemList.IC2_EnergyCrystal.get(1L) - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROCKCUTTER_HV), RecipeLoader.BITSD, new Object[] { + "DS ", + "DP ", + "DCB", + 'D', + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Diamond, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Iridium, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iridium, 1L), + 'C', + "circuitAdvanced", + 'B', + ItemList.IC2_EnergyCrystal.get(1L) + }); if (ConfigHandler.teslastaff) - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.TESLASTAFF), - RecipeLoader.BITSD, - new Object[]{ - "BO ", - "OP ", - " P", - 'O', GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), - 'B', ItemList.Energy_LapotronicOrb.get(1L), - 'P', "plateAlloyIridium", - }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.TESLASTAFF), RecipeLoader.BITSD, new Object[] { + "BO ", + "OP ", + " P", + 'O', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.Superconductor, 1L), + 'B', + ItemList.Energy_LapotronicOrb.get(1L), + 'P', + "plateAlloyIridium", + }); - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); if (newStuff) { - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 0),//tube - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - " fG", - " G ", - "G ", - 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L) - } - ); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPPARTS, 1, 1),//motor + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPPARTS, 1, 0), // tube GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "GLP", - "LSd", - "PfT", - 'G', GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), - 'L', GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), - 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), - 'P', new ItemStack(Blocks.piston), - 'T', new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) - } - ); - GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), + new Object[] {" fG", " G ", "G ", 'G', ItemList.Circuit_Parts_Glass_Tube.get(1L)}); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), // motor GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "IPI", - "PMP", - "ISI", - 'I', GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), - 'P', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), - 'M', new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), - 'S', Ic2Items.ironFurnace - } - ); + new Object[] { + "GLP", + "LSd", + "PfT", + 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, Materials.Steel, 1L), + 'L', + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Steel, 1L), + 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Steel, 1L), + 'P', + new ItemStack(Blocks.piston), + 'T', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 0) + }); + GT_ModHandler.addCraftingRecipe( + new ItemStack(ItemRegistry.PUMPBLOCK, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "IPI", + "PMP", + "ISI", + 'I', + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Iron, 1L), + 'P', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Wood, 1L), + 'M', + new ItemStack(ItemRegistry.PUMPPARTS, 1, 1), + 'S', + Ic2Items.ironFurnace + }); if (!ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe( - ItemRegistry.dehp, - RecipeLoader.BITSD, - new Object[]{ - "GPG", - "NCN", - "GPG", - 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), - 'P', ItemList.Pump_IV.get(1L), - 'N', GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), - 'C', ItemList.MACHINE_HULLS[5], - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.dehp, RecipeLoader.BITSD, new Object[] { + "GPG", + "NCN", + "GPG", + 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 1L), + 'P', + ItemList.Pump_IV.get(1L), + 'N', + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 1L), + 'C', + ItemList.MACHINE_HULLS[5], + }); else - GT_Values.RA.addAssemblylineRecipe(ItemList.Pump_IV.get(1L), 72000, - new ItemStack[]{ - ItemList.Pump_IV.get(16), - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8) + GT_Values.RA.addAssemblylineRecipe( + ItemList.Pump_IV.get(1L), + 72000, + new ItemStack[] { + ItemList.Pump_IV.get(16), + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), + ItemList.Field_Generator_LuV.get(8) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144) - }, ItemRegistry.dehp, 5000, BW_Util.getMachineVoltageFromTier(6)); - - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[0], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[1], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[2], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1169), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[3], 72000, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addAssemblerRecipe(GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), GT_Utility.getIntegratedCircuit(17), Materials.SolderingAlloy.getMolten(9216), ItemRegistry.megaMachines[4], 72000, BW_Util.getMachineVoltageFromTier(3)); + new FluidStack[] { + new FluidStack(solderIndalloy, 32 * 144), + Materials.Polytetrafluoroethylene.getMolten(32 * 144) + }, + ItemRegistry.dehp, + 5000, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1000), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[0], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1002), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[1], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1126), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[2], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1169), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[3], + 72000, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addAssemblerRecipe( + GT_ModHandler.getModItem("gregtech", "gt.blockmachines", 64, 1160), + GT_Utility.getIntegratedCircuit(17), + Materials.SolderingAlloy.getMolten(9216), + ItemRegistry.megaMachines[4], + 72000, + BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Titanium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), 800, BW_Util.getMachineVoltageFromTier(3)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.TungstenSteel.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), 800, BW_Util.getMachineVoltageFromTier(4)); - FluidStack LuVMaterialFluid = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) : Materials.Chrome.getMolten(1152); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), LuVMaterialFluid, new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), 800, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Iridium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Osmium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.Neutronium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), 800, BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addFluidSolidifierRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Materials.CosmicNeutronium.getMolten(1152), new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), 800, BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Titanium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + 800, + BW_Util.getMachineVoltageFromTier(3)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.TungstenSteel.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), + 800, + BW_Util.getMachineVoltageFromTier(4)); + FluidStack LuVMaterialFluid = ConfigHandler.newStuff + ? WerkstoffLoader.LuVTierMaterial.getMolten(1152) + : Materials.Chrome.getMolten(1152); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + LuVMaterialFluid, + new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), + 800, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Iridium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), + 800, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Osmium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), + 800, + BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.Neutronium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), + 800, + BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addFluidSolidifierRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Materials.CosmicNeutronium.getMolten(1152), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), + 800, + BW_Util.getMachineVoltageFromTier(9)); for (int i = 0; i < Dyes.dyeBrown.getSizeOfFluidList(); ++i) { - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeRed.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeGreen.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyePurple.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeYellow.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeLime.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), null, null, null, 64, 2); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), Dyes.dyeBrown.getFluidDye(i, 36), new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), null, null, null, 64, 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeRed.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 6), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeGreen.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 7), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyePurple.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 8), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeYellow.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 9), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeLime.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 10), + null, + null, + null, + 64, + 2); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + Dyes.dyeBrown.getFluidDye(i, 36), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 11), + null, + null, + null, + 64, + 2); } - //and reverse recipes... cause im nice :P - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(5)); - ItemStack LuVMaterialDust = ConfigHandler.newStuff ? WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) : Materials.Chrome.getDust(8); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), LuVMaterialDust}, null, 800, BW_Util.getMachineVoltageFromTier(6)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(7)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(8)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(9)); - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), new ItemStack[]{Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)}, null, 800, BW_Util.getMachineVoltageFromTier(10)); + // and reverse recipes... cause im nice :P + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 1), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Titanium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 2), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.TungstenSteel.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(5)); + ItemStack LuVMaterialDust = ConfigHandler.newStuff + ? WerkstoffLoader.LuVTierMaterial.get(OrePrefixes.dust, 8) + : Materials.Chrome.getDust(8); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 3), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), LuVMaterialDust}, + null, + 800, + BW_Util.getMachineVoltageFromTier(6)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 4), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Iridium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(7)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 5), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Osmium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(8)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 13), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.Neutronium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(9)); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, 14), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9), Materials.CosmicNeutronium.getDust(8)}, + null, + 800, + BW_Util.getMachineVoltageFromTier(10)); for (int i = 6; i < 11; i++) { - GT_Values.RA.addPulveriserRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), new ItemStack[]{Materials.BorosilicateGlass.getDust(9)}, null, 400, BW_Util.getMachineVoltageFromTier(1)); - GT_Values.RA.addChemicalBathRecipe(new ItemStack(ItemRegistry.bw_glasses[0], 1, i), Materials.Chlorine.getGas(50), new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), null, null, null, 64, 2); + GT_Values.RA.addPulveriserRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, i), + new ItemStack[] {Materials.BorosilicateGlass.getDust(9)}, + null, + 400, + BW_Util.getMachineVoltageFromTier(1)); + GT_Values.RA.addChemicalBathRecipe( + new ItemStack(ItemRegistry.bw_glasses[0], 1, i), + Materials.Chlorine.getGas(50), + new ItemStack(ItemRegistry.bw_glasses[0], 1, 0), + null, + null, + null, + 64, + 2); } GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WINDMETER), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "SWF", - "Sf ", - "Ss ", - 'S', "stickWood", - 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), - 'F', new ItemStack(Items.string), - } - ); + new ItemStack(ItemRegistry.WINDMETER), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "SWF", + "Sf ", + "Ss ", + 'S', + "stickWood", + 'W', + new ItemStack(Blocks.wool, 1, Short.MAX_VALUE), + 'F', + new ItemStack(Items.string), + }); - Materials[] cables = { //Cable material used in the acid gen, diode and energy distributor below - Materials.Lead, //ULV - Materials.Tin, //LV - Materials.AnnealedCopper, //MV - Materials.Gold, //HV - Materials.Aluminium, //EV - Materials.Tungsten, //IV - Materials.VanadiumGallium, //LuV - Materials.Naquadah, //ZPM - Materials.NaquadahAlloy, //UV - Materials.SuperconductorUV //UHV + Materials[] cables = { // Cable material used in the acid gen, diode and energy distributor below + Materials.Lead, // ULV + Materials.Tin, // LV + Materials.AnnealedCopper, // MV + Materials.Gold, // HV + Materials.Aluminium, // EV + Materials.Tungsten, // IV + Materials.VanadiumGallium, // LuV + Materials.Naquadah, // ZPM + Materials.NaquadahAlloy, // UV + Materials.SuperconductorUV // UHV }; - ISubTagContainer[] hulls = { //Plate material used in the acid gen, diode and energy distributor below - Materials.WroughtIron, //ULV - Materials.Steel, //LV - Materials.Aluminium, //MV - Materials.StainlessSteel, //HV - Materials.Titanium, //EV - Materials.TungstenSteel, //IV - WerkstoffLoader.LuVTierMaterial, //LuV - Materials.Iridium, //ZPM - Materials.Osmium, //UV - Materials.Naquadah //UHV + ISubTagContainer[] hulls = { // Plate material used in the acid gen, diode and energy distributor below + Materials.WroughtIron, // ULV + Materials.Steel, // LV + Materials.Aluminium, // MV + Materials.StainlessSteel, // HV + Materials.Titanium, // EV + Materials.TungstenSteel, // IV + WerkstoffLoader.LuVTierMaterial, // LuV + Materials.Iridium, // ZPM + Materials.Osmium, // UV + Materials.Naquadah // UHV }; - ItemStack[] bats = {ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L)}; - ItemStack[] chreac = {ItemList.Machine_MV_ChemicalReactor.get(1L), ItemList.Machine_HV_ChemicalReactor.get(1L), ItemList.Machine_EV_ChemicalReactor.get(1L)}; + ItemStack[] bats = { + ItemList.Battery_Hull_LV.get(1L), ItemList.Battery_Hull_MV.get(1L), ItemList.Battery_Hull_HV.get(1L) + }; + ItemStack[] chreac = { + ItemList.Machine_MV_ChemicalReactor.get(1L), + ItemList.Machine_HV_ChemicalReactor.get(1L), + ItemList.Machine_EV_ChemicalReactor.get(1L) + }; for (int i = 0; i < 3; i++) { Materials cable = cables[i + 2]; ItemStack machinehull = ItemList.MACHINE_HULLS[i + 2].get(1L); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGens[i], - RecipeLoader.BITSD, - new Object[]{ - "HRH", - "HCH", - "HKH", - 'H', bats[i], - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), - 'C', machinehull, - 'R', chreac[i] - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.acidGens[i], RecipeLoader.BITSD, new Object[] { + "HRH", + "HCH", + "HKH", + 'H', + bats[i], + 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, cable, 1L), + 'C', + machinehull, + 'R', + chreac[i] + }); } - GT_ModHandler.addCraftingRecipe( - ItemRegistry.acidGensLV, - RecipeLoader.BITSD, - new Object[]{ - "HRH", - "KCK", - "HKH", - 'H', ItemList.Battery_Hull_LV.get(1L), - 'K', GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), - 'C', ItemList.Hull_LV.get(1L), - 'R', ItemList.Machine_LV_ChemicalReactor.get(1L), - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.acidGensLV, RecipeLoader.BITSD, new Object[] { + "HRH", + "KCK", + "HKH", + 'H', + ItemList.Battery_Hull_LV.get(1L), + 'K', + GT_OreDictUnificator.get(OrePrefixes.cableGt01, Materials.Tin, 1L), + 'C', + ItemList.Hull_LV.get(1L), + 'R', + ItemList.Machine_LV_ChemicalReactor.get(1L), + }); for (int i = 0; i < GT_Values.VN.length - 1; i++) { try { Materials cable = cables[i]; - ItemStack hull = hulls[i] instanceof Materials ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); + ItemStack hull = hulls[i] instanceof Materials + ? GT_OreDictUnificator.get(OrePrefixes.plate, hulls[i], 1L) + : ((Werkstoff) hulls[i]).get(OrePrefixes.plate); ItemStack machinehull = ItemList.MACHINE_HULLS[i].get(1L); GT_ModHandler.addCraftingRecipe( - ItemRegistry.energyDistributor[i], - RecipeLoader.BITSD, - new Object[]{ - "PWP", - "WCW", - "PWP", - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', hull, - 'C', machinehull + ItemRegistry.energyDistributor[i], RecipeLoader.BITSD, new Object[] { + "PWP", + "WCW", + "PWP", + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', + hull, + 'C', + machinehull }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode12A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode8A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode4A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode2A[i], - RecipeLoader.BITSD, - new Object[]{ - "WDW", - "DCD", - "PDP", - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.diode16A[i], - RecipeLoader.BITSD, - new Object[]{ - "WHW", - "DCD", - "PDP", - 'H', ItemList.Circuit_Parts_Coil.get(1L), - 'D', ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), - 'W', GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), - 'P', hull, - 'C', machinehull - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode12A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt12, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode8A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt08, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode4A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt04, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode2A[i], RecipeLoader.BITSD, new Object[] { + "WDW", + "DCD", + "PDP", + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.cableGt02, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[] { + "WHW", + "DCD", + "PDP", + 'H', + ItemList.Circuit_Parts_Coil.get(1L), + 'D', + ItemList.Circuit_Parts_Diode.get(1L, ItemList.Circuit_Parts_DiodeSMD.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); + GT_ModHandler.addCraftingRecipe(ItemRegistry.diode16A[i], RecipeLoader.BITSD, new Object[] { + "WHW", + "DCD", + "PDP", + 'H', + ItemList.Circuit_Parts_Coil.get(1L), + 'D', + ItemList.Circuit_Parts_DiodeSMD.get(1L, ItemList.Circuit_Parts_Diode.get(1L)), + 'W', + GT_OreDictUnificator.get(OrePrefixes.wireGt16, cable, 1L), + 'P', + hull, + 'C', + machinehull + }); } catch (ArrayIndexOutOfBoundsException e) { - //e.printStackTrace(); + // e.printStackTrace(); } } GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), GT_Utility.getIntegratedCircuit(17)}, + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), + GT_Utility.getIntegratedCircuit(17) + }, Materials.Plastic.getMolten(1152L), new ItemStack(ItemRegistry.BW_BLOCKS[2], 1, 1), 20, - BW_Util.getMachineVoltageFromTier(3) - ); + BW_Util.getMachineVoltageFromTier(3)); GT_ModHandler.addCraftingRecipe( - /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L), + /*Loader.isModLoaded("tectech") ? new TT_TileEntity_ManualTrafo(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, "bw.manualtrafo", StatCollector.translateToLocal("tile.manutrafo.name")).getStackForm(1L) :*/ new GT_TileEntity_ManualTrafo( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 1, + "bw.manualtrafo", + StatCollector.translateToLocal("tile.manutrafo.name")) + .getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "SCS", - "CHC", - "ZCZ", - 'S', GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), - 'C', new ItemStack(ItemRegistry.BW_BLOCKS[2]), - 'H', ItemList.Hull_HV.get(1L), - 'Z', "circuitAdvanced" - } - ); + new Object[] { + "SCS", + "CHC", + "ZCZ", + 'S', + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Titanium, 1L), + 'C', + new ItemStack(ItemRegistry.BW_BLOCKS[2]), + 'H', + ItemList.Hull_HV.get(1L), + 'Z', + "circuitAdvanced" + }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), Materials.Aluminium.getPlates(1), ItemList.Circuit_Board_Plastic.get(1L), ItemList.Battery_RE_LV_Lithium.get(1L)}, Materials.SolderingAlloy.getMolten(288L), new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), 600, BW_Util.getMachineVoltageFromTier(2)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.circuit, Materials.Good, 1L), + Materials.Aluminium.getPlates(1), + ItemList.Circuit_Board_Plastic.get(1L), + ItemList.Battery_RE_LV_Lithium.get(1L) + }, + Materials.SolderingAlloy.getMolten(288L), + new ItemStack(ItemRegistry.CIRCUIT_PROGRAMMER), + 600, + BW_Util.getMachineVoltageFromTier(2)); GT_ModHandler.addCraftingRecipe( - new GT_TileEntity_Windmill(ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, "bw.windmill", StatCollector.translateToLocal("tile.bw.windmill.name")).getStackForm(1L), + new GT_TileEntity_Windmill( + ConfigHandler.IDOffset + GT_Values.VN.length * 6 + 2, + "bw.windmill", + StatCollector.translateToLocal("tile.bw.windmill.name")) + .getStackForm(1L), RecipeLoader.BITSD, - new Object[]{ - "BHB", - "WGW", - "BWB", - 'B', new ItemStack(Blocks.brick_block), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - 'H', new ItemStack(Blocks.hopper), - 'G', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), - } - ); + new Object[] { + "BHB", + "WGW", + "BWB", + 'B', + new ItemStack(Blocks.brick_block), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + 'H', + new ItemStack(Blocks.hopper), + 'G', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), + }); String[] stones = {"stone", "stoneSmooth"}; String[] granites = {"blockGranite", "stoneGranite", "Granite", "granite"}; @@ -566,293 +844,281 @@ public class RecipeLoader { GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "SSS", - "DfD", - " h ", - 'S', stone, - 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - } - ); + new Object[] { + "SSS", + "DfD", + " h ", + 'S', + stone, + 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hDf", - "SSS", - 'S', stone, - 'D', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - } - ); + new Object[] { + "hDf", + "SSS", + 'S', + stone, + 'D', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "SSS", - "DfD", - " h ", - 'S', stone, - 'D', granite, - } - ); + new Object[] { + "SSS", "DfD", " h ", 'S', stone, 'D', granite, + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hDf", - "SSS", - 'S', stone, - 'D', granite, - } - ); + new Object[] { + "hDf", "SSS", 'S', stone, 'D', granite, + }); } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "STS", - "h f", - "SBS", - 'S', granite, - 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - } - ); + new Object[] { + "STS", + "h f", + "SBS", + 'S', + granite, + 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + }); } GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 2), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "STS", - "h f", - "SBS", - 'S', new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), - 'T', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), - 'B', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), - } - ); + new Object[] { + "STS", + "h f", + "SBS", + 'S', + new ItemStack(GregTech_API.sBlockGranites, 1, OreDictionary.WILDCARD_VALUE), + 'T', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 0), + 'B', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 1), + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WLs", - "WLh", - "WLf", - 'L', new ItemStack(Items.leather), - 'W', "logWood", - } - ); + new Object[] { + "WLs", "WLh", "WLf", 'L', new ItemStack(Items.leather), 'W', "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WLs", - "WLh", - "WLf", - 'L', new ItemStack(Blocks.carpet), - 'W', "logWood", - } - ); + new Object[] { + "WLs", "WLh", "WLf", 'L', new ItemStack(Blocks.carpet), 'W', "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WLs", - "WLh", - "WLf", - 'L', new ItemStack(Items.paper), - 'W', "logWood", - } - ); + new Object[] { + "WLs", "WLh", "WLf", 'L', new ItemStack(Items.paper), 'W', "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "WEs", - "WZh", - "WDf", - 'Z', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'D', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'E', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', "logWood", - } - ); + new Object[] { + "WEs", + "WZh", + "WDf", + 'Z', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'D', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'E', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + "logWood", + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.LEATHER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); - GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.WOOL_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.LEATHER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 3), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.PAPER_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.WOOL_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 4), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.COMBINED_ROTOR), - GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[]{ - "hPf", - "PWP", - "sPr", - 'P', new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), - 'W', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.PAPER_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 5), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_ModHandler.addCraftingRecipe( - new ItemStack(ItemRegistry.ROTORBLOCK), - RecipeLoader.BITSD, - new Object[]{ - "WRW", - "RGR", - "WRW", - 'R', GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), - 'W', "plankWood", - 'G', GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), - } - ); + new ItemStack(ItemRegistry.COMBINED_ROTOR), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { + "hPf", + "PWP", + "sPr", + 'P', + new ItemStack(ItemRegistry.CRAFTING_PARTS, 1, 6), + 'W', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); + GT_ModHandler.addCraftingRecipe(new ItemStack(ItemRegistry.ROTORBLOCK), RecipeLoader.BITSD, new Object[] { + "WRW", + "RGR", + "WRW", + 'R', + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Iron, 1L), + 'W', + "plankWood", + 'G', + GT_OreDictUnificator.get(OrePrefixes.gearGt, Materials.Iron, 1L), + }); GT_TileEntity_THTR.THTRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.THTR, - RecipeLoader.BITSD, - new Object[]{ - "BZB", - "BRB", - "BZB", - 'B', new ItemStack(GregTech_API.sBlockCasings3, 1, 12), - 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', "circuitUltimate" - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.THTR, RecipeLoader.BITSD, new Object[] { + "BZB", + "BRB", + "BZB", + 'B', + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + 'R', + GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), + 'Z', + "circuitUltimate" + }); GT_TileEntity_HTGR.HTGRMaterials.registerTHR_Recipes(); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.HTGR, - RecipeLoader.BITSD, - new Object[]{ - "BZB", - "BRB", - "BZB", - 'B', new ItemStack(GregTech_API.sBlockCasings8, 1, 5), - 'R', GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), - 'Z', "circuitSuperconductor" - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.HTGR, RecipeLoader.BITSD, new Object[] { + "BZB", + "BRB", + "BZB", + 'B', + new ItemStack(GregTech_API.sBlockCasings8, 1, 5), + 'R', + GT_ModHandler.getModItem("IC2", "blockGenerator", 1, 5), + 'Z', + "circuitSuperconductor" + }); - GT_ModHandler.addCraftingRecipe( - ItemRegistry.EIG, - RecipeLoader.BITSD, - new Object[]{ - "AZA", - "BRB", - "AZA", - 'B', new ItemStack(GregTech_API.sBlockCasings4, 1, 1), - 'R', GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), - 'A', new ItemStack(GregTech_API.sBlockMachines, 1, 11104), - 'Z', "circuitUltimate" - } - ); + GT_ModHandler.addCraftingRecipe(ItemRegistry.EIG, RecipeLoader.BITSD, new Object[] { + "AZA", + "BRB", + "AZA", + 'B', + new ItemStack(GregTech_API.sBlockCasings4, 1, 1), + 'R', + GT_ModHandler.getModItem("EnderIO", "blockFarmStation", 1), + 'A', + new ItemStack(GregTech_API.sBlockMachines, 1, 11104), + 'Z', + "circuitUltimate" + }); if (LoaderReference.galacticgreg) { GT_Values.RA.addAssemblylineRecipe( ItemList.OreDrill4.get(1L), BW_Util.getMachineVoltageFromTier(6), - new Object[]{ - ItemList.OreDrill4.get(1L), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), - Materials.Europium.getPlates(3), - ItemList.Electric_Motor_LuV.get(9L), - ItemList.Sensor_LuV.get(9L), - ItemList.Field_Generator_LuV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) + new Object[] { + ItemList.OreDrill4.get(1L), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Europium, 9L), + Materials.Europium.getPlates(3), + ItemList.Electric_Motor_LuV.get(9L), + ItemList.Sensor_LuV.get(9L), + ItemList.Field_Generator_LuV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Neon.getFluidOrGas(20000), + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Neon.getFluidOrGas(20000), }, ItemRegistry.voidminer[0].copy(), 108000, - BW_Util.getMachineVoltageFromTier(6) - ); + BW_Util.getMachineVoltageFromTier(6)); } if (!LoaderReference.tectech) { @@ -860,101 +1126,94 @@ public class RecipeLoader { GT_Values.RA.addAssemblylineRecipe( ItemRegistry.voidminer[0].copy(), BW_Util.getMachineVoltageFromTier(7), - new Object[]{ - ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), - ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), - ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) + new Object[] { + ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), + ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), + ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Krypton.getFluidOrGas(20000) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), 216000, - BW_Util.getMachineVoltageFromTier(7) - ); + BW_Util.getMachineVoltageFromTier(7)); GT_Values.RA.addAssemblylineRecipe( ItemRegistry.voidminer[1].copy(), BW_Util.getMachineVoltageFromTier(8), - new Object[]{ - ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), - ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), - ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) + new Object[] { + ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), + ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Oganesson.getFluidOrGas(20000) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), 432000, - BW_Util.getMachineVoltageFromTier(8) - ); + BW_Util.getMachineVoltageFromTier(8)); } GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_Multi_ImplosionCompressor.get(1L), 24000, - new ItemStack[]{ - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + 24000, + new ItemStack[] { + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 240000, - BW_Util.getMachineVoltageFromTier(8) - ); + BW_Util.getMachineVoltageFromTier(8)); } else { ItemStack[][] converters = ItemRegistry.TecTechLaserAdditions[0]; ItemStack[][] input = ItemRegistry.TecTechLaserAdditions[1]; ItemStack[][] dynamo = ItemRegistry.TecTechLaserAdditions[2]; ItemList[] emitters = { - ItemList.Emitter_EV, - ItemList.Emitter_IV, - ItemList.Emitter_LuV, - ItemList.Emitter_ZPM + ItemList.Emitter_EV, ItemList.Emitter_IV, ItemList.Emitter_LuV, ItemList.Emitter_ZPM }; - ItemList[] sensors = { - ItemList.Sensor_EV, - ItemList.Sensor_IV, - ItemList.Sensor_LuV, - ItemList.Sensor_ZPM - }; + ItemList[] sensors = {ItemList.Sensor_EV, ItemList.Sensor_IV, ItemList.Sensor_LuV, ItemList.Sensor_ZPM}; OrePrefixes[] prefixes = { - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, - WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt04 : OrePrefixes.wireGt04, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt08 : OrePrefixes.wireGt08, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt12 : OrePrefixes.wireGt12, + WerkstoffLoader.gtnhGT ? OrePrefixes.cableGt16 : OrePrefixes.cableGt12 }; GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - ItemList.Circuit_Parts_GlassFiber.get(32), - GT_OreDictUnificator.get(WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, Materials.Electrum, WerkstoffLoader.gtnhGT ? 8 : 1), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) + new ItemStack[] { + ItemList.Circuit_Parts_GlassFiber.get(32), + GT_OreDictUnificator.get( + WerkstoffLoader.gtnhGT ? OrePrefixes.foil : OrePrefixes.plateDouble, + Materials.Electrum, + WerkstoffLoader.gtnhGT ? 8 : 1), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.gemExquisite, 2) }, Materials.Polytetrafluoroethylene.getMolten(72), - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), 1, ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + 1, + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), 200, - BW_Util.getMachineVoltageFromTier(4) - ); + BW_Util.getMachineVoltageFromTier(4)); for (int j = 0; j < 4; j++) { for (int i = 0; i < 4; i++) { @@ -964,37 +1223,46 @@ public class RecipeLoader { int solderingAmount = Math.max(144 * i, 72) * (j + 1); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - sensors[i].get(2 * (j + 1)), - ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + sensors[i].get(2 * (j + 1)), + ItemList.TRANSFORMERS[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), converter, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - sensors[i].get(2 * (j + 1)), - ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + sensors[i].get(2 * (j + 1)), + ItemList.HATCHES_ENERGY[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), eInput, 200 * (j + 1), BW_Util.getMachineVoltageFromTier(4 + i)); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ - new ItemStack(ItemRegistry.TecTechPipeEnergyLowPower.getItem(), ((j + 1) * 16), ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), - WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), - GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), - emitters[i].get(2 * (j + 1)), - ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), + new ItemStack[] { + new ItemStack( + ItemRegistry.TecTechPipeEnergyLowPower.getItem(), + ((j + 1) * 16), + ItemRegistry.TecTechPipeEnergyLowPower.getItemDamage()), + WerkstoffLoader.CubicZirconia.get(OrePrefixes.lens), + GT_OreDictUnificator.get(prefixes[j], cables[i + 4], 8), + emitters[i].get(2 * (j + 1)), + ItemList.HATCHES_DYNAMO[4 + i].get(2 * (j + 1)), }, Materials.SolderingAlloy.getMolten(solderingAmount), eDynamo, @@ -1004,38 +1272,203 @@ public class RecipeLoader { } } - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Input_HV.get(64), Materials.LiquidAir.getCells(1), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.compressedHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0)); - GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{ItemRegistry.giantOutputHatch.copy()}, null, null, null, null, 300, BW_Util.getMachineVoltageFromTier(3), 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + ItemList.Hatch_Input_HV.get(64), + Materials.LiquidAir.getCells(1), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {ItemRegistry.compressedHatch.copy()}, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); + GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {ItemList.Hatch_Output_HV.get(64), GT_Utility.getIntegratedCircuit(17)}, + new ItemStack[] {ItemRegistry.giantOutputHatch.copy()}, + null, + null, + null, + null, + 300, + BW_Util.getMachineVoltageFromTier(3), + 0)); GT_Values.RA.addAssemblylineRecipe( - ItemList.Machine_LuV_CircuitAssembler.get(1L), 24000, - new ItemStack[]{ - ItemList.Machine_LuV_CircuitAssembler.get(1L), - ItemList.Robot_Arm_LuV.get(4L), - ItemList.Electric_Motor_LuV.get(4L), - ItemList.Field_Generator_LuV.get(1L), - ItemList.Emitter_LuV.get(1L), - ItemList.Sensor_LuV.get(1L), - Materials.Chrome.getPlates(8) - }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440) + ItemList.Machine_LuV_CircuitAssembler.get(1L), + 24000, + new ItemStack[] { + ItemList.Machine_LuV_CircuitAssembler.get(1L), + ItemList.Robot_Arm_LuV.get(4L), + ItemList.Electric_Motor_LuV.get(4L), + ItemList.Field_Generator_LuV.get(1L), + ItemList.Emitter_LuV.get(1L), + ItemList.Sensor_LuV.get(1L), + Materials.Chrome.getPlates(8) }, + new FluidStack[] {new FluidStack(solderIndalloy, 1440)}, ItemRegistry.cal.copy(), 24000, - BW_Util.getMachineVoltageFromTier(6) - ); + BW_Util.getMachineVoltageFromTier(6)); } - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 250, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 320, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 580, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), GT_Values.NI, GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 300, 90); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 390, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), ItemList.Cell_Empty.get(2), GT_Values.NF, Materials.Oxygen.getGas(2000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), GT_Values.NI, GT_Values.NI, null, 460, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 710, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(19000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), null, 720, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), ItemList.Cell_Empty.get(3), GT_Values.NF, Materials.Oxygen.getGas(6000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), null, 730, 120); - GT_Values.RA.addElectrolyzerRecipe(WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), ItemList.Cell_Empty.get(1), GT_Values.NF, Materials.Oxygen.getGas(1000L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), GT_Values.NI, null, 790, 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Forsterit.get(OrePrefixes.dust, 7), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 200, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.RedZircon.get(OrePrefixes.dust, 6), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + WerkstoffLoader.Zirconium.get(OrePrefixes.dust, 1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 250, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Fayalit.get(OrePrefixes.dust, 7), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 2L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 320, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Prasiolite.get(OrePrefixes.dust, 16), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 5L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 580, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Hedenbergit.get(OrePrefixes.dust, 10), + GT_Values.NI, + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Calcium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 2L), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + null, + 300, + 90); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FuchsitAL.get(OrePrefixes.dust, 21), + ItemList.Cell_Empty.get(2), + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), + GT_Values.NI, + GT_Values.NI, + null, + 390, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FuchsitCR.get(OrePrefixes.dust, 21), + ItemList.Cell_Empty.get(2), + GT_Values.NF, + Materials.Oxygen.getGas(2000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Potassium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 3L), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 2), + GT_Values.NI, + GT_Values.NI, + null, + 460, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.VanadioOxyDravit.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(19000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Vanadium, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), + null, + 710, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.ChromoAluminoPovondrait.get(OrePrefixes.dust, 53), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(19000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Chrome, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Magnalium, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 3), + null, + 720, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.FluorBuergerit.get(OrePrefixes.dust, 50), + ItemList.Cell_Empty.get(3), + GT_Values.NF, + Materials.Oxygen.getGas(6000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Iron, 3L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fluorine, 3), + null, + 730, + 120); + GT_Values.RA.addElectrolyzerRecipe( + WerkstoffLoader.Olenit.get(OrePrefixes.dust, 51), + ItemList.Cell_Empty.get(1), + GT_Values.NF, + Materials.Oxygen.getGas(1000L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sodium, 1L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminiumoxide, 9L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.SiliconDioxide, 6L), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Boron, 3), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Hydrogen, 1), + GT_Values.NI, + null, + 790, + 120); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java index bac618bb95..26f268f0ef 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterServerCommands.java @@ -27,7 +27,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; public class RegisterServerCommands { - public static void registerAll(FMLServerStartingEvent event){ + public static void registerAll(FMLServerStartingEvent event) { event.registerServerCommand(new SummonRuin()); event.registerServerCommand(new ChangeConfig()); event.registerServerCommand(new PrintRecipeListToFile()); @@ -35,5 +35,4 @@ public class RegisterServerCommands { event.registerServerCommand(new GetWorkingDirectory()); event.registerServerCommand(new RunGC()); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java index 7a29cac216..6e9ae5d852 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.loaders; +import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.GT_Values.VN; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -42,6 +46,10 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; +import java.util.stream.Collectors; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; @@ -51,26 +59,16 @@ import net.minecraftforge.oredict.OreDictionary; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.*; -import java.util.stream.Collectors; - -import static com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.eicMap; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.GT_Values.VN; - public class StaticRecipeChangeLoaders { private static TObjectDoubleHashMap<Materials> gtEbfGasRecipeTimeMultipliers = null; private static TObjectDoubleHashMap<Materials> gtEbfGasRecipeConsumptionMultipliers = null; public static final List<ItemStack> whitelistForEBFNoGasRecipeDontCheckItemData = Arrays.asList( - GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot (coremod) - ); + GT_ModHandler.getModItem("TConstruct", "materials", 1L, 12) // Raw Aluminum -> Aluminium Ingot (coremod) + ); - private StaticRecipeChangeLoaders() { - } + private StaticRecipeChangeLoaders() {} public static void addEBFGasRecipes() { if (gtEbfGasRecipeTimeMultipliers == null) { @@ -81,8 +79,10 @@ public class StaticRecipeChangeLoaders { } if (gtEbfGasRecipeConsumptionMultipliers == null) { // For Werkstoff gases, use Werkstoff.Stats.setEbfGasRecipeConsumedAmountMultiplier - gtEbfGasRecipeConsumptionMultipliers = new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as 1 - // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L etc.): + gtEbfGasRecipeConsumptionMultipliers = + new TObjectDoubleHashMap<>(10, 0.5F, 1.0D); // keep default value as 1 + // Example to make Argon recipes use half the gas amount of the primary recipe (1000L->500L, 2000L->1000L + // etc.): // gtEbfGasRecipeConsumptionMultipliers.put(Materials.Argon, 1.0D / 2.0D); } ArrayListMultimap<SubTag, GT_Recipe> toChange = getRecipesToChange(NOBLE_GAS, ANAEROBE_GAS); @@ -92,10 +92,11 @@ public class StaticRecipeChangeLoaders { public static void fixEnergyRequirements() { GT_Recipe.GT_Recipe_Map.sMappings.stream() .filter(StreamUtils::filterVisualMaps) - .forEach(gt_recipe_map -> - gt_recipe_map.mRecipeList.parallelStream().forEach(gt_recipe -> { + .forEach(gt_recipe_map -> gt_recipe_map.mRecipeList.parallelStream() + .forEach(gt_recipe -> { for (int i = 0; i < (VN.length - 1); i++) { - if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { + if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i) + && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) { gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i); } } @@ -110,20 +111,32 @@ public class StaticRecipeChangeLoaders { } } - private static void replaceWrongFluidInput(Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) { + private static void replaceWrongFluidInput( + Werkstoff werkstoff, GT_Recipe.GT_Recipe_Map map, GT_Recipe recipe, FluidStack wrongNamedFluid) { for (int i = 0; i < recipe.mFluidInputs.length; i++) { if (GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], wrongNamedFluid)) { Collection<GT_Recipe> col = map.mRecipeFluidMap.get(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.remove(wrongNamedFluid.getFluid()); map.mRecipeFluidMap.put(werkstoff.getFluidOrGas(1).getFluid(), col); recipe.mFluidInputs[i] = werkstoff.getFluidOrGas(recipe.mFluidInputs[i].amount); - map.mRecipeFluidNameMap.add(werkstoff.getFluidOrGas(1).getFluid().getName()); + map.mRecipeFluidNameMap.add( + werkstoff.getFluidOrGas(1).getFluid().getName()); } } } private static void addConversionRecipe(Werkstoff werkstoff, FluidStack wrongNamedFluid) { - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(false, null, null, null, null, new FluidStack[]{wrongNamedFluid}, new FluidStack[]{werkstoff.getFluidOrGas(1)}, 1, 1, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + null, + null, + null, + null, + new FluidStack[] {wrongNamedFluid}, + new FluidStack[] {werkstoff.getFluidOrGas(1)}, + 1, + 1, + 0)); } private static FluidStack getWrongNameFluid(Werkstoff werkstoff) { @@ -148,8 +161,7 @@ public class StaticRecipeChangeLoaders { StaticRecipeChangeLoaders.runMaterialLinker(werkstoff); if (werkstoff.getGenerationFeatures().enforceUnification) { - if (werkstoff.contains(NOBLE_GAS)) - enforceNobleGas(werkstoff); + if (werkstoff.contains(NOBLE_GAS)) enforceNobleGas(werkstoff); HashSet<String> oreDictNames = new HashSet<>(werkstoff.getADDITIONAL_OREDICT()); oreDictNames.add(werkstoff.getVarName()); @@ -157,48 +169,50 @@ public class StaticRecipeChangeLoaders { StaticRecipeChangeLoaders.runUnficationDeleter(werkstoff); for (String s : oreDictNames) for (OrePrefixes prefixes : OrePrefixes.values()) { - if (!werkstoff.hasItemType(prefixes)) - continue; + if (!werkstoff.hasItemType(prefixes)) continue; String fullOreName = prefixes + s; List<ItemStack> ores = OreDictionary.getOres(fullOreName, false); if (ores.size() <= 1) // empty or one entry, i.e. no unification needed - continue; + continue; for (ItemStack toReplace : ores) { ItemStack replacement = werkstoff.get(prefixes); - if (toReplace == null || GT_Utility.areStacksEqual(toReplace, replacement) || replacement == null || replacement.getItem() == null) - continue; + if (toReplace == null + || GT_Utility.areStacksEqual(toReplace, replacement) + || replacement == null + || replacement.getItem() == null) continue; for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { nextRecipe: for (Iterator<GT_Recipe> iterator = map.mRecipeList.iterator(); iterator.hasNext(); ) { GT_Recipe recipe = iterator.next(); - boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); + boolean removal = map.equals(GT_Recipe_Map.sFluidExtractionRecipes) + || map.equals(GT_Recipe_Map.sFluidSolidficationRecipes); for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) - continue; + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - recipe.mInputs[i] = GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); + recipe.mInputs[i] = + GT_Utility.copyAmount(recipe.mInputs[i].stackSize, replacement); } for (int i = 0; i < recipe.mOutputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) - continue; + if (!GT_Utility.areStacksEqual(recipe.mOutputs[i], toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - recipe.mOutputs[i] = GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement); + recipe.mOutputs[i] = + GT_Utility.copyAmount(recipe.mOutputs[i].stackSize, replacement); } if (recipe.mSpecialItems instanceof ItemStack) { ItemStack specialItemStack = (ItemStack) recipe.mSpecialItems; - if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) - continue; + if (!GT_Utility.areStacksEqual(specialItemStack, toReplace)) continue; if (removal) { iterator.remove(); continue nextRecipe; } - recipe.mSpecialItems = GT_Utility.copyAmount((specialItemStack).stackSize, replacement); + recipe.mSpecialItems = + GT_Utility.copyAmount((specialItemStack).stackSize, replacement); } } } @@ -212,17 +226,22 @@ public class StaticRecipeChangeLoaders { private static void runMoltenUnificationEnfocement(Werkstoff werkstoff) { if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { try { - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); + FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(molten.get(werkstoff)), 144), + werkstoff.get(WerkstoffLoader.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); + 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()) { + for (Map.Entry<GT_ItemStack, FluidContainerRegistry.FluidContainerData> entry : + sFilledContainerToData.entrySet()) { final String MODID = GameRegistry.findUniqueIdentifierFor(data.filledContainer.getItem()).modId; - if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) - continue; - if (entry.getValue().fluid.equals(data.fluid) && !entry.getValue().filledContainer.equals(data.filledContainer)) { + if (MODID.equals(MainMod.MOD_ID) || MODID.equals(BartWorksCrossmod.MOD_ID)) continue; + if (entry.getValue().fluid.equals(data.fluid) + && !entry.getValue().filledContainer.equals(data.filledContainer)) { toReplace = entry.getValue().filledContainer; torem.add(entry); } @@ -243,7 +262,9 @@ public class StaticRecipeChangeLoaders { 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)) { + 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; } @@ -316,7 +337,8 @@ public class StaticRecipeChangeLoaders { if (mat != Materials._NULL) { for (SubTag tag : GasTags) { if (mat.contains(tag)) { - DebugLog.log("Found EBF Recipe to change, Output:" + BW_Util.translateGTItemStack(recipe.mOutputs[0])); + DebugLog.log("Found EBF Recipe to change, Output:" + + BW_Util.translateGTItemStack(recipe.mOutputs[0])); toAdd.put(tag, recipe); } } @@ -338,30 +360,39 @@ public class StaticRecipeChangeLoaders { for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList) { 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++) { - ItemStack tmpInput = recipe.mInputs[i]; - if ( - (recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) - && (whitelistForEBFNoGasRecipeDontCheckItemData.stream().anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) - || (BW_Util.checkStackAndPrefix(recipe.mInputs[i]) + 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++) { + ItemStack tmpInput = recipe.mInputs[i]; + if ((recipe.mFluidInputs == null || recipe.mFluidInputs.length == 0) + && (whitelistForEBFNoGasRecipeDontCheckItemData.stream() + .anyMatch(s -> GT_Utility.areStacksEqual(s, tmpInput)) + || (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], baseRe.mOutputs[0])))) { - toAdd.add(recipe.mOutputs[0]); - repToAdd.put(tag, recipe); - continue recipeLoop; - } - } + && GT_OreDictUnificator.getAssociation(recipe.mInputs[i]) + .mMaterial + .mMaterial + .equals(GT_OreDictUnificator.getAssociation( + baseRe.mInputs[i]) + .mMaterial + .mMaterial) + && GT_Utility.areStacksEqual( + recipe.mOutputs[0], baseRe.mOutputs[0])))) { + toAdd.add(recipe.mOutputs[0]); + repToAdd.put(tag, recipe); + continue recipeLoop; + } } + } } base.putAll(repToAdd); return toAdd; } private static int transformEBFGasRecipeTime(int originalDuration, long originalGasProtons, long newGasProtons) { - double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) - (double) newGasProtons; + double protonTerm = (double) originalGasProtons * (newGasProtons >= originalGasProtons ? 1.0D : 2.75D) + - (double) newGasProtons; return Math.max(1, (int) ((double) originalDuration / 200D * Math.max(200D + protonTerm, 1D))); } @@ -377,7 +408,10 @@ public class StaticRecipeChangeLoaders { private static int transformEBFGasRecipeTime(GT_Recipe recipe, Materials originalGas, Werkstoff newGas) { double newEbfMul = newGas.getStats().getEbfGasRecipeTimeMultiplier(); if (newEbfMul < 0.0D) { - return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), newGas.getStats().getProtons()); + return transformEBFGasRecipeTime( + recipe.mDuration, + originalGas.getProtons(), + newGas.getStats().getProtons()); } else { return Math.max(1, (int) ((double) recipe.mDuration * newEbfMul)); } @@ -387,51 +421,125 @@ public class StaticRecipeChangeLoaders { return transformEBFGasRecipeTime(recipe.mDuration, originalGas.getProtons(), 0); } - private static void editEBFMaterialRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet<GT_Recipe> toAdd) { + private static void editEBFMaterialRecipes( + SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet<GT_Recipe> toAdd) { for (Materials newGas : Materials.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); - int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); - if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { + int gasAmount = Math.max(1, (int) Math.round( + (double) recipe.mFluidInputs[0].amount * gtEbfGasRecipeConsumptionMultipliers.get(newGas))); + if (recipe.mFluidInputs != null + && recipe.mFluidInputs.length == 1 + && recipe.mFluidInputs[0].isFluidEqual(newGas.getGas(0))) { // preserve original recipe owner - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue, recipe)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {newGas.getGas(gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{newGas.getGas(gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {newGas.getGas(gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } - private static void editEBFWerkstoffRecipes(SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet<GT_Recipe> toAdd) { + private static void editEBFWerkstoffRecipes( + SubTag GasTag, GT_Recipe recipe, Materials originalGas, HashSet<GT_Recipe> toAdd) { for (Werkstoff newGas : Werkstoff.werkstoffHashMap.values()) { if (newGas.contains(GasTag)) { int time = transformEBFGasRecipeTime(recipe, originalGas, newGas); - int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); - if (recipe.mFluidInputs != null && recipe.mFluidInputs.length == 1 && recipe.mFluidInputs[0].isFluidEqual(new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { + int gasAmount = Math.max(1, (int) Math.round((double) recipe.mFluidInputs[0].amount + * newGas.getStats().getEbfGasRecipeConsumedAmountMultiplier())); + if (recipe.mFluidInputs != null + && recipe.mFluidInputs.length == 1 + && recipe.mFluidInputs[0].isFluidEqual( + new FluidStack(Objects.requireNonNull(fluids.get(newGas)), 0))) { // preserve original recipe owner - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue, recipe)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue, + recipe)); } else { // new recipe - toAdd.add(new BWRecipes.DynamicGTRecipe(false, recipe.mInputs, recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, new FluidStack[]{new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, recipe.mFluidOutputs, time, recipe.mEUt, recipe.mSpecialValue)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + recipe.mInputs, + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + new FluidStack[] {new FluidStack(Objects.requireNonNull(fluids.get(newGas)), gasAmount)}, + recipe.mFluidOutputs, + time, + recipe.mEUt, + recipe.mSpecialValue)); } } } } - private static void editEBFNoGasRecipes(GT_Recipe recipe, Materials originalGas, HashSet<GT_Recipe> toAdd, HashSet<ItemStack> noGas) { + private static void editEBFNoGasRecipes( + GT_Recipe recipe, Materials originalGas, HashSet<GT_Recipe> toAdd, HashSet<ItemStack> noGas) { for (ItemStack is : noGas) { byte circuitConfiguration = 1; if (GT_Utility.areStacksEqual(is, recipe.mOutputs[0])) { ArrayList<ItemStack> inputs = new ArrayList<>(recipe.mInputs.length); for (ItemStack stack : recipe.mInputs) - if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { + if (!GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(11), stack) + && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(14), stack) + && !GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(19), stack)) { if (BW_Util.checkStackAndPrefix(stack)) - circuitConfiguration = (byte) (GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustSmall) ? 4 : GT_OreDictUnificator.getAssociation(stack).mPrefix.equals(OrePrefixes.dustTiny) ? 9 : 1); + circuitConfiguration = (byte) + (GT_OreDictUnificator.getAssociation(stack) + .mPrefix + .equals(OrePrefixes.dustSmall) + ? 4 + : GT_OreDictUnificator.getAssociation(stack) + .mPrefix + .equals(OrePrefixes.dustTiny) + ? 9 + : 1); inputs.add(stack); } inputs.add(GT_Utility.getIntegratedCircuit(circuitConfiguration)); - toAdd.add(new BWRecipes.DynamicGTRecipe(false, inputs.toArray(new ItemStack[0]), recipe.mOutputs, recipe.mSpecialItems, recipe.mChances, null, recipe.mFluidOutputs, transformEBFNoGasRecipeTime(recipe, originalGas), recipe.mEUt, recipe.mSpecialValue, recipe)); + toAdd.add(new BWRecipes.DynamicGTRecipe( + false, + inputs.toArray(new ItemStack[0]), + recipe.mOutputs, + recipe.mSpecialItems, + recipe.mChances, + null, + recipe.mFluidOutputs, + transformEBFNoGasRecipeTime(recipe, originalGas), + recipe.mEUt, + recipe.mSpecialValue, + recipe)); break; } } @@ -441,19 +549,20 @@ public class StaticRecipeChangeLoaders { HashSet<GT_Recipe> duplicates = new HashSet<>(); for (GT_Recipe recipe : toAdd) { for (GT_Recipe recipe2 : toAdd) { - if (recipe.mEUt != recipe2.mEUt || recipe.mDuration != recipe2.mDuration || recipe.mSpecialValue != recipe2.mSpecialValue || recipe == recipe2 || recipe.mInputs.length != recipe2.mInputs.length || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) - continue; + if (recipe.mEUt != recipe2.mEUt + || recipe.mDuration != recipe2.mDuration + || recipe.mSpecialValue != recipe2.mSpecialValue + || recipe == recipe2 + || recipe.mInputs.length != recipe2.mInputs.length + || recipe.mFluidInputs.length != recipe2.mFluidInputs.length) continue; boolean isSame = true; for (int i = 0; i < recipe.mInputs.length; i++) { - if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) - isSame = false; + if (!GT_Utility.areStacksEqual(recipe.mInputs[i], recipe2.mInputs[i])) isSame = false; } for (int i = 0; i < recipe.mFluidInputs.length; i++) { - if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) - isSame = false; + if (!GT_Utility.areFluidsEqual(recipe.mFluidInputs[i], recipe2.mFluidInputs[i])) isSame = false; } - if (isSame) - duplicates.add(recipe2); + if (isSame) duplicates.add(recipe2); } } toAdd.removeAll(duplicates); @@ -468,15 +577,15 @@ public class StaticRecipeChangeLoaders { } private static void editRecipes(ArrayListMultimap<SubTag, GT_Recipe> base, HashSet<ItemStack> noGas) { - if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains(Objects.requireNonNull(fluids.get(Oganesson)).getName())) - return; + if (GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeFluidNameMap.contains( + Objects.requireNonNull(fluids.get(Oganesson)).getName())) return; 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) { - Materials originalGas = getMaterialFromInputFluid(recipe); + Materials originalGas = getMaterialFromInputFluid(recipe); if (originalGas != Materials._NULL) { editEBFWerkstoffRecipes(gasTag, recipe, originalGas, toAdd); editEBFMaterialRecipes(gasTag, recipe, originalGas, toAdd); @@ -494,8 +603,37 @@ public class StaticRecipeChangeLoaders { @SuppressWarnings("ALL") public static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { - eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 0, 0, 1, "", 1, "", true, true); - GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream().filter(e -> e.mInputs != null).forEach(recipe -> eicMap.addRecipe(true, Arrays.stream(recipe.mInputs).filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)).distinct().toArray(ItemStack[]::new), recipe.mOutputs, null, null, null, 1, BW_Util.getMachineVoltageFromTier(10), 0)); + eicMap = new GT_Recipe.GT_Recipe_Map( + new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), + "gt.recipe.electricimplosioncompressor", + "Electric Implosion Compressor", + (String) null, + "gregtech:textures/gui/basicmachines/Default", + 1, + 2, + 0, + 0, + 1, + "", + 1, + "", + true, + true); + GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.stream() + .filter(e -> e.mInputs != null) + .forEach(recipe -> eicMap.addRecipe( + true, + Arrays.stream(recipe.mInputs) + .filter(e -> !StaticRecipeChangeLoaders.checkForExplosives(e)) + .distinct() + .toArray(ItemStack[]::new), + recipe.mOutputs, + null, + null, + null, + 1, + BW_Util.getMachineVoltageFromTier(10), + 0)); } // Custom electric implosion compressor recipe. Cannot be overclocked. @@ -503,18 +641,23 @@ public class StaticRecipeChangeLoaders { // 72L SpaceTime -> 1 Eternal singularity. eicMap.addRecipe( - false, - new ItemStack[]{GT_Values.NI}, - new ItemStack[]{GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, - null, - new FluidStack[]{Materials.SpaceTime.getMolten(72L)}, - new FluidStack[]{GT_Values.NF}, - 100*20, 128_000_000, 1); // aSpecialVaue has no meaning here. + false, + new ItemStack[] {GT_Values.NI}, + new ItemStack[] {GT_ModHandler.getModItem("eternalsingularity", "eternal_singularity", 1L)}, + null, + new FluidStack[] {Materials.SpaceTime.getMolten(72L)}, + new FluidStack[] {GT_Values.NF}, + 100 * 20, + 128_000_000, + 1); // aSpecialVaue has no meaning here. } } private static boolean checkForExplosives(ItemStack input) { - return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); + return (GT_Utility.areStacksEqual(input, new ItemStack(Blocks.tnt)) + || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("industrialTnt", 1L)) + || GT_Utility.areStacksEqual(input, GT_ModHandler.getIC2Item("dynamite", 1L)) + || GT_Utility.areStacksEqual(input, ItemList.Block_Powderbarrel.get(1L))); } public static void patchEBFMapForCircuitUnification() { @@ -533,8 +676,7 @@ public class StaticRecipeChangeLoaders { public static void synchroniseCircuitUseMulti() { GT_Recipe.GT_Recipe_Map[] gt_recipe_maps = { - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes, - GT_Recipe.GT_Recipe_Map.sBlastRecipes + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes, GT_Recipe.GT_Recipe_Map.sBlastRecipes }; getRecipesByCircuitID(gt_recipe_maps).forEach(StaticRecipeChangeLoaders::transformCircuitRecipes); } @@ -552,17 +694,16 @@ public class StaticRecipeChangeLoaders { ret /= 10; } - if (recipe.mFluidInputs.length != 0) - ret += 10; + if (recipe.mFluidInputs.length != 0) ret += 10; return ret; } - private static int getLogicFuntion(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair<Integer, Integer> counts) { + private static int getLogicFuntion( + GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair<Integer, Integer> counts) { if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) return getChemicalLogic(recipe, counts); - else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) - return getBlastLogic(recipe); + else if (gt_recipe_map == GT_Recipe.GT_Recipe_Map.sBlastRecipes) return getBlastLogic(recipe); throw new NoSuchMethodError("Could not find a Supported Method for " + gt_recipe_map.mUnlocalizedName); } @@ -571,17 +712,16 @@ public class StaticRecipeChangeLoaders { if (counts.getKey() == 0 || counts.getValue() == 0) toSet = new Pair<>(Math.max(recipe.mFluidOutputs.length, recipe.mOutputs.length), 0); - else if (counts.getValue() > 2) - toSet = new Pair<>(counts.getKey() + counts.getValue(), 1); - else - toSet = counts; + else if (counts.getValue() > 2) toSet = new Pair<>(counts.getKey() + counts.getValue(), 1); + else toSet = counts; return toSet.getValue() * 10 + toSet.getKey(); } - private static void transformCircuitRecipes(GT_Recipe.GT_Recipe_Map gtRecipeMap, Map<GT_Recipe, Pair<Integer, Integer>> mapGtRecipeCounts) { - mapGtRecipeCounts.forEach((recipe, counts) -> - StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); + private static void transformCircuitRecipes( + GT_Recipe.GT_Recipe_Map gtRecipeMap, Map<GT_Recipe, Pair<Integer, Integer>> mapGtRecipeCounts) { + mapGtRecipeCounts.forEach( + (recipe, counts) -> StaticRecipeChangeLoaders.rewriteForCorrectCircuit(gtRecipeMap, recipe, counts)); gtRecipeMap.mRecipeList.clear(); gtRecipeMap.mRecipeList.addAll(mapGtRecipeCounts.keySet()); @@ -612,30 +752,21 @@ public class StaticRecipeChangeLoaders { } } - private static Map<GT_Recipe.GT_Recipe_Map, Map<GT_Recipe, Pair<Integer, Integer>>> getRecipesByCircuitID(GT_Recipe.GT_Recipe_Map[] ref) { + private static Map<GT_Recipe.GT_Recipe_Map, Map<GT_Recipe, Pair<Integer, Integer>>> getRecipesByCircuitID( + GT_Recipe.GT_Recipe_Map[] ref) { return Arrays.stream(ref) - .collect(Collectors - .toMap(k -> k, k -> - getArrayListMultiMapFromRecipeList( - gatherNoCircuitRecipes( - new HashSet<>(k.mRecipeList) - ) - ) - ) - ); - } - - private static GT_Recipe rewriteForCorrectCircuit(GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair<Integer, Integer> counts) { + .collect(Collectors.toMap( + k -> k, + k -> getArrayListMultiMapFromRecipeList(gatherNoCircuitRecipes(new HashSet<>(k.mRecipeList))))); + } + + private static GT_Recipe rewriteForCorrectCircuit( + GT_Recipe.GT_Recipe_Map gt_recipe_map, GT_Recipe recipe, Pair<Integer, Integer> counts) { ItemStack[] old = BW_Util.copyAndRemoveNulls(recipe.mInputs, ItemStack.class); ItemStack[] nu = Arrays.copyOf(old, old.length + 1); - nu[old.length] = GT_Utility.getIntegratedCircuit( //Max 24, Min 1 - Math.min( - Math.max( - getLogicFuntion(gt_recipe_map, recipe, counts), - 1), - 24) - ); + nu[old.length] = GT_Utility.getIntegratedCircuit( // Max 24, Min 1 + Math.min(Math.max(getLogicFuntion(gt_recipe_map, recipe, counts), 1), 24)); recipe.mInputs = nu; return recipe; @@ -650,7 +781,8 @@ public class StaticRecipeChangeLoaders { newColl = new HashSet<>(); } - recipeloop: for (GT_Recipe r : mRecipeList) { + recipeloop: + for (GT_Recipe r : mRecipeList) { for (int i = 0; i < r.mInputs.length; i++) if (GT_Utility.areStacksEqual(GT_Utility.getIntegratedCircuit(Short.MAX_VALUE), r.mInputs[i])) { continue recipeloop; @@ -661,16 +793,17 @@ public class StaticRecipeChangeLoaders { return newColl; } - private static Map<GT_Recipe, Pair<Integer, Integer>> getArrayListMultiMapFromRecipeList(Collection<GT_Recipe> mRecipeList) { - return mRecipeList.stream().collect(Collectors.toMap(recipe -> recipe, recipe -> - new Pair<>( - (int) Arrays.stream(recipe.mInputs) - .filter(Objects::nonNull) - .count(), - (int) Arrays.stream(recipe.mFluidInputs) - .filter(Objects::nonNull) - .count() - ) - )); + private static Map<GT_Recipe, Pair<Integer, Integer>> getArrayListMultiMapFromRecipeList( + Collection<GT_Recipe> mRecipeList) { + return mRecipeList.stream() + .collect(Collectors.toMap( + recipe -> recipe, + recipe -> new Pair<>( + (int) Arrays.stream(recipe.mInputs) + .filter(Objects::nonNull) + .count(), + (int) Arrays.stream(recipe.mFluidInputs) + .filter(Objects::nonNull) + .count()))); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index ca291e64bc..4ae8c10992 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -38,15 +38,14 @@ import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.MessageToMessageCodec; +import java.util.EnumMap; +import java.util.List; +import javax.annotation.Nonnull; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import javax.annotation.Nonnull; -import java.util.EnumMap; -import java.util.List; - /* * Original GT File slightly Modified */ @@ -59,40 +58,66 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> public BW_Network() { this.mChannel = NetworkRegistry.INSTANCE.newChannel("BartWorks", this, new BW_Network.HandlerShared()); - this.mSubChannels = new GT_Packet[]{new RendererPacket(), new CircuitProgrammerPacket(), new MetaBlockPacket(), new OreDictCachePacket(), new ServerJoinedPackage()}; + this.mSubChannels = new GT_Packet[] { + new RendererPacket(), + new CircuitProgrammerPacket(), + new MetaBlockPacket(), + new OreDictCachePacket(), + new ServerJoinedPackage() + }; } protected void encode(ChannelHandlerContext aContext, GT_Packet aPacket, List<Object> aOutput) throws Exception { - aOutput.add(new FMLProxyPacket(Unpooled.buffer().writeByte(aPacket.getPacketID()).writeBytes(aPacket.encode()).copy(), (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); + aOutput.add(new FMLProxyPacket( + Unpooled.buffer() + .writeByte(aPacket.getPacketID()) + .writeBytes(aPacket.encode()) + .copy(), + (String) aContext.channel().attr(NetworkRegistry.FML_CHANNEL).get())); } - protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List<Object> aOutput) throws Exception { + protected void decode(ChannelHandlerContext aContext, FMLProxyPacket aPacket, List<Object> aOutput) + throws Exception { ByteArrayDataInput aData = ByteStreams.newDataInput(aPacket.payload().array()); aOutput.add(this.mSubChannels[aData.readByte()].decode(aData)); } public void sendToPlayer(@Nonnull GT_Packet aPacket, @Nonnull EntityPlayerMP aPlayer) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPlayer); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPlayer); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } public void sendToAllPlayersinWorld(@Nonnull GT_Packet aPacket, World world) { for (String name : FMLServerHandler.instance().getServer().getAllUsernames()) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(world.getPlayerEntityByName(name)); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.PLAYER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(world.getPlayerEntityByName(name)); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } } public void sendToAllAround(@Nonnull GT_Packet aPacket, NetworkRegistry.TargetPoint aPosition) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(aPosition); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)) + .attr(FMLOutboundHandler.FML_MESSAGETARGETARGS) + .set(aPosition); ((FMLEmbeddedChannel) this.mChannel.get(Side.SERVER)).writeAndFlush(aPacket); } public void sendToServer(@Nonnull GT_Packet aPacket) { - ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)) + .attr(FMLOutboundHandler.FML_MESSAGETARGET) + .set(FMLOutboundHandler.OutboundTarget.TOSERVER); ((FMLEmbeddedChannel) this.mChannel.get(Side.CLIENT)).writeAndFlush(aPacket); } @@ -106,7 +131,9 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ); - if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + if (tPlayer.getServerForPlayer() + .getPlayerManager() + .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { this.sendToPlayer(aPacket, tPlayer); } } @@ -115,8 +142,7 @@ public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> @Sharable static final class HandlerShared extends SimpleChannelInboundHandler<GT_Packet> { - HandlerShared() { - } + HandlerShared() {} protected void channelRead0(ChannelHandlerContext ctx, GT_Packet aPacket) throws Exception { EntityPlayer aPlayer = GT_Values.GT.getThePlayer(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 3b4571a4ca..11e0ed1352 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.common.net; import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; +import java.nio.ByteBuffer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -33,8 +34,6 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import java.nio.ByteBuffer; - public class CircuitProgrammerPacket extends GT_Packet { private int dimID, playerID; @@ -60,14 +59,22 @@ public class CircuitProgrammerPacket extends GT_Packet { @Override public byte[] encode() { - return ByteBuffer.allocate(9).putInt(0, this.dimID).putInt(4, this.playerID).put(8, (this.hasChip ? this.chipCfg : -1)).array(); + return ByteBuffer.allocate(9) + .putInt(0, this.dimID) + .putInt(4, this.playerID) + .put(8, (this.hasChip ? this.chipCfg : -1)) + .array(); } @Override public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { byte[] ret = new byte[9]; byteArrayDataInput.readFully(ret); - return new CircuitProgrammerPacket(ByteBuffer.wrap(ret).getInt(0), ByteBuffer.wrap(ret).getInt(4), ByteBuffer.wrap(ret).get(8) > -1, ByteBuffer.wrap(ret).get(8)); + return new CircuitProgrammerPacket( + ByteBuffer.wrap(ret).getInt(0), + ByteBuffer.wrap(ret).getInt(4), + ByteBuffer.wrap(ret).get(8) > -1, + ByteBuffer.wrap(ret).get(8)); } @Override @@ -80,10 +87,11 @@ public class CircuitProgrammerPacket extends GT_Packet { if (item instanceof Circuit_Programmer) { NBTTagCompound nbt = stack.getTagCompound(); nbt.setBoolean("HasChip", this.hasChip); - if (this.hasChip) - nbt.setByte("ChipConfig", this.chipCfg); + if (this.hasChip) nbt.setByte("ChipConfig", this.chipCfg); stack.setTagCompound(nbt); - ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.setInventorySlotContents(((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); + ((EntityPlayer) w.getEntityByID(this.playerID)) + .inventory.setInventorySlotContents( + ((EntityPlayer) w.getEntityByID(this.playerID)).inventory.currentItem, stack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java index 4fa7ab4327..047631d193 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/MetaBlockPacket.java @@ -27,12 +27,11 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Block import com.github.bartimaeusnek.bartworks.util.MurmurHash3; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; +import java.nio.ByteBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.nio.ByteBuffer; - public class MetaBlockPacket extends GT_Packet { int x; @@ -59,8 +58,23 @@ public class MetaBlockPacket extends GT_Packet { @Override public byte[] encode() { - int hash = MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31); - return ByteBuffer.allocate(16).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).putInt(hash).array(); + int hash = MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(12) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .array(), + 0, + 12, + 31); + return ByteBuffer.allocate(16) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .putInt(hash) + .array(); } @Override @@ -73,7 +87,17 @@ public class MetaBlockPacket extends GT_Packet { this.y = buff.getShort(); this.meta = buff.getShort(); MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta); - if (buff.getInt() != MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(12).putInt(this.x).putInt(this.z).putShort(this.y).putShort(this.meta).array(), 0, 12, 31)) { + if (buff.getInt() + != MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(12) + .putInt(this.x) + .putInt(this.z) + .putShort(this.y) + .putShort(this.meta) + .array(), + 0, + 12, + 31)) { MainMod.LOGGER.error("PACKET HASH DOES NOT MATCH!"); return null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 2831ee4ebe..14a974ea21 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -26,21 +26,19 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; import com.github.bartimaeusnek.bartworks.util.Pair; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import net.minecraft.world.IBlockAccess; - import java.nio.ByteBuffer; import java.util.HashSet; +import net.minecraft.world.IBlockAccess; public class OreDictCachePacket extends GT_Packet { - - private HashSet<Pair<Integer,Short>> hashSet = new HashSet<>(); + private HashSet<Pair<Integer, Short>> hashSet = new HashSet<>(); public OreDictCachePacket() { super(true); } - public OreDictCachePacket(HashSet<Pair<Integer,Short>> set) { + public OreDictCachePacket(HashSet<Pair<Integer, Short>> set) { super(false); this.hashSet = set; } @@ -53,9 +51,8 @@ public class OreDictCachePacket extends GT_Packet { @Override public byte[] encode() { int size = this.hashSet.size(); - ByteBuffer buff = ByteBuffer.allocate(4+size*4+size*2).putInt(size); - for(Pair<Integer,Short> p : this.hashSet) - buff.putInt(p.getKey()).putShort(p.getValue()); + ByteBuffer buff = ByteBuffer.allocate(4 + size * 4 + size * 2).putInt(size); + for (Pair<Integer, Short> p : this.hashSet) buff.putInt(p.getKey()).putShort(p.getValue()); return buff.array(); } @@ -63,7 +60,7 @@ public class OreDictCachePacket extends GT_Packet { public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { int size = byteArrayDataInput.readInt(); for (int i = 0; i < size; i++) { - this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); + this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(), byteArrayDataInput.readShort())); } return new OreDictCachePacket(this.hashSet); } @@ -73,4 +70,4 @@ public class OreDictCachePacket extends GT_Packet { OreDictHandler.getNonBWCache().clear(); OreDictHandler.getNonBWCache().addAll(this.hashSet); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 46a7c36cc9..5ff6ad1431 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -29,9 +29,8 @@ import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; import com.github.bartimaeusnek.bartworks.util.Coords; import com.google.common.io.ByteArrayDataInput; import gregtech.api.net.GT_Packet; -import net.minecraft.world.IBlockAccess; - import java.nio.ByteBuffer; +import net.minecraft.world.IBlockAccess; public class RendererPacket extends GT_Packet { @@ -41,7 +40,6 @@ public class RendererPacket extends GT_Packet { public RendererPacket() { super(true); - } public RendererPacket(Coords coords, int integer, boolean removal) { @@ -62,22 +60,39 @@ public class RendererPacket extends GT_Packet { byte r = (byte) (((this.integer >> 16) & 0xFF) + Byte.MIN_VALUE); byte g = (byte) (((this.integer >> 8) & 0xFF) + Byte.MIN_VALUE); byte b = (byte) (((this.integer) & 0xFF) + Byte.MIN_VALUE); - byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); - return ByteBuffer.allocate(19).putInt(0, this.coords.x).putShort(4, this.coords.y).putInt(6, this.coords.z).putInt(10, this.coords.wID).put(14, r).put(15, g).put(16, b).put(17, this.removal).put(18, checksum).array(); + byte checksum = (byte) (this.coords.x % 25 + + this.coords.y % 25 + + this.coords.z % 25 + + this.coords.wID % 25 + + this.integer % 25 + + this.removal); + return ByteBuffer.allocate(19) + .putInt(0, this.coords.x) + .putShort(4, this.coords.y) + .putInt(6, this.coords.z) + .putInt(10, this.coords.wID) + .put(14, r) + .put(15, g) + .put(16, b) + .put(17, this.removal) + .put(18, checksum) + .array(); } -// /** -// * only use in a debug enviroment, does not do anything on its own. -// * @param buffer -// */ -// public void decodetest (byte[] buffer){ -// this.coords=new Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); -// int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; -// this.integer= BW_Util.getColorFromRGBArray(rgb); -// this.removal=ByteBuffer.wrap(buffer).get(17); -// -// byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); -// } + // /** + // * only use in a debug enviroment, does not do anything on its own. + // * @param buffer + // */ + // public void decodetest (byte[] buffer){ + // this.coords=new + // Coords(ByteBuffer.wrap(buffer).getInt(0),ByteBuffer.wrap(buffer).getShort(4),ByteBuffer.wrap(buffer).getInt(6),ByteBuffer.wrap(buffer).getInt(10)); + // int[] rgb = {ByteBuffer.wrap(buffer).get(14)-Byte.MIN_VALUE, + // ByteBuffer.wrap(buffer).get(15)-Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16)-Byte.MIN_VALUE}; + // this.integer= BW_Util.getColorFromRGBArray(rgb); + // this.removal=ByteBuffer.wrap(buffer).get(17); + // + // byte checksum = (byte) (coords.x%25+coords.y%25+coords.z%25+coords.wID%25+integer%25+removal); + // } @Override public GT_Packet decode(ByteArrayDataInput dataInput) { @@ -85,12 +100,25 @@ public class RendererPacket extends GT_Packet { byte[] buffer = new byte[19]; dataInput.readFully(buffer); - this.coords = new Coords(ByteBuffer.wrap(buffer).getInt(0), ByteBuffer.wrap(buffer).getShort(4), ByteBuffer.wrap(buffer).getInt(6), ByteBuffer.wrap(buffer).getInt(10)); - int[] rgb = {ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE}; + this.coords = new Coords( + ByteBuffer.wrap(buffer).getInt(0), + ByteBuffer.wrap(buffer).getShort(4), + ByteBuffer.wrap(buffer).getInt(6), + ByteBuffer.wrap(buffer).getInt(10)); + int[] rgb = { + ByteBuffer.wrap(buffer).get(14) - Byte.MIN_VALUE, + ByteBuffer.wrap(buffer).get(15) - Byte.MIN_VALUE, + ByteBuffer.wrap(buffer).get(16) - Byte.MIN_VALUE + }; this.integer = BW_ColorUtil.getColorFromRGBArray(rgb); this.removal = ByteBuffer.wrap(buffer).get(17); - byte checksum = (byte) (this.coords.x % 25 + this.coords.y % 25 + this.coords.z % 25 + this.coords.wID % 25 + this.integer % 25 + this.removal); + byte checksum = (byte) (this.coords.x % 25 + + this.coords.y % 25 + + this.coords.z % 25 + + this.coords.wID % 25 + + this.integer % 25 + + this.removal); if (checksum != ByteBuffer.wrap(buffer).get(18)) { MainMod.LOGGER.error("BW Packet was corrupted or modified!"); @@ -103,10 +131,8 @@ public class RendererPacket extends GT_Packet { @Override public void process(IBlockAccess iBlockAccess) { if (SideReference.Side.Client) { - if (this.removal == 0) - GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); - else - GT_TileEntity_BioVat.staticColorMap.remove(this.coords); + if (this.removal == 0) GT_TileEntity_BioVat.staticColorMap.put(this.coords, this.integer); + else GT_TileEntity_BioVat.staticColorMap.remove(this.coords); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 4f3eaf160e..a63388ba25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -38,8 +38,10 @@ public class ServerJoinedPackage extends GT_Packet { public ServerJoinedPackage(Object obj) { super(false); - this.config =(byte) (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF ? 3 : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); - + this.config = (byte) + (ConfigHandler.classicMode && ConfigHandler.disableExtraGassesForEBF + ? 3 + : ConfigHandler.classicMode ? 2 : ConfigHandler.disableExtraGassesForEBF ? 1 : 0); } @Override @@ -49,7 +51,7 @@ public class ServerJoinedPackage extends GT_Packet { @Override public byte[] encode() { - return new byte[]{this.config}; + return new byte[] {this.config}; } @Override @@ -62,6 +64,6 @@ public class ServerJoinedPackage extends GT_Packet { public void process(IBlockAccess iBlockAccess) { boolean gas = (this.config & 1) != 0; boolean classic = (this.config & 0b10) != 0; - MainMod.runOnPlayerJoined(classic,gas); + MainMod.runOnPlayerJoined(classic, gas); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 816f43c20b..3d643349c0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -24,5 +24,4 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import net.minecraft.tileentity.TileEntity; -public class BWTileEntityDimIDBridge extends TileEntity { -}
\ No newline at end of file +public class BWTileEntityDimIDBridge extends TileEntity {} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index f655541555..a15b043a56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -45,5 +45,4 @@ public class BW_RotorBlock extends TileEntityWindKineticGenerator { public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin) { return new BW_GUIContainer_RotorBlock(new ContainerWindKineticGenerator(entityPlayer, this)); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 34f86668d7..625352aa82 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -22,22 +22,21 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +import static net.minecraftforge.common.util.ForgeDirection.*; + import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.util.Coords; +import java.util.Comparator; +import java.util.PriorityQueue; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.TileFluidHandler; -import java.util.Comparator; -import java.util.PriorityQueue; - -import static net.minecraftforge.common.util.ForgeDirection.*; - public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implements ITileAddsInformation { - private final static ForgeDirection[] allowed_directions = new ForgeDirection[]{DOWN, WEST, EAST, SOUTH, NORTH}; + private static final ForgeDirection[] allowed_directions = new ForgeDirection[] {DOWN, WEST, EAST, SOUTH, NORTH}; private PriorityQueue<Coords> breadthFirstQueue = new PriorityQueue<>(Comparator.comparingInt(x -> x.y)); private boolean wasInited = false; @@ -51,8 +50,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } public void initEntity() { - if (wasInited) - return; + if (wasInited) return; breadthFirstQueue.add(new Coords(this.xCoord, this.yCoord, this.zCoord)); wasInited = true; } @@ -61,8 +59,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem public void updateEntity() { initEntity(); Coords current = breadthFirstQueue.poll(); - if (current == null) - return; + if (current == null) return; setFluidBlock(current); for (ForgeDirection allowed_direction : allowed_directions) { addBlockToQueue(current, allowed_direction); @@ -103,18 +100,15 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem } private void setFluidBlock(Coords current) { - if (!checkForAir(current)) - return; - if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) - return; + if (!checkForAir(current)) return; + if (this.tank.drain(1000, false) == null || this.tank.drain(1000, false).amount != 1000) return; FluidStack stack = this.tank.drain(1000, true); worldObj.setBlock(current.x, current.y, current.z, stack.getFluid().getBlock(), 0, 2); } private void addBlockToQueue(Coords current, ForgeDirection allowed_direction) { Coords side = current.getCoordsFromSide(allowed_direction); - if (checkForAir(side)) - breadthFirstQueue.add(side); + if (checkForAir(side)) breadthFirstQueue.add(side); } private boolean checkForAir(Coords coords) { @@ -123,6 +117,6 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem @Override public String[] getInfoData() { - return new String[]{"Experimental Machine to fill Holes with Fluids"}; + return new String[] {"Experimental Machine to fill Holes with Fluids"}; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index d96c3496d4..ec740107da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -30,6 +30,8 @@ import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Pollution; +import java.util.Arrays; +import java.util.Optional; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -41,10 +43,13 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -import java.util.Arrays; -import java.util.Optional; - -public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides { +public class BW_TileEntity_HeatedWaterPump extends TileEntity + implements ITileDropsContent, + IFluidHandler, + IFluidTank, + ITileWithGUI, + ITileAddsInformation, + ITileHasDifferentTextureSides { public static final int FUELSLOT = 0; public static final Fluid WATER = FluidRegistry.WATER; @@ -82,22 +87,19 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr super.readFromNBT(p_145839_1_); } - private boolean checkPreUpdate() { return this.worldObj.isRemote || ((this.fuelstack == null || this.fuelstack.stackSize <= 0) && this.fuel <= 0); } private void fixUnderlflow() { - if (this.fuel < 0) - this.fuel = 0; + if (this.fuel < 0) this.fuel = 0; } private void handleRefuel() { if (this.fuelstack != null && this.fuel == 0) { this.fuel = this.maxfuel = TileEntityFurnace.getItemBurnTime(this.fuelstack); --this.fuelstack.stackSize; - if (this.fuelstack.stackSize <= 0) - this.fuelstack = null; + if (this.fuelstack.stackSize <= 0) this.fuelstack = null; } } @@ -116,8 +118,7 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void updateEntity() { pushWaterToAdjacentTiles(); - if (checkPreUpdate()) - return; + if (checkPreUpdate()) return; fixUnderlflow(); handleRefuel(); @@ -126,50 +127,44 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } private void pushWaterToAdjacentTiles() { - Arrays.stream(ForgeDirection.values(), 0, 6) //All but Unknown - .forEach( - direction -> Optional.ofNullable( - this.worldObj.getTileEntity( - this.xCoord + direction.offsetX, - this.yCoord + direction.offsetY, - this.zCoord + direction.offsetZ) - ).ifPresent( - te -> { - if (te instanceof IFluidHandler) { - IFluidHandler tank = (IFluidHandler) te; - if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { - int drainage; - if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 0) { - tank.fill(direction.getOpposite(), this.outputstack, true); - this.drain(drainage, true); - } - } - } else if (te instanceof IFluidTank) { - IFluidTank tank = (IFluidTank) te; - int drainage; - if ((drainage = tank.fill(this.outputstack, false)) > 0) { - tank.fill(this.outputstack, true); - this.drain(drainage, true); - } + Arrays.stream(ForgeDirection.values(), 0, 6) // All but Unknown + .forEach(direction -> Optional.ofNullable(this.worldObj.getTileEntity( + this.xCoord + direction.offsetX, + this.yCoord + direction.offsetY, + this.zCoord + direction.offsetZ)) + .ifPresent(te -> { + if (te instanceof IFluidHandler) { + IFluidHandler tank = (IFluidHandler) te; + if (tank.canFill(direction.getOpposite(), this.outputstack.getFluid())) { + int drainage; + if ((drainage = tank.fill(direction.getOpposite(), this.outputstack, false)) > 0) { + tank.fill(direction.getOpposite(), this.outputstack, true); + this.drain(drainage, true); } } - )); + } else if (te instanceof IFluidTank) { + IFluidTank tank = (IFluidTank) te; + int drainage; + if ((drainage = tank.fill(this.outputstack, false)) > 0) { + tank.fill(this.outputstack, true); + this.drain(drainage, true); + } + } + })); } private void causePollution() { Optional.ofNullable(this.worldObj).ifPresent(e -> { - if (e.getTotalWorldTime() % 20 == 0) { - Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)).ifPresent(c -> - GT_Pollution.addPollution(c, ConfigHandler.pollutionHeatedWaterPumpSecond) - ); - } - } - ); + if (e.getTotalWorldTime() % 20 == 0) { + Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)) + .ifPresent(c -> GT_Pollution.addPollution(c, ConfigHandler.pollutionHeatedWaterPumpSecond)); + } + }); } @Override public int[] getAccessibleSlotsFromSide(int side) { - return new int[]{0}; + return new int[] {0}; } @Override @@ -189,16 +184,15 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ == 0) - return this.fuelstack; - else - return this.fakestack; + if (p_70301_1_ == 0) return this.fuelstack; + else return this.fakestack; } @Override public ItemStack decrStackSize(int slot, int ammount) { - if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT || this.fuelstack == null || ammount > this.fuelstack.stackSize) - return null; + if (slot != BW_TileEntity_HeatedWaterPump.FUELSLOT + || this.fuelstack == null + || ammount > this.fuelstack.stackSize) return null; return this.fuelstack.splitStack(ammount); } @@ -210,10 +204,8 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public void setInventorySlotContents(int slot, ItemStack p_70299_2_) { - if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) - this.fuelstack = p_70299_2_; - else - this.fakestack = p_70299_2_; + if (slot == BW_TileEntity_HeatedWaterPump.FUELSLOT) this.fuelstack = p_70299_2_; + else this.fakestack = p_70299_2_; } @Override @@ -237,17 +229,15 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr } @Override - public void openInventory() { - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; + return TileEntityFurnace.getItemBurnTime(p_94041_2_) > 0 + && p_94041_1_ == BW_TileEntity_HeatedWaterPump.FUELSLOT; } @Override @@ -278,14 +268,13 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(int maxDrain, boolean doDrain) { int actualdrain = maxDrain; - if (actualdrain > this.outputstack.amount) - actualdrain = this.outputstack.amount; + if (actualdrain > this.outputstack.amount) actualdrain = this.outputstack.amount; FluidStack ret = new FluidStack(BW_TileEntity_HeatedWaterPump.WATER, actualdrain); - if (ret.amount == 0) - ret = null; + if (ret.amount == 0) ret = null; if (doDrain) { this.outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent( + this.outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); } return ret; } @@ -302,8 +291,9 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if (resource != null && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER && this.drain(resource.amount, false) != null) - return this.drain(resource.amount, doDrain); + if (resource != null + && resource.getFluid() == BW_TileEntity_HeatedWaterPump.WATER + && this.drain(resource.amount, false) != null) return this.drain(resource.amount, doDrain); return null; } @@ -324,27 +314,30 @@ public class BW_TileEntity_HeatedWaterPump extends TileEntity implements ITileDr @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - return new FluidTankInfo[]{this.getInfo()}; + return new FluidTankInfo[] {this.getInfo()}; } @Override public String[] getInfoData() { - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + - GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + - String.format( - StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), - ConfigHandler.pollutionHeatedWaterPumpSecond - ), - StatCollector.translateToLocal("tooltip.tile.waterpump.2.name")}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.waterpump.0.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.mbWaterperSec) + + String.format( + StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), + ConfigHandler.pollutionHeatedWaterPumpSecond), + StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") + }; } @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); - ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); + ITileHasDifferentTextureSides.texture[ForgeDirection.UP.ordinal()] = + par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpTop"); + ITileHasDifferentTextureSides.texture[ForgeDirection.DOWN.ordinal()] = + par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpDown"); for (int i = 2; i < 7; i++) { - ITileHasDifferentTextureSides.texture[i] = par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); + ITileHasDifferentTextureSides.texture[i] = + par1IconRegister.registerIcon(MainMod.MOD_ID + ":heatedWaterPumpSide"); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index 9efc0c4cfb..7f25dd52c2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -24,14 +24,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.classic; import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; -import java.util.ArrayList; - public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { final ArrayList<FluidStack> INTERNALTANKS = new ArrayList<>(); @@ -60,7 +59,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - boolean ret = false; + boolean ret = false; for (FluidStack stack : this.INTERNALTANKS) { ret = GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0)); if (ret) { @@ -79,8 +78,7 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public FluidStack getFluid() { if (this.INTERNALTANKS.get(this.selectedTank) == null || this.INTERNALTANKS.get(this.selectedTank).amount == 0) - if (this.selectedTank > 0) - this.selectedTank = this.INTERNALTANKS.size() - 1; + if (this.selectedTank > 0) this.selectedTank = this.INTERNALTANKS.size() - 1; return this.INTERNALTANKS.get(this.selectedTank); } @@ -107,7 +105,6 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank p_145841_1_.setTag("InternalTank", lInternalTank); } - @Override public int getCapacity() { return Integer.MAX_VALUE; @@ -120,11 +117,9 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public int fill(FluidStack resource, boolean doFill) { - if (this.worldObj.isRemote || resource == null || resource.amount == 0) - return 0; + if (this.worldObj.isRemote || resource == null || resource.amount == 0) return 0; - if (!doFill) - return resource.amount; + if (!doFill) return resource.amount; int id = 0; @@ -146,18 +141,16 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank public FluidStack drain(int maxDrain, boolean doDrain) { FluidStack outputstack = this.INTERNALTANKS.get(this.selectedTank); - if (this.worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) - return null; + if (this.worldObj.isRemote || maxDrain == 0 || this.getFluid() == null || outputstack == null) return null; int actualdrain = maxDrain; - if (actualdrain > outputstack.amount) - actualdrain = outputstack.amount; + if (actualdrain > outputstack.amount) actualdrain = outputstack.amount; FluidStack ret = new FluidStack(outputstack.getFluid(), actualdrain); - if (ret.amount == 0) - ret = null; + if (ret.amount == 0) ret = null; if (doDrain) { outputstack.amount -= actualdrain; - FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent( + outputstack, this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, this, actualdrain)); } return ret; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java index 49cb2f30eb..141cc4760c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_LESU_Redux.java @@ -1,4 +1,4 @@ -///* +/// * // * Copyright (c) 2019 bartimaeusnek // * // * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -20,37 +20,38 @@ // * SOFTWARE. // */ // -//package com.github.bartimaeusnek.bartworks.common.tileentities.classic; -// -//import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; -//import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; -//import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; -//import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; -//import com.github.bartimaeusnek.bartworks.MainMod; -//import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -//import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; -//import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; -//import cpw.mods.fml.common.FMLCommonHandler; -//import cpw.mods.fml.relauncher.Side; -//import gregtech.api.interfaces.tileentity.IEnergyConnected; -//import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -//import gregtech.api.objects.XSTR; -//import net.minecraft.block.Block; -//import net.minecraft.client.renderer.texture.IIconRegister; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.inventory.IInventory; -//import net.minecraft.item.ItemStack; -//import net.minecraft.tileentity.TileEntity; -//import net.minecraft.util.StatCollector; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import net.minecraftforge.fluids.IFluidHandler; -// -//import java.nio.ByteBuffer; -//import java.util.ArrayList; -// -// -//public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, ITileAddsInformation, ITileWithGUI, ITileDropsContent, IEnergyConnected { +// package com.github.bartimaeusnek.bartworks.common.tileentities.classic; +// +// import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; +// import com.github.bartimaeusnek.bartworks.API.ITileDropsContent; +// import com.github.bartimaeusnek.bartworks.API.ITileHasDifferentTextureSides; +// import com.github.bartimaeusnek.bartworks.API.ITileWithGUI; +// import com.github.bartimaeusnek.bartworks.MainMod; +// import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +// import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; +// import com.github.bartimaeusnek.bartworks.util.ConnectedBlocksChecker; +// import cpw.mods.fml.common.FMLCommonHandler; +// import cpw.mods.fml.relauncher.Side; +// import gregtech.api.interfaces.tileentity.IEnergyConnected; +// import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +// import gregtech.api.objects.XSTR; +// import net.minecraft.block.Block; +// import net.minecraft.client.renderer.texture.IIconRegister; +// import net.minecraft.entity.player.EntityPlayer; +// import net.minecraft.inventory.IInventory; +// import net.minecraft.item.ItemStack; +// import net.minecraft.tileentity.TileEntity; +// import net.minecraft.util.StatCollector; +// import net.minecraft.world.World; +// import net.minecraft.world.biome.BiomeGenBase; +// import net.minecraftforge.fluids.IFluidHandler; +// +// import java.nio.ByteBuffer; +// import java.util.ArrayList; +// +// +// public class BW_TileEntity_LESU_Redux extends TileEntity implements ITileHasDifferentTextureSides, +// ITileAddsInformation, ITileWithGUI, ITileDropsContent, IEnergyConnected { // // public ConnectedBlocksChecker connectedcells; // public ItemStack[] circuits = new ItemStack[5]; @@ -490,4 +491,4 @@ // public int[] getDropSlots() { // return new int[0]; // } -//} +// } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index f252afa132..4fdf9bb667 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -32,13 +32,20 @@ public class CreativeScanner extends GT_MetaTileEntity_Scanner { super(aID, aName, aNameRegional, aTier); } - public CreativeScanner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public CreativeScanner( + String aName, + int aTier, + String[] aDescription, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { super(aName, aTier, aDescription, aTextures, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new CreativeScanner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); + return new CreativeScanner( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 394eecf9e7..cbfd68b39b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -22,6 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -45,6 +52,11 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -58,19 +70,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTiered; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_BioVat> { public static final HashMap<Coords, Integer> staticColorMap = new HashMap<>(); @@ -102,27 +101,34 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_BioVat> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_BioVat>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, - {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, - {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, - {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, - })) - .addElement('c', ofChain( - ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), - onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)) - )) - .addElement('a', ofChain( - isAir(), - ofBlockAnyMeta(FluidLoader.bioFluidBlock) - )) - .addElement('g', ofGlassTiered((byte)1, (byte)127, (byte)0, (te, v) -> te.mGlassTier = v, te -> te.mGlassTier, 1)) - .build(); + private static final IStructureDefinition<GT_TileEntity_BioVat> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_BioVat>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"ggggg", "gaaag", "gaaag", "gaaag", "ggggg"}, + {"cc~cc", "ccccc", "ccccc", "ccccc", "ccccc"}, + })) + .addElement( + 'c', + ofChain( + ofHatchAdder(GT_TileEntity_BioVat::addMaintenanceToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addOutputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addRadiationInputToMachineList, CASING_INDEX, 1), + ofHatchAdder(GT_TileEntity_BioVat::addEnergyInputToMachineList, CASING_INDEX, 1), + onElementPass(e -> e.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('a', ofChain(isAir(), ofBlockAnyMeta(FluidLoader.bioFluidBlock))) + .addElement( + 'g', + ofGlassTiered( + (byte) 1, + (byte) 127, + (byte) 0, + (te, v) -> te.mGlassTier = v, + te -> te.mGlassTier, + 1)) + .build(); @Override public IStructureDefinition<GT_TileEntity_BioVat> getStructureDefinition() { @@ -137,25 +143,24 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Bacterial Vat"). - addInfo("Controller block for the Bacterial Vat"). - addInfo("For maximum efficiency boost keep the Output Hatch always half filled!"). - addSeparator(). - beginStructureBlock(5, 4, 5, false). - addController("Front bottom center"). - addCasingInfo("Clean Stainless Steel Casings", 19). - addOtherStructurePart("Glass", "Hollow two middle layers", 2). - addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass"). - addStructureInfo("Some Recipes need more advanced Glass Types"). - addMaintenanceHatch("Any casing", 1). - addOtherStructurePart("Radio Hatch", "Any casing", 1). - addInputBus("Any casing", 1). - addOutputBus("Any casing", 1). - addInputHatch("Any casing", 1). - addOutputHatch("Any casing", 1). - addEnergyHatch("Any casing", 1). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Bacterial Vat") + .addInfo("Controller block for the Bacterial Vat") + .addInfo("For maximum efficiency boost keep the Output Hatch always half filled!") + .addSeparator() + .beginStructureBlock(5, 4, 5, false) + .addController("Front bottom center") + .addCasingInfo("Clean Stainless Steel Casings", 19) + .addOtherStructurePart("Glass", "Hollow two middle layers", 2) + .addStructureInfo("The glass can be any glass, i.e. Tinkers Construct Clear Glass") + .addStructureInfo("Some Recipes need more advanced Glass Types") + .addMaintenanceHatch("Any casing", 1) + .addOtherStructurePart("Radio Hatch", "Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -163,7 +168,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int[] ret = new int[4]; ret[0] = aSpecialValue & 0xF; // = glass tier ret[1] = aSpecialValue >>> 4 & 0b11; // = special value - ret[2] = aSpecialValue >>> 6 & 0b1; //boolean exact svt | 1 = true | 0 = false + ret[2] = aSpecialValue >>> 6 & 0b1; // boolean exact svt | 1 = true | 0 = false ret[3] = aSpecialValue >>> 7 & Integer.MAX_VALUE; // = sievert return ret; } @@ -177,18 +182,22 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int getInputCapacity() { - return this.mInputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity).sum(); + return this.mInputHatches.stream() + .mapToInt(GT_MetaTileEntity_Hatch_Input::getCapacity) + .sum(); } private int getOutputCapacity() { - return this.mOutputHatches.stream().mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity).sum(); + return this.mOutputHatches.stream() + .mapToInt(GT_MetaTileEntity_Hatch_Output::getCapacity) + .sum(); } @Override public int getCapacity() { int ret = 0; ret += this.getInputCapacity(); - //ret += getOutputCapacity(); + // ret += getOutputCapacity(); return ret; } @@ -223,14 +232,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } private int calcMod(double x) { - double y = (((double) this.getOutputCapacity()) / 2D), - z = ConfigHandler.bioVatMaxParallelBonus; + double y = (((double) this.getOutputCapacity()) / 2D), z = ConfigHandler.bioVatMaxParallelBonus; int ret = MathUtils.ceilInt(((-1D / y * Math.pow((x - y), 2D) + y) / y * z)); return MathUtils.clamp(1, ret, ConfigHandler.bioVatMaxParallelBonus); } - private List<ItemStack> getItemInputs(){ + private List<ItemStack> getItemInputs() { ArrayList<ItemStack> tInputList = this.getStoredInputs(); int tInputList_sS = tInputList.size(); for (int i = 0; i < tInputList_sS - 1; i++) { @@ -250,7 +258,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa return tInputList; } - private List<FluidStack> getFluidInputs(){ + private List<FluidStack> getFluidInputs() { ArrayList<FluidStack> tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); for (int i = 0; i < tFluidList_sS - 1; i++) { @@ -285,7 +293,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = V[tTier]; - GT_Recipe gtRecipe = gtRecipeMap.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, tEnergy, tFluids, itemStack, tInputs); + GT_Recipe gtRecipe = gtRecipeMap.findRecipe( + this.getBaseMetaTileEntity(), this.mLastRecipe, false, tEnergy, tFluids, itemStack, tInputs); if (gtRecipe == null) return false; @@ -298,10 +307,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mNeededSievert = conditions[3]; - if (conditions[2] == 0 ? - (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) - : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) - return false; + if (conditions[2] == 0 + ? (this.mSievert < this.mNeededSievert || this.mGlassTier < conditions[0]) + : (this.mSievert != conditions[3] || this.mGlassTier < conditions[0])) return false; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; @@ -320,16 +328,15 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } } - this.mOutputFluids = new FluidStack[]{new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; + this.mOutputFluids = + new FluidStack[] {new FluidStack(recipeFluidOutput, recipeFluidOutput.amount * this.mTimes)}; BW_Util.calculateOverclockedNessMulti(gtRecipe.mEUt, gtRecipe.mDuration, 1, tEnergy, this); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; + if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mProgresstime = 0; - if (gtRecipe.mCanBeBuffered) - this.mLastRecipe = gtRecipe; + if (gtRecipe.mCanBeBuffered) this.mLastRecipe = gtRecipe; this.updateSlots(); return true; @@ -363,15 +370,14 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mGlassTier = 0; this.mCasing = 0; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 3, 0)) return false; - return this.mCasing >= 19 && - this.mRadHatches.size() <= 1 && - this.mOutputHatches.size() == 1 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mEnergyHatches.size() > 0; + return this.mCasing >= 19 + && this.mRadHatches.size() <= 1 + && this.mOutputHatches.size() == 1 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mEnergyHatches.size() > 0; } @Override @@ -394,8 +400,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mFluid != null && height > 1 && this.reCalculateFluidAmmount() > 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < height; y++) - for (int z = -1; z < 2; z++) - this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); + for (int z = -1; z < 2; z++) this.sendPackagesOrRenewRenderer(x, y, z, this.mCulture); } } @@ -403,8 +408,18 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; - GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); - GT_TileEntity_BioVat.staticColorMap.put(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); + GT_TileEntity_BioVat.staticColorMap.remove(new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId)); + GT_TileEntity_BioVat.staticColorMap.put( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), + lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB()); if (SideReference.Side.Server) { MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( @@ -414,14 +429,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), - true - ), + true), this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); + this.getBaseMetaTileEntity().getZCoord()); MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), new RendererPacket( @@ -429,14 +441,11 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), lCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : lCulture.getColorRGB(), - false - ), + false), this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); + this.getBaseMetaTileEntity().getZCoord()); } this.needsVisualUpdate = true; } @@ -450,8 +459,12 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa break; } EntityPlayerMP tPlayer = (EntityPlayerMP) tObject; - Chunk tChunk = aWorld.getChunkFromBlockCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord()); - if (tPlayer.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { + Chunk tChunk = aWorld.getChunkFromBlockCoords( + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord()); + if (tPlayer.getServerForPlayer() + .getPlayerManager() + .isPlayerWatchingChunk(tPlayer, tChunk.xPosition, tChunk.zPosition)) { if (!this.playerMPHashSet.contains(tPlayer)) { this.playerMPHashSet.add(tPlayer); this.sendAllRequiredRendererPackets(); @@ -459,7 +472,6 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } else { this.playerMPHashSet.remove(tPlayer); } - } } } @@ -472,19 +484,41 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int x = -1; x < 2; x++) { for (int y = 0; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(Blocks.air)) - this.getBaseMetaTileEntity().getWorld().setBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord(), FluidLoader.bioFluidBlock); + if (this.getBaseMetaTileEntity() + .getWorld() + .getBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()) + .equals(Blocks.air)) + this.getBaseMetaTileEntity() + .getWorld() + .setBlock( + xDir + + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + + z + + this.getBaseMetaTileEntity() + .getZCoord(), + FluidLoader.bioFluidBlock); } } } } private int reCalculateFluidAmmount() { - return this.getStoredFluids().stream().mapToInt(fluidStack -> fluidStack.amount).sum(); + return this.getStoredFluids().stream() + .mapToInt(fluidStack -> fluidStack.amount) + .sum(); } private int reCalculateHeight() { - return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) : 1); + return (this.reCalculateFluidAmmount() > ((this.getCapacity() / 4) - 1) + ? (this.reCalculateFluidAmmount() >= this.getCapacity() / 2 ? 3 : 2) + : 1); } public void doAllVisualThings() { @@ -492,29 +526,59 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa if (this.mMachine) { ItemStack aStack = this.mInventory[1]; BioCulture lCulture = null; - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX * 2; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ * 2; + int xDir = ForgeDirection.getOrientation( + this.getBaseMetaTileEntity().getBackFacing()) + .offsetX + * 2; + int zDir = ForgeDirection.getOrientation( + this.getBaseMetaTileEntity().getBackFacing()) + .offsetZ + * 2; if (this.getBaseMetaTileEntity().getTimer() % 200 == 0) { this.check_Chunk(); } - if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { + if (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 0) { for (int x = -1; x < 2; x++) for (int y = 1; y < 3; y++) for (int z = -1; z < 2; z++) - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); + this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir( + xDir + + x + + this.getBaseMetaTileEntity() + .getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + + z + + this.getBaseMetaTileEntity() + .getZCoord()); } this.height = this.reCalculateHeight(); if (this.mFluid != null && this.height > 1 && this.reCalculateFluidAmmount() > 0) { - if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) || (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1)) { + if ((!(BW_Util.areStacksEqualOrNull(aStack, this.mStack))) + || (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER + == 1)) { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (aStack == null || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { - if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { - lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); + if (aStack == null + || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { + if (this.mCulture == null + || aStack == null + || aStack.getTagCompound() == null + || this.mCulture.getID() + != aStack.getTagCompound() + .getInteger("ID")) { + lCulture = aStack == null || aStack.getTagCompound() == null + ? null + : BioCulture.getBioCulture(aStack.getTagCompound() + .getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); } } @@ -524,9 +588,9 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa this.mStack = aStack; this.mCulture = lCulture; } - if (this.needsVisualUpdate && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { - if (this.getBaseMetaTileEntity().isClientSide()) - new Throwable().printStackTrace(); + if (this.needsVisualUpdate + && this.getBaseMetaTileEntity().getTimer() % GT_TileEntity_BioVat.TIMERDIVIDER == 1) { + if (this.getBaseMetaTileEntity().isClientSide()) new Throwable().printStackTrace(); this.placeFluid(); this.needsVisualUpdate = false; } @@ -540,8 +604,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (this.height != this.reCalculateHeight()) - this.needsVisualUpdate = true; + if (this.height != this.reCalculateHeight()) this.needsVisualUpdate = true; this.doAllVisualThings(); if (this.getBaseMetaTileEntity().isServerSide() && this.mRadHatches.size() == 1) { this.mSievert = this.mRadHatches.get(0).getSievert(); @@ -561,13 +624,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa aNBT.setInteger("mFluidHeight", this.height); if (this.mCulture != null && !this.mCulture.getName().isEmpty()) aNBT.setString("mCulture", this.mCulture.getName()); - else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) && !aNBT.getString("mCulture").isEmpty()) { + else if ((this.mCulture == null || this.mCulture.getName().isEmpty()) + && !aNBT.getString("mCulture").isEmpty()) { aNBT.removeTag("mCulture"); } - if (this.mFluid != null) - aNBT.setString("mFluid", this.mFluid.getName()); - aNBT.setInteger("mSievert",this.mSievert); - aNBT.setInteger("mNeededSievert",this.mNeededSievert); + if (this.mFluid != null) aNBT.setString("mFluid", this.mFluid.getName()); + aNBT.setInteger("mSievert", this.mSievert); + aNBT.setInteger("mNeededSievert", this.mNeededSievert); super.saveNBTData(aNBT); } @@ -578,25 +641,46 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa for (int x = -1; x < 2; x++) { for (int y = 1; y < 3; y++) { for (int z = -1; z < 2; z++) { - if (this.getBaseMetaTileEntity().getWorld().getBlock(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()).equals(FluidLoader.bioFluidBlock)) - this.getBaseMetaTileEntity().getWorld().setBlockToAir(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()); - GT_TileEntity_BioVat.staticColorMap.remove(new Coords(xDir + x + this.getBaseMetaTileEntity().getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), zDir + z + this.getBaseMetaTileEntity().getZCoord()), this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + if (this.getBaseMetaTileEntity() + .getWorld() + .getBlock( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()) + .equals(FluidLoader.bioFluidBlock)) + this.getBaseMetaTileEntity() + .getWorld() + .setBlockToAir( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()); + GT_TileEntity_BioVat.staticColorMap.remove( + new Coords( + xDir + x + this.getBaseMetaTileEntity().getXCoord(), + y + this.getBaseMetaTileEntity().getYCoord(), + zDir + z + this.getBaseMetaTileEntity().getZCoord()), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); if (SideReference.Side.Server) MainMod.BW_Network_instance.sendPacketToAllPlayersInRange( this.getBaseMetaTileEntity().getWorld(), new RendererPacket( new Coords( - xDir + x + this.getBaseMetaTileEntity().getXCoord(), + xDir + + x + + this.getBaseMetaTileEntity() + .getXCoord(), y + this.getBaseMetaTileEntity().getYCoord(), - zDir + z + this.getBaseMetaTileEntity().getZCoord(), - this.getBaseMetaTileEntity().getWorld().provider.dimensionId - ), - this.mCulture == null ? BioCulture.NULLCULTURE.getColorRGB() : this.mCulture.getColorRGB(), - true - ), + zDir + + z + + this.getBaseMetaTileEntity() + .getZCoord(), + this.getBaseMetaTileEntity().getWorld().provider.dimensionId), + this.mCulture == null + ? BioCulture.NULLCULTURE.getColorRGB() + : this.mCulture.getColorRGB(), + true), this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord() - ); + this.getBaseMetaTileEntity().getZCoord()); } } } @@ -607,8 +691,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa public void loadNBTData(NBTTagCompound aNBT) { this.height = aNBT.getInteger("mFluidHeight"); this.mCulture = BioCulture.getBioCulture(aNBT.getString("mCulture")); - if (!aNBT.getString("mFluid").isEmpty()) - this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); + if (!aNBT.getString("mFluid").isEmpty()) this.mFluid = FluidRegistry.getFluid(aNBT.getString("mFluid")); this.mSievert = aNBT.getInteger("mSievert"); this.mNeededSievert = aNBT.getInteger("mNeededSievert"); super.loadNBTData(aNBT); @@ -625,19 +708,41 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override @@ -650,10 +755,13 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_EnhancedMultiBlockBa final String[] baseInfoData = super.getInfoData(); final String[] infoData = new String[baseInfoData.length + 2]; System.arraycopy(baseInfoData, 0, infoData, 0, baseInfoData.length); - infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + - EnumChatFormatting.GREEN + (mMaxProgresstime <= 0 ? getExpectedTimes(null, false) : mExpectedTimes) * 100 + EnumChatFormatting.RESET + " %"; - infoData[infoData.length - 1] = StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + - EnumChatFormatting.GREEN + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + EnumChatFormatting.RESET + " %"; + infoData[infoData.length - 2] = StatCollector.translateToLocal("BW.infoData.BioVat.expectedProduction") + ": " + + EnumChatFormatting.GREEN + + (mMaxProgresstime <= 0 ? getExpectedTimes(null, false) : mExpectedTimes) * 100 + + EnumChatFormatting.RESET + " %"; + infoData[infoData.length - 1] = + StatCollector.translateToLocal("BW.infoData.BioVat.production") + ": " + EnumChatFormatting.GREEN + + (mMaxProgresstime <= 0 ? 0 : mTimes) * 100 + EnumChatFormatting.RESET + " %"; return infoData; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 731599fed1..e3ab8def8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -22,6 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + 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.util.BWRecipes; @@ -45,90 +53,99 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.ofGlassTieredMixed; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_CircuitAssemblyLine> implements ISurvivalConstructable { +public class GT_TileEntity_CircuitAssemblyLine + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_CircuitAssemblyLine> + implements ISurvivalConstructable { private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_FIRST = "first"; private static final String STRUCTURE_PIECE_NEXT = "next"; - private static final IStructureDefinition<GT_TileEntity_CircuitAssemblyLine> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_CircuitAssemblyLine>builder() - .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { - {"~", "G", "G"}, - {"g", "l", "g"}, - {"b", "i", "b"}, - })) - .addShape(STRUCTURE_PIECE_NEXT, transpose(new String[][] { - {"G", "G", "G"}, - {"g", "l", "g"}, - {"b", "I", "b"}, - })) - .addElement('G', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(Energy).casingIndex(CASING_INDEX).dot(1).buildAndChain(GregTech_API.sBlockCasings3, 10)) - .addElement('g', ofGlassTieredMixed((byte)4, (byte)127, 5)) - .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) //assembling line casings - .addElement('b', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(InputHatch, Maintenance).casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0) - ) - .addElement('i', InputBus.newAny(CASING_INDEX, 3)) - .addElement('I', buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) - .atLeast(InputHatch, InputBus, OutputBus).casingIndex(CASING_INDEX).dot(2).buildAndChain(GregTech_API.sBlockCasings2, 0) - ) - .build(); + private static final IStructureDefinition<GT_TileEntity_CircuitAssemblyLine> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_CircuitAssemblyLine>builder() + .addShape(STRUCTURE_PIECE_FIRST, transpose(new String[][] { + {"~", "G", "G"}, + {"g", "l", "g"}, + {"b", "i", "b"}, + })) + .addShape(STRUCTURE_PIECE_NEXT, transpose(new String[][] { + {"G", "G", "G"}, + {"g", "l", "g"}, + {"b", "I", "b"}, + })) + .addElement( + 'G', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(Energy) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings3, 10)) + .addElement('g', ofGlassTieredMixed((byte) 4, (byte) 127, 5)) + .addElement('l', ofBlock(GregTech_API.sBlockCasings2, 5)) // assembling line casings + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(InputHatch, Maintenance) + .casingIndex(CASING_INDEX) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .addElement('i', InputBus.newAny(CASING_INDEX, 3)) + .addElement( + 'I', + buildHatchAdder(GT_TileEntity_CircuitAssemblyLine.class) + .atLeast(InputHatch, InputBus, OutputBus) + .casingIndex(CASING_INDEX) + .dot(2) + .buildAndChain(GregTech_API.sBlockCasings2, 0)) + .build(); @Override - public IStructureDefinition<GT_TileEntity_CircuitAssemblyLine> getStructureDefinition() { return STRUCTURE_DEFINITION; } + public IStructureDefinition<GT_TileEntity_CircuitAssemblyLine> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Circuit Assembler"). - addInfo("Controller block for the Circuit Assembly Line"). - addInfo("Imprint this machine with a Circuit Imprint,"). - addInfo("by putting the imprint in the controller"). - addInfo("Every Circuit Assembly Line can only be imprinted ONCE"). - addInfo("Does not lose efficiency when overclocked"). - addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). - addSeparator(). - beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false). - addStructureInfo("From Bottom to Top, Left to Right"). - addStructureInfo("Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing"). - addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass"). - addStructureInfo("Layer 3 - Grate Machine Casing"). - addStructureInfo("Up to 7 repeating slices, last is Output Bus"). - - addController("Layer 3 first slice front"). - addOtherStructurePart("1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), "Any layer 3 casing", 1). - addInputHatch("Any layer 1 casing", 2). - addInputBus("As specified on layer 1", 3, 4). - addOutputBus("As specified in final slice on layer 1", 4). - addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5). - addMaintenanceHatch("Any layer 1 casing", 2). - toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); + tt.addMachineType("Circuit Assembler") + .addInfo("Controller block for the Circuit Assembly Line") + .addInfo("Imprint this machine with a Circuit Imprint,") + .addInfo("by putting the imprint in the controller") + .addInfo("Every Circuit Assembly Line can only be imprinted ONCE") + .addInfo("Does not lose efficiency when overclocked") + .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) + .addSeparator() + .beginVariableStructureBlock(2, 7, 3, 3, 3, 3, false) + .addStructureInfo("From Bottom to Top, Left to Right") + .addStructureInfo( + "Layer 1 - Solid Steel Machine Casing, Input bus (Last Output bus), Solid Steel Machine Casing") + .addStructureInfo("Layer 2 - EV+ Tier Glass, Assembling Line Casing, EV+ Tier Glass") + .addStructureInfo("Layer 3 - Grate Machine Casing") + .addStructureInfo("Up to 7 repeating slices, last is Output Bus") + .addController("Layer 3 first slice front") + .addOtherStructurePart( + "1x " + StatCollector.translateToLocal("GT5U.MBTT.EnergyHatch"), "Any layer 3 casing", 1) + .addInputHatch("Any layer 1 casing", 2) + .addInputBus("As specified on layer 1", 3, 4) + .addOutputBus("As specified in final slice on layer 1", 4) + .addOtherStructurePart("EV+ Tier Glass", "As specified on layer 2", 5) + .addMaintenanceHatch("Any layer 1 casing", 2) + .toolTipFinisher(ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()); return tt; } public String getTypeForDisplay() { - if (this.type.equals(new NBTTagCompound())) - return ""; - return GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + if (this.type.equals(new NBTTagCompound())) return ""; + return GT_LanguageManager.getTranslation( + GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); } private NBTTagCompound type = new NBTTagCompound(); @@ -142,12 +159,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance super(aName); } - private boolean imprintMachine(ItemStack itemStack){ - if (!this.type.equals(new NBTTagCompound())) - return true; - if (!GT_Utility.isStackValid(itemStack)) - return false; - if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits && itemStack.getItemDamage() == 0 && itemStack.getTagCompound() != null && this.type.equals(new NBTTagCompound())){ + private boolean imprintMachine(ItemStack itemStack) { + if (!this.type.equals(new NBTTagCompound())) return true; + if (!GT_Utility.isStackValid(itemStack)) return false; + if (itemStack.getItem() instanceof BW_Meta_Items.BW_GT_MetaGenCircuits + && itemStack.getItemDamage() == 0 + && itemStack.getTagCompound() != null + && this.type.equals(new NBTTagCompound())) { this.type = itemStack.getTagCompound(); this.mInventory[1] = null; this.getBaseMetaTileEntity().issueBlockUpdate(); @@ -177,15 +195,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance @Override public void setItemNBT(NBTTagCompound aNBT) { - if (!this.type.equals(new NBTTagCompound())) - aNBT.setTag("Type", this.type); + if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); } @Override public void saveNBTData(NBTTagCompound aNBT) { - if (!this.type.equals(new NBTTagCompound())) - aNBT.setTag("Type", this.type); + if (!this.type.equals(new NBTTagCompound())) aNBT.setTag("Type", this.type); super.saveNBTData(aNBT); } @@ -193,19 +209,21 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance @Override public boolean checkRecipe(ItemStack itemStack) { - if (this.type.equals(new NBTTagCompound())) - if (!this.imprintMachine(itemStack)) - return false; - - if (this.bufferedRecipe != null && this.bufferedRecipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) { + if (this.type.equals(new NBTTagCompound())) if (!this.imprintMachine(itemStack)) return false; + + if (this.bufferedRecipe != null + && this.bufferedRecipe.isRecipeInputEqual( + true, + false, + BW_Util.getFluidsFromInputHatches(this), + getStoredInputs().toArray(new ItemStack[0]))) { setRecipeStats(); return true; } ItemStack stack = ItemStack.loadItemStackFromNBT(this.type); - if (stack == null) - return false; + if (stack == null) return false; if (this.GT_RECIPE_COLLECTION.isEmpty()) { for (GT_Recipe recipe : BWRecipes.instance.getMappingsFor((byte) 3).mRecipeList) { @@ -216,10 +234,12 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } for (GT_Recipe recipe : this.GT_RECIPE_COLLECTION) { - if (recipe.isRecipeInputEqual(true,false, BW_Util.getFluidsFromInputHatches(this), getStoredInputs().toArray(new ItemStack[0]))) - this.bufferedRecipe = recipe; - else - continue; + if (recipe.isRecipeInputEqual( + true, + false, + BW_Util.getFluidsFromInputHatches(this), + getStoredInputs().toArray(new ItemStack[0]))) this.bufferedRecipe = recipe; + else continue; this.setRecipeStats(); return true; @@ -228,9 +248,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } private void setRecipeStats() { - calculatePerfectOverclockedNessMulti(this.bufferedRecipe.mEUt, this.bufferedRecipe.mDuration, 1, this.getMaxInputVoltage()); - if (this.mEUt > 0) - this.mEUt = -this.mEUt; + calculatePerfectOverclockedNessMulti( + this.bufferedRecipe.mEUt, this.bufferedRecipe.mDuration, 1, this.getMaxInputVoltage()); + if (this.mEUt > 0) this.mEUt = -this.mEUt; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); @@ -264,13 +284,13 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); } else { return false; } @@ -286,9 +306,9 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - ((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input)aMetaTileEntity); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); + return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); } else { return false; } @@ -321,32 +341,56 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } private String[] infoDataBuffer; + @Override public String[] getInfoData() { - if (infoDataBuffer != null) - return infoDataBuffer; + if (infoDataBuffer != null) return infoDataBuffer; String[] oldInfo = super.getInfoData(); - infoDataBuffer = new String[oldInfo.length+1]; - System.arraycopy(oldInfo,0,infoDataBuffer,0, oldInfo.length); - infoDataBuffer[oldInfo.length] = "Imprinted with: "+ GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(this.type))); + infoDataBuffer = new String[oldInfo.length + 1]; + System.arraycopy(oldInfo, 0, infoDataBuffer, 0, oldInfo.length); + infoDataBuffer[oldInfo.length] = "Imprinted with: " + + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(this.type))); return infoDataBuffer; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ASSEMBLY_LINE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -358,7 +402,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance } private boolean checkMachine(boolean leftToRight) { - for(int i = 1; i < 7; ++i) { + for (int i = 1; i < 7; ++i) { if (!this.checkPiece(STRUCTURE_PIECE_NEXT, leftToRight ? -i : i, 0, 0)) { return false; } @@ -375,7 +419,7 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance this.buildPiece(STRUCTURE_PIECE_FIRST, stackSize, hintsOnly, 0, 0, 0); int tLength = Math.min(stackSize.stackSize + 1, 7); - for(int i = 1; i < tLength; ++i) { + for (int i = 1; i < tLength; ++i) { this.buildPiece(STRUCTURE_PIECE_NEXT, stackSize, hintsOnly, -i, 0, 0); } } @@ -384,12 +428,14 @@ public class GT_TileEntity_CircuitAssemblyLine extends GT_MetaTileEntity_Enhance public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; int built; - built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_FIRST, stackSize, 0, 0, 0, elementBudget, source, actor, false, true); if (built >= 0) return built; int tLength = Math.min(stackSize.stackSize + 1, 7); for (int i = 1; i < tLength; ++i) { - built = survivialBuildPiece(STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_NEXT, stackSize, -i, 0, 0, elementBudget, source, actor, false, true); if (built >= 0) return built; } return -1; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index c1c7cc0d29..268a26686d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -29,11 +29,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DistillationTower; +import java.util.ArrayList; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_DistillationTower { public GT_TileEntity_CrackingDistillTower(int aID, String aName, String aNameRegional) { @@ -46,8 +45,7 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil @Override public boolean checkRecipe(ItemStack itemStack) { - if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0), true)) - return false; + if (!GT_Utility.areStacksEqual(itemStack, GT_Utility.getIntegratedCircuit(0), true)) return false; else { FluidStack[] array = new FluidStack[0]; ArrayList<FluidStack> fluidInputs = new ArrayList<>(); @@ -59,25 +57,35 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil array = fluidInputs.toArray(array); GT_Recipe.GT_Recipe_Map rMapCracking = GT_Recipe.GT_Recipe_Map.sCrakingRecipes; GT_Recipe.GT_Recipe_Map rMapDistillTower = GT_Recipe.GT_Recipe_Map.sDistillationRecipes; - GT_Recipe recipeCracking = rMapCracking.findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); - if (recipeCracking == null) - return false; - GT_Recipe recipeDistill = rMapDistillTower.findRecipe(this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), recipeCracking.mFluidOutputs); - if (recipeDistill == null) - return false; + GT_Recipe recipeCracking = rMapCracking.findRecipe( + this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), array, itemStack); + if (recipeCracking == null) return false; + GT_Recipe recipeDistill = rMapDistillTower.findRecipe( + this.getBaseMetaTileEntity(), false, this.getMaxInputVoltage(), recipeCracking.mFluidOutputs); + if (recipeDistill == null) return false; float ratio = (float) recipeCracking.mFluidOutputs[0].amount / (float) recipeDistill.mFluidInputs[0].amount; FluidStack[] nuoutputs = new FluidStack[recipeDistill.mFluidOutputs.length]; for (int i = 0; i < nuoutputs.length; i++) { nuoutputs[i] = recipeDistill.mFluidOutputs[i]; nuoutputs[i].amount = MathUtils.floorInt(recipeDistill.mFluidOutputs[i].amount * ratio); } - BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe(true, null, recipeDistill.mOutputs, null, recipeDistill.mChances, recipeCracking.mFluidInputs, nuoutputs, (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), 0); + BWRecipes.DynamicGTRecipe combined = new BWRecipes.DynamicGTRecipe( + true, + null, + recipeDistill.mOutputs, + null, + recipeDistill.mChances, + recipeCracking.mFluidInputs, + nuoutputs, + (MathUtils.floorInt(recipeDistill.mDuration * ratio)) + recipeCracking.mDuration, + Math.max((MathUtils.floorInt(recipeDistill.mEUt * ratio)), recipeCracking.mEUt), + 0); if (combined.isRecipeInputEqual(true, array)) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - BW_Util.calculateOverclockedNessMulti(combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) - return false; + BW_Util.calculateOverclockedNessMulti( + combined.mEUt, combined.mDuration, 1, this.getMaxInputVoltage(), this); + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = (-this.mEUt); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index f472ec766e..d19bd42924 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static gregtech.api.enums.GT_Values.VN; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -36,6 +39,8 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric; +import java.lang.reflect.Field; +import java.util.Arrays; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -43,12 +48,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -import java.lang.reflect.Field; -import java.util.Arrays; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static gregtech.api.enums.GT_Values.VN; - public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private static float nulearHeatMod = 2f; private byte mMode; @@ -72,7 +71,12 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Field f = c.getDeclaredField("huOutputModifier"); f.setAccessible(true); GT_TileEntity_DEHP.nulearHeatMod = f.getFloat(f); - } catch (SecurityException | IllegalArgumentException | ExceptionInInitializerError | NullPointerException | IllegalAccessException | NoSuchFieldException e) { + } catch (SecurityException + | IllegalArgumentException + | ExceptionInInitializerError + | NullPointerException + | IllegalAccessException + | NoSuchFieldException e) { e.printStackTrace(); } super.onConfigLoad(aConfig); @@ -99,7 +103,8 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "DrillingRig.png"); } @Override @@ -112,13 +117,16 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (ConfigHandler.DEHPDirectSteam) { tt.addInfo("0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract") .addInfo("Explodes when it runs out of Water/Distilled Water") - .addInfo("Converts " + (long) (this.mTier * 1200 * 20) + "L/s Water(minus 10% per Maintenance Problem) to Steam") - .addInfo("Converts " + (long) (this.mTier * 600 * 20) + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); + .addInfo("Converts " + (long) (this.mTier * 1200 * 20) + + "L/s Water(minus 10% per Maintenance Problem) to Steam") + .addInfo("Converts " + (long) (this.mTier * 600 * 20) + + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); } else { tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") .addInfo("Explodes when it runs out of Coolant") - .addInfo("Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + "L/s Coolant(minus 10% per Maintenance Problem)"); + .addInfo("Heats up " + (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod)) * 20 + + "L/s Coolant(minus 10% per Maintenance Problem)"); } tt.addSeparator() .beginStructureBlock(3, 7, 3, false) @@ -163,8 +171,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private long getFluidFromHatches(Fluid f) { long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(f)) - ret += ih.getFluidAmount(); + if (ih.getFluid().getFluid().equals(f)) ret += ih.getFluidAmount(); } return ret; } @@ -172,18 +179,18 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { private long getWaterFromHatches(boolean onlyDistilled) { Fluid toConsume1 = FluidRegistry.WATER; Fluid toConsume2 = GT_ModHandler.getDistilledWater(1L).getFluid(); - if (onlyDistilled) - toConsume1 = toConsume2; + if (onlyDistilled) toConsume1 = toConsume2; long ret = 0; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (ih.getFluid().getFluid().equals(toConsume1) || ih.getFluid().getFluid().equals(toConsume2)) - ret += ih.getFluidAmount(); + if (ih.getFluid().getFluid().equals(toConsume1) + || ih.getFluid().getFluid().equals(toConsume2)) ret += ih.getFluidAmount(); } return ret; } @Override - protected boolean workingUpward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingUpward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (this.mMode != 3) { this.isPickingPipes = false; try { @@ -198,16 +205,15 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (this.getBaseMetaTileEntity().getWorld().isRemote) - return; + if (this.getBaseMetaTileEntity().getWorld().isRemote) return; ++this.mMode; - if (this.mMode >= 4) - this.mMode = 0; + if (this.mMode >= 4) this.mMode = 0; GT_Utility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } - protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + protected boolean workingDownward( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { if (this.mMode == 3) { this.isPickingPipes = true; try { @@ -222,8 +228,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { if (this.waitForPipes()) { return false; } else { - if (this.mMode == 0) - this.mMode = 1; + if (this.mMode == 0) this.mMode = 1; if (ConfigHandler.DEHPDirectSteam) { if (this.mMode == 1) { long steamProduced = (this.mTier * 600 * 2L * this.mEfficiency / 10000L); @@ -250,7 +255,11 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } } else { if (this.mMode == 1 || this.mMode == 2) { - long coolantConverted = (long) (this.mTier * 24 * ((double) GT_TileEntity_DEHP.nulearHeatMod) * this.mEfficiency / 10000L); + long coolantConverted = (long) (this.mTier + * 24 + * ((double) GT_TileEntity_DEHP.nulearHeatMod) + * this.mEfficiency + / 10000L); if (this.getFluidFromHatches(FluidRegistry.getFluid("ic2coolant")) - coolantConverted > 0) { this.consumeFluid(FluidRegistry.getFluid("ic2coolant"), coolantConverted); this.addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", (int) coolantConverted)); @@ -273,23 +282,29 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { Arrays.fill(tmp, (int) (ammount / Integer.MAX_VALUE)); for (int i = 0; i < tmp.length; i++) { for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) - tmp[i] -= ih.drain((int) ammount, true).amount; - if (tmp[i] <= 0) - break; + if (fluid.equals(FluidRegistry.WATER) + ? ih.getFluid().getFluid().equals(fluid) + || ih.getFluid() + .getFluid() + .equals(GT_ModHandler.getDistilledWater(1) + .getFluid()) + : ih.getFluid().getFluid().equals(fluid)) tmp[i] -= ih.drain((int) ammount, true).amount; + if (tmp[i] <= 0) break; } } return tmp[tmp.length - 1] <= 0; - } long tmp = ammount; for (GT_MetaTileEntity_Hatch_Input ih : this.mInputHatches) { - if (fluid.equals(FluidRegistry.WATER) ? ih.getFluid().getFluid().equals(fluid) || ih.getFluid().getFluid().equals(GT_ModHandler.getDistilledWater(1).getFluid()) : ih.getFluid().getFluid().equals(fluid)) - tmp -= ih.drain((int) ammount, true).amount; - if (tmp <= 0) - return true; + if (fluid.equals(FluidRegistry.WATER) + ? ih.getFluid().getFluid().equals(fluid) + || ih.getFluid() + .getFluid() + .equals(GT_ModHandler.getDistilledWater(1).getFluid()) + : ih.getFluid().getFluid().equals(fluid)) tmp -= ih.drain((int) ammount, true).amount; + if (tmp <= 0) return true; } return false; } 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 7eeb3767d2..2f937f1c2d 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 @@ -22,6 +22,13 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; @@ -40,22 +47,15 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ElectricImplosionCompressor> { +public class GT_TileEntity_ElectricImplosionCompressor + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ElectricImplosionCompressor> { public static GT_Recipe.GT_Recipe_Map eicMap; private static final boolean pistonEnabled = !ConfigHandler.disablePistonInEIC; @@ -73,61 +73,86 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity private static final int CASING_INDEX = 16; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_ElectricImplosionCompressor> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_ElectricImplosionCompressor>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccc", "cec", "ccc"}, - {"ttt", "tft", "ttt"}, - {"ttt", "tft", "ttt"}, - {"nnn", "nnn", "nnn"}, - {"nNn", "NNN", "nNn"}, - {"nnn", "nnn", "nnn"}, - {"t~t", "tft", "ttt"}, - {"ttt", "tft", "ttt"}, - {"CCC", "CeC", "CCC"}, - })) - .addElement('c', ofChain( - ofBlock(GregTech_API.sBlockCasings2, 0), - ofBlock(GregTech_API.sBlockCasings3, 4) - )) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)) - .addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) - .addElement('C', ofChain( - ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings2, 0), - ofBlock(GregTech_API.sBlockCasings3, 4) - )) - .addElement('e', ofHatchAdder(GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, CASING_INDEX, 2)) - .addElement('N', new IStructureElement<GT_TileEntity_ElectricImplosionCompressor>(){ - - @Override - public boolean check(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { - if(!te.piston && !world.isAirBlock(x, y, z)) - return false; - if(te.piston && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 && world.getBlockMetadata(x, y, z) == 2)) - return false; - return true; - } - - @Override - public boolean spawnHint(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - if(te.piston) - StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); - return true; - } - - @Override - public boolean placeBlock(GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z, ItemStack itemStack) { - if(te.piston) - world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); - else - world.setBlockToAir(x, y, z); - return true; - } - }) - .build(); + private static final IStructureDefinition<GT_TileEntity_ElectricImplosionCompressor> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_ElectricImplosionCompressor>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccc", "cec", "ccc"}, + {"ttt", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"nnn", "nnn", "nnn"}, + {"nNn", "NNN", "nNn"}, + {"nnn", "nnn", "nnn"}, + {"t~t", "tft", "ttt"}, + {"ttt", "tft", "ttt"}, + {"CCC", "CeC", "CCC"}, + })) + .addElement( + 'c', + ofChain(ofBlock(GregTech_API.sBlockCasings2, 0), ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('n', ofBlock(GregTech_API.sBlockMetal5, 2)) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addOutputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addMaintenanceToMachineList, + CASING_INDEX, + 1), + ofBlock(GregTech_API.sBlockCasings2, 0), + ofBlock(GregTech_API.sBlockCasings3, 4))) + .addElement( + 'e', + ofHatchAdder( + GT_TileEntity_ElectricImplosionCompressor::addEnergyInputToMachineList, + CASING_INDEX, + 2)) + .addElement('N', new IStructureElement<GT_TileEntity_ElectricImplosionCompressor>() { + + @Override + public boolean check( + GT_TileEntity_ElectricImplosionCompressor te, World world, int x, int y, int z) { + if (!te.piston && !world.isAirBlock(x, y, z)) return false; + if (te.piston + && !(world.getBlock(x, y, z) == GregTech_API.sBlockMetal5 + && world.getBlockMetadata(x, y, z) == 2)) return false; + return true; + } + + @Override + public boolean spawnHint( + GT_TileEntity_ElectricImplosionCompressor te, + World world, + int x, + int y, + int z, + ItemStack itemStack) { + if (te.piston) StructureLibAPI.hintParticle(world, x, y, z, GregTech_API.sBlockMetal5, 2); + return true; + } + + @Override + public boolean placeBlock( + GT_TileEntity_ElectricImplosionCompressor te, + World world, + int x, + int y, + int z, + ItemStack itemStack) { + if (te.piston) world.setBlock(x, y, z, GregTech_API.sBlockMetal5, 2, 3); + else world.setBlockToAir(x, y, z); + return true; + } + }) + .build(); @Override public IStructureDefinition<GT_TileEntity_ElectricImplosionCompressor> getStructureDefinition() { @@ -142,37 +167,36 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Implosion Compressor"). - addInfo("Explosions are fun"). - addInfo("Controller block for the Electric Implosion Compressor"). - addInfo("Uses electricity instead of Explosives"). - addSeparator(). - beginStructureBlock(3, 9, 3, false). - addController("Front 3rd layer center"). - addCasingInfo("Solid Steel Machine Casing", 8). - addStructureInfo("Casings can be replaced with Explosion Warning Signs"). - addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8"). - addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8"). - addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6"). - addMaintenanceHatch("Any bottom casing", 1). - addInputBus("Any bottom casing", 1). - addInputHatch("Any bottom casing", 1). - addOutputBus("Any bottom casing", 1). - addMaintenanceHatch("Any bottom casing", 1). - addEnergyHatch("Bottom and top middle", 2). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Implosion Compressor") + .addInfo("Explosions are fun") + .addInfo("Controller block for the Electric Implosion Compressor") + .addInfo("Uses electricity instead of Explosives") + .addSeparator() + .beginStructureBlock(3, 9, 3, false) + .addController("Front 3rd layer center") + .addCasingInfo("Solid Steel Machine Casing", 8) + .addStructureInfo("Casings can be replaced with Explosion Warning Signs") + .addOtherStructurePart("Transformer-Winding Blocks", "Outer layer 2,3,7,8") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Inner layer 2,3,7,8") + .addOtherStructurePart("Neutronium Blocks", "Layer 4,5,6") + .addMaintenanceHatch("Any bottom casing", 1) + .addInputBus("Any bottom casing", 1) + .addInputHatch("Any bottom casing", 1) + .addOutputBus("Any bottom casing", 1) + .addMaintenanceHatch("Any bottom casing", 1) + .addEnergyHatch("Bottom and top middle", 2) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @Override public boolean checkRecipe(ItemStack aStack) { - if (this.mEnergyHatches.get(0).getEUVar() <= 0 || this.mEnergyHatches.get(1).getEUVar() <= 0) - return false; + if (this.mEnergyHatches.get(0).getEUVar() <= 0 + || this.mEnergyHatches.get(1).getEUVar() <= 0) return false; ItemStack[] tItemInputs = getCompactedInputs(); - FluidStack[] tFluidInputs = getCompactedFluids(); + FluidStack[] tFluidInputs = getCompactedFluids(); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -183,9 +207,8 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity this.mEfficiency = 10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000; this.mEfficiencyIncrease = 10000; calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; if (this.mEUt > 0) { this.mEUt = -this.mEUt; } @@ -198,14 +221,14 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return false; } - private void updateChunkCoordinates(){ + private void updateChunkCoordinates() { chunkCoordinates.clear(); - for(int x = -1; x <= 1; x++) - for(int z = -1; z <= 1; z++) { + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) { if (!(Math.abs(x) == 1 && Math.abs(z) == 1)) { - int[] abc = new int[]{x, -2, z + 1}; - int[] xyz = new int[]{0, 0, 0}; + int[] abc = new int[] {x, -2, z + 1}; + int[] xyz = new int[] {0, 0, 0}; this.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += this.getBaseMetaTileEntity().getXCoord(); xyz[1] += this.getBaseMetaTileEntity().getYCoord(); @@ -225,8 +248,9 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity public boolean drainEnergyInput(long aEU) { if (aEU <= 0) return true; GT_MetaTileEntity_Hatch_Energy h1 = this.mEnergyHatches.get(0), h2 = this.mEnergyHatches.get(1); - if(!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; - if(!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false) || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU/2, false)) return false; + if (!isValidMetaTileEntity(h1) || !isValidMetaTileEntity(h2)) return false; + if (!h1.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false) + || !h2.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU / 2, false)) return false; return true; } @@ -251,29 +275,26 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } public void stopMachine() { - if (pistonEnabled) - this.resetPiston(); + if (pistonEnabled) this.resetPiston(); super.stopMachine(); } private void resetPiston() { IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); - if (!aBaseMetaTileEntity.isServerSide()) - return; + if (!aBaseMetaTileEntity.isServerSide()) return; if (!this.piston && this.mMachine) { - chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + chunkCoordinates.forEach(c -> + aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); this.piston = !this.piston; } } private void togglePiston(IGregTechTileEntity aBaseMetaTileEntity) { - if (aBaseMetaTileEntity.getWorld().isRemote) - return; + if (aBaseMetaTileEntity.getWorld().isRemote) return; if (this.piston) { - for(ChunkCoordinates c : chunkCoordinates) - { - if(aBaseMetaTileEntity.getBlock(c.posX, c.posY, c.posZ) != GregTech_API.sBlockMetal5 || aBaseMetaTileEntity.getMetaID(c.posX, c.posY, c.posZ) != 2) - { + for (ChunkCoordinates c : chunkCoordinates) { + if (aBaseMetaTileEntity.getBlock(c.posX, c.posY, c.posZ) != GregTech_API.sBlockMetal5 + || aBaseMetaTileEntity.getMetaID(c.posX, c.posY, c.posZ) != 2) { this.explodeMultiblock(); return; } @@ -281,9 +302,17 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } else { - chunkCoordinates.forEach(c -> aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); - if(!getBaseMetaTileEntity().hasMufflerUpgrade()) - GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), sound, 1f, 1f, chunkCoordinates.get(0).posX, chunkCoordinates.get(0).posY, chunkCoordinates.get(0).posZ); + chunkCoordinates.forEach(c -> + aBaseMetaTileEntity.getWorld().setBlock(c.posX, c.posY, c.posZ, GregTech_API.sBlockMetal5, 2, 3)); + if (!getBaseMetaTileEntity().hasMufflerUpgrade()) + GT_Utility.sendSoundToPlayers( + aBaseMetaTileEntity.getWorld(), + sound, + 1f, + 1f, + chunkCoordinates.get(0).posX, + chunkCoordinates.get(0).posY, + chunkCoordinates.get(0).posZ); } this.piston = !this.piston; } @@ -297,13 +326,12 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - if(aNBT.hasKey("piston")) this.piston = aNBT.getBoolean("piston"); + if (aNBT.hasKey("piston")) this.piston = aNBT.getBoolean("piston"); } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - if(!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 1, 6, 0)) return false; return this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() == 2; } @@ -312,7 +340,6 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return 10000; } - @Override public int getPollutionPerTick(ItemStack itemStack) { return 0; @@ -333,19 +360,41 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity return new GT_TileEntity_ElectricImplosionCompressor(this.mName); } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_IMPLOSION_COMPRESSOR_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java index ffe6e4b0c4..0f8dca5a33 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ExtremeIndustrialGreenhouse.java @@ -17,6 +17,11 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.client.renderer.BW_CropVisualizer; @@ -45,6 +50,7 @@ import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.core.Ic2Items; import ic2.core.crop.TileEntityCrop; +import java.util.*; import net.minecraft.block.Block; import net.minecraft.block.BlockStem; import net.minecraft.client.Minecraft; @@ -66,14 +72,8 @@ import net.minecraftforge.common.IPlantable; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ExtremeIndustrialGreenhouse> { +public class GT_TileEntity_ExtremeIndustrialGreenhouse + extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ExtremeIndustrialGreenhouse> { private static final boolean debug = false; @@ -86,29 +86,63 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; private static final Item forestryfertilizer = GameRegistry.findItem("Forestry", "fertilizerCompound"); - private static final IStructureDefinition<GT_TileEntity_ExtremeIndustrialGreenhouse> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_ExtremeIndustrialGreenhouse>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, - {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, - {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, - {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, - {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, - {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, - })) - .addElement('c', ofChain( - onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, CASING_INDEX, 1) - )) - .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) - .addElement('l', LoaderReference.ProjRedIllumination ? ofBlock(Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), 10) : ofBlock(Blocks.redstone_lamp, 0)) - .addElement('g', debug ? ofBlock(Blocks.glass, 0) : BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .addElement('d', ofBlock(LoaderReference.RandomThings ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") : Blocks.farmland, 0)) - .addElement('w', ofBlock(Blocks.water, 0)) - .build(); - + private static final IStructureDefinition<GT_TileEntity_ExtremeIndustrialGreenhouse> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_ExtremeIndustrialGreenhouse>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ccccc", "ccccc", "ccccc", "ccccc", "ccccc"}, + {"ccccc", "clllc", "clllc", "clllc", "ccccc"}, + {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, + {"ggggg", "g---g", "g---g", "g---g", "ggggg"}, + {"ccccc", "cdddc", "cdwdc", "cdddc", "ccccc"}, + {"cc~cc", "cCCCc", "cCCCc", "cCCCc", "ccccc"}, + })) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1)), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addEnergyInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addMaintenanceToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GT_TileEntity_ExtremeIndustrialGreenhouse::addOutputToMachineList, + CASING_INDEX, + 1))) + .addElement('C', onElementPass(t -> t.mCasing++, ofBlock(GregTech_API.sBlockCasings4, 1))) + .addElement( + 'l', + LoaderReference.ProjRedIllumination + ? ofBlock( + Block.getBlockFromName("ProjRed|Illumination:projectred.illumination.lamp"), + 10) + : ofBlock(Blocks.redstone_lamp, 0)) + .addElement( + 'g', + debug + ? ofBlock(Blocks.glass, 0) + : BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier)) + .addElement( + 'd', + ofBlock( + LoaderReference.RandomThings + ? Block.getBlockFromName("RandomThings:fertilizedDirt_tilled") + : Blocks.farmland, + 0)) + .addElement('w', ofBlock(Blocks.water, 0)) + .build(); public GT_TileEntity_ExtremeIndustrialGreenhouse(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -120,31 +154,30 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(aPlayer.isSneaking()) - { - if(this.mMaxProgresstime > 0) - { + if (aPlayer.isSneaking()) { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if the machine is working!"); return; } - if(!mStorage.isEmpty()) - { + if (!mStorage.isEmpty()) { GT_Utility.sendChatToPlayer(aPlayer, "You cant change IC2 mode if there are seeds inside!"); return; } this.isIC2Mode = !this.isIC2Mode; GT_Utility.sendChatToPlayer(aPlayer, "IC2 mode is now " + (this.isIC2Mode ? "enabled" : "disabled.")); - } - else { - if(this.mMaxProgresstime > 0) - { + } else { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "You cant enable/disable setup if the machine is working!"); return; } this.setupphase++; - if(this.setupphase == 3) - this.setupphase = 0; - GT_Utility.sendChatToPlayer(aPlayer, "EIG is now running in " + (this.setupphase == 1 ? "setup mode (input)." : ( this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); + if (this.setupphase == 3) this.setupphase = 0; + GT_Utility.sendChatToPlayer( + aPlayer, + "EIG is now running in " + + (this.setupphase == 1 + ? "setup mode (input)." + : (this.setupphase == 2 ? "setup mode (output)." : "normal operation."))); } } @@ -163,61 +196,60 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && f.isNotFlipped(); } - private static String tierString(int tier){ + private static String tierString(int tier) { return GT_Values.TIER_COLORS[tier] + GT_Values.VN[tier] + ChatColorHelper.RESET + ChatColorHelper.GRAY; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Crop Farm"). - addInfo("Controller block for the Extreme Industrial Greenhouse"). - addInfo("Grow your crops like a chad !"). - addInfo("Use screwdriver to enable/change/disable setup mode"). - addInfo("Use screwdriver while sneaking to enable/disable IC2 mode"). - addInfo("Uses 1000L of water per crop per operation"). - addInfo("You can insert fertilizer each operation to get more drops (max +400%)"). - addInfo("-------------------- SETUP MODE --------------------"). - addInfo("Does not take power"). - addInfo("There are two modes: input / output"). - addInfo("Input mode: machine will take seeds from input bus and plant them"). - addInfo("[IC2] You need to also input block that is required under the crop"). - addInfo("Output mode: machine will take planted seeds and output them"). - addInfo("-------------------- NORMAL CROPS --------------------"). - addInfo("Minimal tier: " + tierString(4)). - addInfo("Starting with 1 slot"). - addInfo("Every slot gives 64 crops"). - addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2"). - addInfo("Base process time: 5 sec"). - addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)"). - addInfo("All crops are grown at the end of the operation"). - addInfo("Will automatically craft seeds if they are not dropped"). - addInfo("1 Fertilizer per 1 crop +200%"). - addInfo("-------------------- IC2 CROPS --------------------"). - addInfo("Minimal tier: " + tierString(6)). - addInfo("Need " + tierString(6) + " glass tier"). - addInfo("Starting with 4 slots"). - addInfo("Every slot gives 1 crop"). - addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4"). - addInfo("Process time: 5 sec"). - addInfo("All crops are accelerated by x32 times"). - addInfo("1 Fertilizer per 1 crop +10%"). - addInfo(BW_Tooltip_Reference.TT_BLUEPRINT). - addSeparator(). - beginStructureBlock(5, 4, 5, false). - addController("Front bottom center"). - addCasingInfo("Clean Stainless Steel Casings", 70). - addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2). - addStructureInfo("The glass tier limits the Energy Input tier"). - addStructureInfo("The dirt is from RandomThings, must be tilled"). - addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit"). - addMaintenanceHatch("Any casing (Except inner bottom ones)", 1). - addInputBus("Any casing (Except inner bottom ones)", 1). - addOutputBus("Any casing (Except inner bottom ones)", 1). - addInputHatch("Any casing (Except inner bottom ones)", 1). - addEnergyHatch("Any casing (Except inner bottom ones)", 1). - toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); + tt.addMachineType("Crop Farm") + .addInfo("Controller block for the Extreme Industrial Greenhouse") + .addInfo("Grow your crops like a chad !") + .addInfo("Use screwdriver to enable/change/disable setup mode") + .addInfo("Use screwdriver while sneaking to enable/disable IC2 mode") + .addInfo("Uses 1000L of water per crop per operation") + .addInfo("You can insert fertilizer each operation to get more drops (max +400%)") + .addInfo("-------------------- SETUP MODE --------------------") + .addInfo("Does not take power") + .addInfo("There are two modes: input / output") + .addInfo("Input mode: machine will take seeds from input bus and plant them") + .addInfo("[IC2] You need to also input block that is required under the crop") + .addInfo("Output mode: machine will take planted seeds and output them") + .addInfo("-------------------- NORMAL CROPS --------------------") + .addInfo("Minimal tier: " + tierString(4)) + .addInfo("Starting with 1 slot") + .addInfo("Every slot gives 64 crops") + .addInfo("Every tier past " + tierString(4) + ", slots are multiplied by 2") + .addInfo("Base process time: 5 sec") + .addInfo("Process time is divided by number of tiers past " + tierString(3) + " (Minimum 1 sec)") + .addInfo("All crops are grown at the end of the operation") + .addInfo("Will automatically craft seeds if they are not dropped") + .addInfo("1 Fertilizer per 1 crop +200%") + .addInfo("-------------------- IC2 CROPS --------------------") + .addInfo("Minimal tier: " + tierString(6)) + .addInfo("Need " + tierString(6) + " glass tier") + .addInfo("Starting with 4 slots") + .addInfo("Every slot gives 1 crop") + .addInfo("Every tier past " + tierString(6) + ", slots are multiplied by 4") + .addInfo("Process time: 5 sec") + .addInfo("All crops are accelerated by x32 times") + .addInfo("1 Fertilizer per 1 crop +10%") + .addInfo(BW_Tooltip_Reference.TT_BLUEPRINT) + .addSeparator() + .beginStructureBlock(5, 4, 5, false) + .addController("Front bottom center") + .addCasingInfo("Clean Stainless Steel Casings", 70) + .addOtherStructurePart("Borosilicate Glass", "Hollow two middle layers", 2) + .addStructureInfo("The glass tier limits the Energy Input tier") + .addStructureInfo("The dirt is from RandomThings, must be tilled") + .addStructureInfo("Purple lamps are from ProjectRedIllumination. They can be lit") + .addMaintenanceHatch("Any casing (Except inner bottom ones)", 1) + .addInputBus("Any casing (Except inner bottom ones)", 1) + .addOutputBus("Any casing (Except inner bottom ones)", 1) + .addInputHatch("Any casing (Except inner bottom ones)", 1) + .addEnergyHatch("Any casing (Except inner bottom ones)", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(ChatColorHelper.GOLD + "kuba6000")); return tt; } @@ -226,7 +258,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity List<String> info = new ArrayList<>(Arrays.asList(super.getStructureDescription(stackSize))); info.add("The dirt is from RandomThings, must be tilled"); info.add("Purple lamps are from ProjectRedIllumination. They can be lit"); - return info.toArray(new String[]{}); + return info.toArray(new String[] {}); } @Override @@ -236,7 +268,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity aNBT.setInteger("setupphase", setupphase); aNBT.setBoolean("isIC2Mode", isIC2Mode); aNBT.setInteger("mStorageSize", mStorage.size()); - for(int i = 0; i < mStorage.size(); i++) + for (int i = 0; i < mStorage.size(); i++) aNBT.setTag("mStorage." + i, mStorage.get(i).toNBTTagCompound()); } @@ -246,12 +278,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity glasTier = aNBT.getByte("glasTier"); setupphase = aNBT.getInteger("setupphase"); isIC2Mode = aNBT.getBoolean("isIC2Mode"); - for(int i = 0; i < aNBT.getInteger("mStorageSize"); i++) + for (int i = 0; i < aNBT.getInteger("mStorageSize"); i++) mStorage.add(new GreenHouseSlot(aNBT.getCompoundTag("mStorage." + i))); } @SideOnly(Side.CLIENT) - public void spawnVisualCrop(World world, int x, int y, int z, int meta, int age){ + public void spawnVisualCrop(World world, int x, int y, int z, int meta, int age) { BW_CropVisualizer crop = new BW_CropVisualizer(world, x, y, z, meta, age); Minecraft.getMinecraft().effectRenderer.addEffect(crop); } @@ -259,36 +291,35 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if(aBaseMetaTileEntity.isClientSide()) - { - if(aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { - for(int x = -1; x <= 1; x++) - for(int z = -1; z <= 1; z++) { - if(x == 0 && z == 0) - continue; - int[] abc = new int[]{x, -2, z+2}; - int[] xyz = new int[]{0, 0, 0}; + if (aBaseMetaTileEntity.isClientSide()) { + if (aBaseMetaTileEntity.isActive() && aTick % 40 == 0) { + for (int x = -1; x <= 1; x++) + for (int z = -1; z <= 1; z++) { + if (x == 0 && z == 0) continue; + int[] abc = new int[] {x, -2, z + 2}; + int[] xyz = new int[] {0, 0, 0}; this.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += aBaseMetaTileEntity.getXCoord(); xyz[1] += aBaseMetaTileEntity.getYCoord(); xyz[2] += aBaseMetaTileEntity.getZCoord(); - spawnVisualCrop(aBaseMetaTileEntity.getWorld(), xyz[0], xyz[1], xyz[2], aBaseMetaTileEntity.getRandomNumber(8), 40); + spawnVisualCrop( + aBaseMetaTileEntity.getWorld(), + xyz[0], + xyz[1], + xyz[2], + aBaseMetaTileEntity.getRandomNumber(8), + 40); } } } - if(aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) - { - if(setupphase == 1 && mStorage.size() < mMaxSlots) { + if (aBaseMetaTileEntity.isServerSide() && this.mMaxProgresstime > 0 && setupphase > 0 && aTick % 5 == 0) { + if (setupphase == 1 && mStorage.size() < mMaxSlots) { List<ItemStack> inputs = getStoredInputs(); - for (ItemStack input : inputs) - if (addCrop(input)) - break; + for (ItemStack input : inputs) if (addCrop(input)) break; this.updateSlots(); - } - else if(setupphase == 2 && mStorage.size() > 0) - { + } else if (setupphase == 2 && mStorage.size() > 0) { this.addOutput(this.mStorage.get(0).input.copy()); - if(this.mStorage.get(0).undercrop != null) + if (this.mStorage.get(0).undercrop != null) this.addOutput(this.mStorage.get(0).undercrop.copy()); this.mStorage.remove(0); this.updateSlots(); @@ -306,16 +337,12 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return true; } - private void updateMaxSlots() - { + private void updateMaxSlots() { long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); - if(tier < (isIC2Mode ? 6 : 4)) - mMaxSlots = 0; - else if(isIC2Mode) - mMaxSlots = 4 << (2 * (tier - 6)); - else - mMaxSlots = 1 << (tier - 4); + if (tier < (isIC2Mode ? 6 : 4)) mMaxSlots = 0; + else if (isIC2Mode) mMaxSlots = 4 << (2 * (tier - 6)); + else mMaxSlots = 1 << (tier - 4); } @Override @@ -323,8 +350,8 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity long v = this.getMaxInputVoltage(); int tier = GT_Utility.getTier(v); updateMaxSlots(); - if(setupphase > 0) { - if((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) + if (setupphase > 0) { + if ((mStorage.size() >= mMaxSlots && setupphase == 1) || (mStorage.size() == 0 && setupphase == 2)) return false; this.mMaxProgresstime = 20; this.mEUt = 0; @@ -332,65 +359,56 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity this.mEfficiencyIncrease = 10000; return true; } - if(mStorage.size() > mMaxSlots) - return false; - if(mStorage.isEmpty()) - return false; + if (mStorage.size() > mMaxSlots) return false; + if (mStorage.isEmpty()) return false; waterusage = 0; - for(GreenHouseSlot s : mStorage) - waterusage += s.input.stackSize; + for (GreenHouseSlot s : mStorage) waterusage += s.input.stackSize; - if(!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000)) && !debug) - return false; + if (!depleteInput(new FluidStack(FluidRegistry.WATER, waterusage * 1000)) && !debug) return false; // OVERCLOCK - // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per operation + // FERTILIZER IDEA - IC2 +10% per fertilizer per crop per operation, NORMAL +200% per fertilizer per crop per + // operation int boost = 0; int maxboost = 0; - for(GreenHouseSlot s : mStorage) - maxboost += s.input.stackSize * (isIC2Mode ? 40 : 2); + for (GreenHouseSlot s : mStorage) maxboost += s.input.stackSize * (isIC2Mode ? 40 : 2); ArrayList<ItemStack> inputs = getStoredInputs(); - for(ItemStack i : inputs){ - if(( i.getItem() == Items.dye && i.getItemDamage() == 15) || - (forestryfertilizer != null && (i.getItem() == forestryfertilizer)) || - (GT_Utility.areStacksEqual(i, Ic2Items.fertilizer))) - { + for (ItemStack i : inputs) { + if ((i.getItem() == Items.dye && i.getItemDamage() == 15) + || (forestryfertilizer != null && (i.getItem() == forestryfertilizer)) + || (GT_Utility.areStacksEqual(i, Ic2Items.fertilizer))) { int used = Math.min(i.stackSize, maxboost - boost); i.stackSize -= used; boost += used; } - if(boost == maxboost) - break; + if (boost == maxboost) break; } - double multiplier = 1.d + (((double)boost/(double)maxboost) * 4d); + double multiplier = 1.d + (((double) boost / (double) maxboost) * 4d); - if(isIC2Mode) - { - if(glasTier < 6) - return false; + if (isIC2Mode) { + if (glasTier < 6) return false; this.mMaxProgresstime = 100; List<ItemStack> outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) - outputs.addAll(mStorage.get(i).getIC2Drops(((double)this.mMaxProgresstime / 8d) * multiplier)); + outputs.addAll(mStorage.get(i).getIC2Drops(((double) this.mMaxProgresstime / 8d) * multiplier)); this.mOutputItems = outputs.toArray(new ItemStack[0]); - } - else { + } else { this.mMaxProgresstime = Math.max(20, 100 / (tier - 3)); // Min 1 s List<ItemStack> outputs = new ArrayList<>(); for (int i = 0; i < Math.min(mMaxSlots, mStorage.size()); i++) { for (ItemStack drop : mStorage.get(i).getDrops()) { ItemStack s = drop.copy(); - s.stackSize = (int)((double)s.stackSize * multiplier); + s.stackSize = (int) ((double) s.stackSize * multiplier); outputs.add(s); } } this.mOutputItems = outputs.toArray(new ItemStack[0]); } - this.mEUt = -(int)((double) GT_Values.V[tier] * 0.99d); + this.mEUt = -(int) ((double) GT_Values.V[tier] * 0.99d); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; this.updateSlots(); @@ -401,23 +419,17 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { mCasing = 0; glasTier = 0; - if(debug) - glasTier = 8; + if (debug) glasTier = 8; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 5, 0)) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; + if (this.glasTier < hatchEnergy.mTier) return false; - boolean valid = this.mMaintenanceHatches.size() == 1 && - this.mEnergyHatches.size() >= 1 && - this.mCasing >= 70; + boolean valid = this.mMaintenanceHatches.size() == 1 && this.mEnergyHatches.size() >= 1 && this.mCasing >= 70; - if(valid) - updateMaxSlots(); + if (valid) updateMaxSlots(); return valid; } @@ -440,62 +452,87 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public String[] getInfoData() { List<String> info = new ArrayList<>(Arrays.asList( - "Running in mode: " + EnumChatFormatting.GREEN + (setupphase == 0 ? (isIC2Mode ? "IC2 crops" : "Normal crops") : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + EnumChatFormatting.RESET, - "Uses " + waterusage * 1000 + "L/operation of water", - "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, - "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + this.mStorage.size() + EnumChatFormatting.RESET - )); - for(int i = 0; i < mStorage.size(); i++) { - if(!mStorage.get(i).isValid) - continue; - StringBuilder a = new StringBuilder("Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + this.mStorage.get(i).input.getDisplayName()); - if(this.isIC2Mode) { + "Running in mode: " + EnumChatFormatting.GREEN + + (setupphase == 0 + ? (isIC2Mode ? "IC2 crops" : "Normal crops") + : ("Setup mode " + (setupphase == 1 ? "(input)" : "(output)"))) + + EnumChatFormatting.RESET, + "Uses " + waterusage * 1000 + "L/operation of water", + "Max slots: " + EnumChatFormatting.GREEN + this.mMaxSlots + EnumChatFormatting.RESET, + "Used slots: " + ((mStorage.size() > mMaxSlots) ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + + this.mStorage.size() + EnumChatFormatting.RESET)); + for (int i = 0; i < mStorage.size(); i++) { + if (!mStorage.get(i).isValid) continue; + StringBuilder a = new StringBuilder( + "Slot " + i + ": " + EnumChatFormatting.GREEN + "x" + this.mStorage.get(i).input.stackSize + " " + + this.mStorage.get(i).input.getDisplayName()); + if (this.isIC2Mode) { a.append(" : "); - for (Map.Entry<String, Double> entry : mStorage.get(i).dropprogress.entrySet()) + for (Map.Entry<String, Double> entry : + mStorage.get(i).dropprogress.entrySet()) a.append((int) (entry.getValue() * 100d)).append("% "); } a.append(EnumChatFormatting.RESET); info.add(a.toString()); } - if(mStorage.size() > mMaxSlots) - info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + EnumChatFormatting.RESET); + if (mStorage.size() > mMaxSlots) + info.add(EnumChatFormatting.DARK_RED + "There are too many crops inside to run !" + + EnumChatFormatting.RESET); info.addAll(Arrays.asList(super.getInfoData())); return info.toArray(new String[0]); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } public List<GreenHouseSlot> mStorage = new ArrayList<>(); - public boolean addCrop(ItemStack input){ - if(!isIC2Mode) - for(GreenHouseSlot g : mStorage) - if(GT_Utility.areStacksEqual(g.input, input)) - { + public boolean addCrop(ItemStack input) { + if (!isIC2Mode) + for (GreenHouseSlot g : mStorage) + if (GT_Utility.areStacksEqual(g.input, input)) { g.addAll(this.getBaseMetaTileEntity().getWorld(), input); - if(input.stackSize == 0) - return true; + if (input.stackSize == 0) return true; } GreenHouseSlot h = new GreenHouseSlot(this, input.copy(), true, isIC2Mode); - if(h.isValid) { - if(isIC2Mode) - input.stackSize--; - else - input.stackSize = 0; + if (h.isValid) { + if (isIC2Mode) input.stackSize--; + else input.stackSize = 0; mStorage.add(h); return true; } @@ -523,69 +560,66 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity static GreenHouseWorld fakeworld = new GreenHouseWorld(5, 5, 5); - public NBTTagCompound toNBTTagCompound(){ + public NBTTagCompound toNBTTagCompound() { NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setTag("input", input.writeToNBT(new NBTTagCompound())); aNBT.setBoolean("isValid", isValid); aNBT.setBoolean("isIC2Crop", isIC2Crop); - if(!isIC2Crop) { + if (!isIC2Crop) { aNBT.setInteger("crop", Block.getIdFromBlock(crop)); aNBT.setInteger("dropscount", drops.size()); for (int i = 0; i < drops.size(); i++) aNBT.setTag("drop." + i, drops.get(i).writeToNBT(new NBTTagCompound())); aNBT.setInteger("optimalgrowth", optimalgrowth); aNBT.setBoolean("needsreplanting", needsreplanting); - } - else { - if(undercrop != null) - aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); + } else { + if (undercrop != null) aNBT.setTag("undercrop", undercrop.writeToNBT(new NBTTagCompound())); aNBT.setInteger("generationscount", generations.size()); - for(int i = 0; i < generations.size(); i++) - { - aNBT.setInteger("generation." + i + ".count", generations.get(i).size()); - for(int j = 0; j < generations.get(i).size(); j++) - aNBT.setTag("generation." + i + "." + j, generations.get(i).get(j).writeToNBT(new NBTTagCompound())); + for (int i = 0; i < generations.size(); i++) { + aNBT.setInteger( + "generation." + i + ".count", generations.get(i).size()); + for (int j = 0; j < generations.get(i).size(); j++) + aNBT.setTag( + "generation." + i + "." + j, + generations.get(i).get(j).writeToNBT(new NBTTagCompound())); } aNBT.setInteger("growthticks", growthticks); } return aNBT; } - public GreenHouseSlot(NBTTagCompound aNBT){ + public GreenHouseSlot(NBTTagCompound aNBT) { super(null, 3, 3); isIC2Crop = aNBT.getBoolean("isIC2Crop"); isValid = aNBT.getBoolean("isValid"); input = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("input")); - if(!isIC2Crop) { + if (!isIC2Crop) { crop = Block.getBlockById(aNBT.getInteger("crop")); drops = new ArrayList<>(); for (int i = 0; i < aNBT.getInteger("dropscount"); i++) drops.add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("drop." + i))); optimalgrowth = aNBT.getInteger("optimalgrowth"); - if(optimalgrowth == 0) optimalgrowth = 7; - if(aNBT.hasKey("needsreplanting")) needsreplanting = aNBT.getBoolean("needsreplanting"); - } - else - { - if(aNBT.hasKey("undercrop")) + if (optimalgrowth == 0) optimalgrowth = 7; + if (aNBT.hasKey("needsreplanting")) needsreplanting = aNBT.getBoolean("needsreplanting"); + } else { + if (aNBT.hasKey("undercrop")) undercrop = ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("undercrop")); generations = new ArrayList<>(); - for(int i = 0; i < aNBT.getInteger("generationscount"); i++) - { + for (int i = 0; i < aNBT.getInteger("generationscount"); i++) { generations.add(new ArrayList<>()); - for(int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) - generations.get(i).add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); + for (int j = 0; j < aNBT.getInteger("generation." + i + ".count"); j++) + generations + .get(i) + .add(ItemStack.loadItemStackFromNBT(aNBT.getCompoundTag("generation." + i + "." + j))); } growthticks = aNBT.getInteger("growthticks"); rn = new Random(); } } - public boolean addAll(World world, ItemStack input){ - if(!GT_Utility.areStacksEqual(this.input, input)) - return false; - if(this.input.stackSize == 64) - return false; + public boolean addAll(World world, ItemStack input) { + if (!GT_Utility.areStacksEqual(this.input, input)) return false; + if (this.input.stackSize == 64) return false; int toconsume = Math.min(64 - this.input.stackSize, input.stackSize); int left = addDrops(world, toconsume, true); input.stackSize -= toconsume - left; @@ -593,17 +627,20 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return left == 0; } - public boolean findCropRecipe(World world){ - if(recipe != null) - return true; - out : for (ItemStack drop : drops) { + public boolean findCropRecipe(World world) { + if (recipe != null) return true; + out: + for (ItemStack drop : drops) { recipeInput = drop; - for (int j = 0; j < CraftingManager.getInstance().getRecipeList().size(); j++) { - recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(j); - if (recipe.matches(this, world) && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { + for (int j = 0; + j < CraftingManager.getInstance().getRecipeList().size(); + j++) { + recipe = (IRecipe) + CraftingManager.getInstance().getRecipeList().get(j); + if (recipe.matches(this, world) + && GT_Utility.areStacksEqual(recipe.getCraftingResult(this), input)) { break out; - } else - recipe = null; + } else recipe = null; } } return recipe != null; @@ -611,8 +648,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public ItemStack getStackInSlot(int p_70301_1_) { - if(p_70301_1_ == 0) - return recipeInput.copy(); + if (p_70301_1_ == 0) return recipeInput.copy(); return null; } @@ -622,8 +658,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity } @Override - public ItemStack decrStackSize(int par1, int par2) - { + public ItemStack decrStackSize(int par1, int par2) { return null; } @@ -632,65 +667,55 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity return; } - public GreenHouseSlot(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2){ + public GreenHouseSlot( + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, ItemStack input, boolean autocraft, boolean IC2) { super(null, 3, 3); World world = tileEntity.getBaseMetaTileEntity().getWorld(); this.input = input.copy(); this.isValid = false; - if(IC2) - { + if (IC2) { GreenHouseSlotIC2(tileEntity, world, input); return; } Item i = input.getItem(); Block b = null; - if(i instanceof IPlantable) { - if (i instanceof ItemSeeds) - b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); - else if (i instanceof ItemSeedFood) - b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); - } - else { - if(i == Items.reeds) - b = Blocks.reeds; + if (i instanceof IPlantable) { + if (i instanceof ItemSeeds) b = ((ItemSeeds) i).getPlant(world, 0, 0, 0); + else if (i instanceof ItemSeedFood) b = ((ItemSeedFood) i).getPlant(world, 0, 0, 0); + } else { + if (i == Items.reeds) b = Blocks.reeds; else { b = Block.getBlockFromItem(i); - if(!(b == Blocks.cactus)) - return; + if (!(b == Blocks.cactus)) return; } needsreplanting = false; } - if (!(b instanceof IPlantable)) - return; + if (!(b instanceof IPlantable)) return; GameRegistry.UniqueIdentifier u = GameRegistry.findUniqueIdentifierFor(i); - if(u != null && Objects.equals(u.modId, "Natura")) - optimalgrowth = 8; + if (u != null && Objects.equals(u.modId, "Natura")) optimalgrowth = 8; - if(b instanceof BlockStem){ + if (b instanceof BlockStem) { fakeworld.block = null; try { b.updateTick(fakeworld, 5, 5, 5, fakeworld.rand); - } - catch(Exception e) - { + } catch (Exception e) { e.printStackTrace(System.err); } - if(fakeworld.block == null) - return; + if (fakeworld.block == null) return; b = fakeworld.block; needsreplanting = false; } crop = b; isIC2Crop = false; - if(addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()){ + if (addDrops(world, input.stackSize, autocraft) == 0 && !drops.isEmpty()) { this.isValid = true; } } - public void GreenHouseSlotIC2(GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input){ - if(!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) - return; + public void GreenHouseSlotIC2( + GT_TileEntity_ExtremeIndustrialGreenhouse tileEntity, World world, ItemStack input) { + if (!ItemList.IC2_Crop_Seeds.isStackEqual(input, true, true)) return; CropCard cc = Crops.instance.getCropCard(input); this.input.stackSize = 1; NBTTagCompound nbt = input.getTagCompound(); @@ -698,16 +723,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity byte ga = nbt.getByte("gain"); byte re = nbt.getByte("resistance"); this.isIC2Crop = true; - int[] abc = new int[]{0, -2, 3}; - int[] xyz = new int[]{0, 0, 0}; + int[] abc = new int[] {0, -2, 3}; + int[] xyz = new int[] {0, 0, 0}; tileEntity.getExtendedFacing().getWorldOffset(abc, xyz); xyz[0] += tileEntity.getBaseMetaTileEntity().getXCoord(); xyz[1] += tileEntity.getBaseMetaTileEntity().getYCoord(); xyz[2] += tileEntity.getBaseMetaTileEntity().getZCoord(); boolean cheating = false; - try{ - if(world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) - { + try { + if (world.getBlock(xyz[0], xyz[1] - 2, xyz[2]) != GregTech_API.sBlockCasings4 + || world.getBlockMetadata(xyz[0], xyz[1] - 2, xyz[2]) != 1) { // no cheating = true; return; @@ -715,12 +740,11 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity world.setBlock(xyz[0], xyz[1], xyz[2], Block.getBlockFromItem(Ic2Items.crop.getItem()), 0, 0); TileEntity wte = world.getTileEntity(xyz[0], xyz[1], xyz[2]); - if(!(wte instanceof TileEntityCrop)) - { + if (!(wte instanceof TileEntityCrop)) { // should not be even possible return; } - TileEntityCrop te = (TileEntityCrop)wte; + TileEntityCrop te = (TileEntityCrop) wte; te.ticker = 1; // dont even think about ticking once te.setCrop(cc); @@ -731,20 +755,16 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity ItemStack tobeused = null; te.setSize((byte) (cc.maxSize() - 1)); - if(!cc.canGrow(te)) - { + if (!cc.canGrow(te)) { // needs special block boolean cangrow = false; ArrayList<ItemStack> inputs = tileEntity.getStoredInputs(); - for(ItemStack a : inputs) - { + for (ItemStack a : inputs) { Block b = Block.getBlockFromItem(a.getItem()); - if(b == Blocks.air) - continue; + if (b == Blocks.air) continue; world.setBlock(xyz[0], xyz[1] - 2, xyz[2], b, a.getItemDamage(), 0); - if(!cc.canGrow(te)) - continue; + if (!cc.canGrow(te)) continue; cangrow = true; undercrop = a.copy(); undercrop.stackSize = 1; @@ -752,142 +772,116 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity break; } - if(!cangrow) - return; + if (!cangrow) return; } te.setSize((byte) cc.maxSize()); - if(!cc.canBeHarvested(te)) - return; + if (!cc.canBeHarvested(te)) return; // GENERATE DROPS generations = new ArrayList<>(); - out: for(int i = 0; i < 10; i++) // get 10 generations + out: + for (int i = 0; i < 10; i++) // get 10 generations { ItemStack[] st = te.harvest_automated(false); te.setSize((byte) cc.maxSize()); - if (st == null) - continue; - if (st.length == 0) - continue; - for(ItemStack s : st) - if(s == null) - continue out; + if (st == null) continue; + if (st.length == 0) continue; + for (ItemStack s : st) if (s == null) continue out; generations.add(new ArrayList<>(Arrays.asList(st))); } - if(generations.isEmpty()) - return; + if (generations.isEmpty()) return; rn = new Random(); - // CHECK GROWTH SPEED - te.humidity = 12; // humidity with full water storage - te.airQuality = 6; // air quality when sky is seen - te.nutrients = 8; // netrients with full nutrient storage + te.humidity = 12; // humidity with full water storage + te.airQuality = 6; // air quality when sky is seen + te.nutrients = 8; // netrients with full nutrient storage int dur = cc.growthDuration(te); int rate = te.calcGrowthRate(); - if(rate == 0) // should not be possible with those stats - return; + if (rate == 0) // should not be possible with those stats + return; growthticks = dur / rate; - if(growthticks < 1) - growthticks = 1; + if (growthticks < 1) growthticks = 1; - input.stackSize --; - if(tobeused != null) - tobeused.stackSize --; + input.stackSize--; + if (tobeused != null) tobeused.stackSize--; this.isValid = true; - } - catch (Exception e){ + } catch (Exception e) { e.printStackTrace(System.err); - } - finally { - if(!cheating) - world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); + } finally { + if (!cheating) world.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0); world.setBlockToAir(xyz[0], xyz[1], xyz[2]); } } - public List<ItemStack> getDrops(){ + public List<ItemStack> getDrops() { return drops; } Map<String, Double> dropprogress = new HashMap<>(); static Map<String, ItemStack> dropstacks = new HashMap<>(); - public List<ItemStack> getIC2Drops(double timeelapsed){ + public List<ItemStack> getIC2Drops(double timeelapsed) { int r = rn.nextInt(10); - if(generations.size() <= r) - return new ArrayList<>(); - double growthPercent = (timeelapsed / (double)growthticks); + if (generations.size() <= r) return new ArrayList<>(); + double growthPercent = (timeelapsed / (double) growthticks); List<ItemStack> generation = generations.get(r); List<ItemStack> copied = new ArrayList<>(); - for(ItemStack g : generation) - copied.add(g.copy()); - for(ItemStack s : copied) - { - double pro = ((double)s.stackSize * growthPercent); + for (ItemStack g : generation) copied.add(g.copy()); + for (ItemStack s : copied) { + double pro = ((double) s.stackSize * growthPercent); s.stackSize = 1; - if(dropprogress.containsKey(s.toString())) + if (dropprogress.containsKey(s.toString())) dropprogress.put(s.toString(), dropprogress.get(s.toString()) + pro); - else - dropprogress.put(s.toString(), pro); - if(!dropstacks.containsKey(s.toString())) - dropstacks.put(s.toString(), s.copy()); + else dropprogress.put(s.toString(), pro); + if (!dropstacks.containsKey(s.toString())) dropstacks.put(s.toString(), s.copy()); } copied.clear(); - for(Map.Entry<String, Double> entry : dropprogress.entrySet()) - if(entry.getValue() >= 1d) - { + for (Map.Entry<String, Double> entry : dropprogress.entrySet()) + if (entry.getValue() >= 1d) { copied.add(dropstacks.get(entry.getKey()).copy()); - copied.get(copied.size()-1).stackSize = entry.getValue().intValue(); - entry.setValue(entry.getValue() - (double)entry.getValue().intValue()); + copied.get(copied.size() - 1).stackSize = entry.getValue().intValue(); + entry.setValue(entry.getValue() - (double) entry.getValue().intValue()); } return copied; } - public int addDrops(World world, int count, boolean autocraft){ + public int addDrops(World world, int count, boolean autocraft) { drops = new ArrayList<>(); - for(int i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { List<ItemStack> d = crop.getDrops(world, 0, 0, 0, optimalgrowth, 0); - for(ItemStack x : drops) - for(ItemStack y : d) - if(GT_Utility.areStacksEqual(x, y)) - { + for (ItemStack x : drops) + for (ItemStack y : d) + if (GT_Utility.areStacksEqual(x, y)) { x.stackSize += y.stackSize; y.stackSize = 0; } - for(ItemStack x : d) - if(x.stackSize > 0) - drops.add(x.copy()); + for (ItemStack x : d) if (x.stackSize > 0) drops.add(x.copy()); } - if(!needsreplanting) - return 0; - for(int i = 0; i < drops.size(); i++) - { - if(GT_Utility.areStacksEqual(drops.get(i), input)) - { + if (!needsreplanting) return 0; + for (int i = 0; i < drops.size(); i++) { + if (GT_Utility.areStacksEqual(drops.get(i), input)) { int took = Math.min(drops.get(i).stackSize, count); drops.get(i).stackSize -= took; count -= took; - if(drops.get(i).stackSize == 0) { + if (drops.get(i).stackSize == 0) { drops.remove(i); i--; } - if(count == 0) { + if (count == 0) { return 0; } } } - if(autocraft) - { - if(!findCropRecipe(world)) - return count; + if (autocraft) { + if (!findCropRecipe(world)) return count; int totake = count / recipe.getCraftingResult(this).stackSize + 1; - for(int i = 0; i < drops.size(); i++) { - if(GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { + for (int i = 0; i < drops.size(); i++) { + if (GT_Utility.areStacksEqual(drops.get(i), recipeInput)) { int took = Math.min(drops.get(i).stackSize, totake); drops.get(i).stackSize -= took; totake -= took; @@ -895,7 +889,7 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity drops.remove(i); i--; } - if(totake == 0) { + if (totake == 0) { return 0; } } @@ -907,9 +901,10 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity private static class GreenHouseWorld extends GT_DummyWorld { - public int x = 0,y = 0,z = 0,meta = 0; + public int x = 0, y = 0, z = 0, meta = 0; public Block block; - GreenHouseWorld(int x, int y, int z){ + + GreenHouseWorld(int x, int y, int z) { super(); this.x = x; this.y = y; @@ -919,15 +914,13 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public int getBlockMetadata(int aX, int aY, int aZ) { - if(aX == x && aY == y && aZ == z) - return 7; + if (aX == x && aY == y && aZ == z) return 7; return 0; } @Override public Block getBlock(int aX, int aY, int aZ) { - if(aY == y - 1) - return Blocks.farmland; + if (aY == y - 1) return Blocks.farmland; return Blocks.air; } @@ -938,21 +931,18 @@ public class GT_TileEntity_ExtremeIndustrialGreenhouse extends GT_MetaTileEntity @Override public boolean setBlock(int aX, int aY, int aZ, Block aBlock, int aMeta, int aFlags) { - if(aBlock == Blocks.air) - return false; - if(aX == x && aY == y && aZ == z) - return false; + if (aBlock == Blocks.air) return false; + if (aX == x && aY == y && aZ == z) return false; block = aBlock; meta = aMeta; return true; } } - private static class GreenHouseRandom extends Random{ + private static class GreenHouseRandom extends Random { @Override public int nextInt(int bound) { return 0; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java index 5461751c79..6344ed5e6f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -44,66 +48,201 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.render.TextureFactory; import gregtech.api.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_VIA_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_HTGR> { private static final int BASECASINGINDEX = 181; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_HTGR> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_HTGR>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" BBBBBBB "," BBBBBBBBB ","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB"," BBBBBBBBB "," BBBBBBB "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, - })) - .addElement('c', - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings8, 5)) - ) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings8, 5)) - )) - .addElement('B', ofChain( - ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings8, 5)) - )) - //ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings8, 5)) - .build(); + private static final IStructureDefinition<GT_TileEntity_HTGR> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_HTGR>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " BBBBBBB ", + " BBBBBBBBB ", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + " BBBBBBBBB ", + " BBBBBBB " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " bbb~bbb ", + " bbbbbbbbb ", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + " bbbbbbbbb ", + " bbbbbbb " + }, + })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_HTGR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings8, 5)))) + // ofHatchAdderOptional(GT_TileEntity_HTGR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings8, 5)) + .build(); private static final int HELIUM_NEEDED = 730000; private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6); private static final int maxcapacity = 720000; - private static final int mincapacity = maxcapacity/10; + private static final int mincapacity = maxcapacity / 10; private int HeliumSupply; private int fueltype = -1, fuelsupply = 0; private boolean empty; @@ -137,8 +276,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 72k Fuel pebbles to start operation (can hold up to 720k pebbles)") .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") - .addInfo("Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") + .addInfo( + "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo( + "Reactor will take 4 000L/s of coolant multiplied by efficiency and by fuel coolant value (check tooltips)") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") .addInfo("One Operation takes 1 hour") .addSeparator() @@ -169,16 +310,14 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return ( - checkPiece("main", 5, 11, 0) && - this.mCasing >= 500 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mOutputHatches.size() > 0 && - this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 && - this.mEnergyHatches.size() > 0 - ); + return (checkPiece("main", 5, 11, 0) + && this.mCasing >= 500 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mOutputHatches.size() > 0 + && this.mInputBusses.size() > 0 + && this.mOutputBusses.size() > 0 + && this.mEnergyHatches.size() > 0); } @Override @@ -204,30 +343,29 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide() && !this.empty){ - if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED){ - for (FluidStack fluidStack : this.getStoredFluids()){ + if (aBaseMetaTileEntity.isServerSide() && !this.empty) { + if (this.HeliumSupply < GT_TileEntity_HTGR.HELIUM_NEEDED) { + for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { int toget = Math.min(GT_TileEntity_HTGR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); fluidStack.amount -= toget; this.HeliumSupply += toget; - if(GT_TileEntity_HTGR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + if (GT_TileEntity_HTGR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) fluidStack = null; } } } - if(this.fuelsupply < maxcapacity){ + if (this.fuelsupply < maxcapacity) { for (ItemStack itemStack : this.getStoredInputs()) { int type = -1; - if(itemStack == null) continue; - if(itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; + if (itemStack == null) continue; + if (itemStack.getItem() != HTGRMaterials.aHTGR_Materials) continue; int damage = HTGRMaterials.aHTGR_Materials.getDamage(itemStack); - if(!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1)) continue; // is fuel + if (!((damage + 1) % HTGRMaterials.MATERIALS_PER_FUEL == HTGRMaterials.USABLE_FUEL_INDEX + 1)) + continue; // is fuel type = damage / HTGRMaterials.MATERIALS_PER_FUEL; - if(this.fueltype == -1) - this.fueltype = type; - if(this.fueltype != type) - continue; + if (this.fueltype == -1) this.fueltype = type; + if (this.fueltype != type) continue; int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); this.fuelsupply += toget; itemStack.stackSize -= toget; @@ -240,29 +378,26 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkRecipe(ItemStack controllerStack) { - if(this.empty) - { - if(this.HeliumSupply > 0 || this.fuelsupply > 0){ + if (this.empty) { + if (this.HeliumSupply > 0 || this.fuelsupply > 0) { this.mEfficiency = 10000; this.mMaxProgresstime = 100; return true; } return false; } - if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) - return false; + if (!(this.HeliumSupply >= GT_TileEntity_HTGR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; - double eff = Math.min(Math.pow((double)this.fuelsupply/(double)mincapacity, 2D), 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); + double eff = Math.min(Math.pow((double) this.fuelsupply / (double) mincapacity, 2D), 100D) / 100D + - ((double) (getIdealStatus() - getRepairStatus()) / 10D); - if(eff <= 0) - return false; + if (eff <= 0) return false; - int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); + int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); this.fuelsupply -= toReduce; - int burnedballs = toReduce/64; - if(burnedballs > 0) - toReduce -= burnedballs*64; + int burnedballs = toReduce / 64; + if (burnedballs > 0) toReduce -= burnedballs * 64; int meta = (this.fueltype * HTGRMaterials.MATERIALS_PER_FUEL) + HTGRMaterials.BURNED_OUT_FUEL_INDEX; @@ -271,13 +406,13 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase new ItemStack(HTGRMaterials.aHTGR_Materials, toReduce, meta + 1) }; - //this.updateSlots(); // not needed ? + // this.updateSlots(); // not needed ? - this.coolanttaking = (int)(4000D * (((this.fueltype * 0.5D) + 1)) * eff); + this.coolanttaking = (int) (4000D * (((this.fueltype * 0.5D) + 1)) * eff); - this.mEfficiency = (int)(eff*10000D); - this.mEUt=-powerUsage; - this.mMaxProgresstime=72000; + this.mEfficiency = (int) (eff * 10000D); + this.mEUt = -powerUsage; + this.mMaxProgresstime = 72000; return true; } @@ -287,32 +422,35 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase public boolean onRunningTick(ItemStack aStack) { runningtick++; - if (this.empty){ - if(emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0){ + if (this.empty) { + if (emptyticksnodiff > 20 && emptyticksnodiff % 20 != 0) { emptyticksnodiff++; return true; } - if(this.HeliumSupply > 0){ + if (this.HeliumSupply > 0) { this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); this.HeliumSupply = 0; } - if(this.fuelsupply > 0) - { - ItemStack iStack = new ItemStack(HTGRMaterials.aHTGR_Materials, this.fuelsupply, (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX); + if (this.fuelsupply > 0) { + ItemStack iStack = new ItemStack( + HTGRMaterials.aHTGR_Materials, + this.fuelsupply, + (HTGRMaterials.MATERIALS_PER_FUEL * this.fueltype) + HTGRMaterials.USABLE_FUEL_INDEX); boolean storedAll = false; for (GT_MetaTileEntity_Hatch_OutputBus tHatch : this.mOutputBusses) { - if(!isValidMetaTileEntity(tHatch)) - continue; - if (tHatch.storeAll(iStack)){ + if (!isValidMetaTileEntity(tHatch)) continue; + if (tHatch.storeAll(iStack)) { storedAll = true; break; } } - if(!storedAll){ - if(this.fuelsupply == iStack.stackSize) emptyticksnodiff++; - else {this.fuelsupply = iStack.stackSize; emptyticksnodiff = 0;} - } - else{ + if (!storedAll) { + if (this.fuelsupply == iStack.stackSize) emptyticksnodiff++; + else { + this.fuelsupply = iStack.stackSize; + emptyticksnodiff = 0; + } + } else { this.fuelsupply = 0; this.fueltype = -1; this.coolanttaking = 0; @@ -321,41 +459,35 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return true; } - if(!super.onRunningTick(aStack)) // USE DA POWAH - return false; + if (!super.onRunningTick(aStack)) // USE DA POWAH + return false; - if(runningtick % 20 == 0) - { + if (runningtick % 20 == 0) { int takecoolant = coolanttaking; int drainedamount = 0; - for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { if (isValidMetaTileEntity(tHatch)) { FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { FluidStack drained = tHatch.drain(takecoolant, true); takecoolant -= drained.amount; drainedamount += drained.amount; - if(takecoolant <= 0) - break; + if (takecoolant <= 0) break; } } } - if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); - if(takecoolant > 0) - this.stopMachine(); + if (takecoolant > 0) this.stopMachine(); } return true; } - - @Override public int getMaxEfficiency(ItemStack itemStack) { return 10000; @@ -381,113 +513,155 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase return new GT_TileEntity_HTGR(this.mName); } - @Override public String[] getInfoData() { - return new String[]{ - "Mode:", this.empty ? "Emptying" : "Normal", - "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", - "Fuel type:", (this.fueltype == -1 ? "NONE" : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), - "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", - "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", - "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + return new String[] { + "Mode:", this.empty ? "Emptying" : "Normal", + "Progress:", + GT_Utility.formatNumbers(this.mProgresstime / 20) + "s / " + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "s", + "Fuel type:", + (this.fueltype == -1 + ? "NONE" + : ("TRISO (" + HTGRMaterials.sHTGR_Fuel[this.fueltype].sEnglish) + ")"), + "Fuel amount:", GT_Utility.formatNumbers(this.fuelsupply) + " pcs.", + "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_HTGR.HELIUM_NEEDED) + "L", + "Coolant:", GT_Utility.formatNumbers(coolanttaking) + "L/s", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_HTGR.BASECASINGINDEX)}; } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(this.mMaxProgresstime > 0) - { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "HTGR mode cannot be changed while the machine is running."); return; } this.empty = !this.empty; - GT_Utility.sendChatToPlayer(aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + GT_Utility.sendChatToPlayer( + aPlayer, "HTGR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } + public static class HTGRMaterials { - - public static class HTGRMaterials{ - - private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass{ + private static class CustomHTGRSimpleSubItemClass extends SimpleSubItemClass { HashMap<Integer, String> tooltip = null; - public CustomHTGRSimpleSubItemClass(HashMap<Integer, String> tooltip, String... tex){ + + public CustomHTGRSimpleSubItemClass(HashMap<Integer, String> tooltip, String... tex) { super(tex); this.tooltip = tooltip; } + @Override @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - if(tooltip.containsKey(getDamage(p_77624_1_))) - aList.add(tooltip.get(getDamage(p_77624_1_))); + if (tooltip.containsKey(getDamage(p_77624_1_))) aList.add(tooltip.get(getDamage(p_77624_1_))); aList.add("Material for High Temperature Gas-cooled Reactor"); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); } } - private static class Base_{ + private static class Base_ { public String sName; public String sEnglish; public String sTooltip; - public Base_(String a, String b){ + + public Base_(String a, String b) { this.sName = a; this.sEnglish = b; this.sTooltip = ""; } - public Base_(String a, String b, String c){ + + public Base_(String a, String b, String c) { this.sName = a; this.sEnglish = b; this.sTooltip = c; } } - static class Fuel_{ + + static class Fuel_ { public String sName; public String sEnglish; public ItemStack mainItem; public ItemStack secondaryItem; - public ItemStack[] recycledItems = { GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI }; + public ItemStack[] recycledItems = { + GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI + }; public FluidStack recycledFluid; public int[] recycleChances; public String tooltip; - public Fuel_(String sName, String sEnglish, ItemStack mainItem, ItemStack secondaryItem, FluidStack recycledFluid, ItemStack[] recycledItems, int[] recycleChances, String tooltip){ + + public Fuel_( + String sName, + String sEnglish, + ItemStack mainItem, + ItemStack secondaryItem, + FluidStack recycledFluid, + ItemStack[] recycledItems, + int[] recycleChances, + String tooltip) { this.sName = sName; this.sEnglish = sEnglish; this.mainItem = mainItem; this.secondaryItem = secondaryItem; this.recycledFluid = recycledFluid; - for(int i = 0; i < recycledItems.length; i++) - this.recycledItems[i] = recycledItems[i]; + for (int i = 0; i < recycledItems.length; i++) this.recycledItems[i] = recycledItems[i]; this.recycleChances = recycleChances; this.tooltip = tooltip; } } - private static class LangEntry_{ + + private static class LangEntry_ { public String sName; public String sEnglish; - public LangEntry_(String a, String b){ + + public LangEntry_(String a, String b) { this.sName = a; this.sEnglish = b; } } - static final Base_[] sHTGR_Bases = new Base_[]{ + static final Base_[] sHTGR_Bases = new Base_[] { new Base_("HTGRFuelMixture", "HTGR fuel mixture"), new Base_("BISOPebbleCompound", "BISO pebble compound"), new Base_("TRISOPebbleCompound", "TRISO pebble compound"), @@ -499,71 +673,152 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase static final int MATERIALS_PER_FUEL = sHTGR_Bases.length; static final int USABLE_FUEL_INDEX = 4; static final int BURNED_OUT_FUEL_INDEX = 5; - static final Fuel_[] sHTGR_Fuel = new Fuel_[]{ - new Fuel_("Thorium", "Thorium", WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), Materials.Uranium235.getDust(4), - GT_Values.NF, new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), - Materials.Lutetium.getDust(1), WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1)}, - new int[]{9000, 9000, 9000, 9000, 1000}, "Multiplies coolant by 1"), - new Fuel_("Uranium", "Uranium", Materials.Uranium.getDust(64), Materials.Uranium235.getDust(8), - FluidRegistry.getFluidStack("krypton", 8), new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), - Materials.Lead.getDust(1), - Materials.Uranium.getDust(1)}, - new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 1.5"), - new Fuel_("Plutonium", "Plutonium", Materials.Plutonium.getDust(64), Materials.Plutonium241.getDust(4), - FluidRegistry.getFluidStack("xenon", 8), new ItemStack[]{ - Materials.Silicon.getDust(1), Materials.Graphite.getDust(1), Materials.Carbon.getDust(1), - Materials.Lead.getDust(1), - Materials.Plutonium.getDust(1)}, - new int[]{9000, 9000, 9000, 7000, 1000}, "Multiplies coolant by 2"), + static final Fuel_[] sHTGR_Fuel = new Fuel_[] { + new Fuel_( + "Thorium", + "Thorium", + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 64), + Materials.Uranium235.getDust(4), + GT_Values.NF, + new ItemStack[] { + Materials.Silicon.getDust(1), + Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), + Materials.Lutetium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1) + }, + new int[] {9000, 9000, 9000, 9000, 1000}, + "Multiplies coolant by 1"), + new Fuel_( + "Uranium", + "Uranium", + Materials.Uranium.getDust(64), + Materials.Uranium235.getDust(8), + FluidRegistry.getFluidStack("krypton", 8), + new ItemStack[] { + Materials.Silicon.getDust(1), + Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), + Materials.Lead.getDust(1), + Materials.Uranium.getDust(1) + }, + new int[] {9000, 9000, 9000, 7000, 1000}, + "Multiplies coolant by 1.5"), + new Fuel_( + "Plutonium", + "Plutonium", + Materials.Plutonium.getDust(64), + Materials.Plutonium241.getDust(4), + FluidRegistry.getFluidStack("xenon", 8), + new ItemStack[] { + Materials.Silicon.getDust(1), + Materials.Graphite.getDust(1), + Materials.Carbon.getDust(1), + Materials.Lead.getDust(1), + Materials.Plutonium.getDust(1) + }, + new int[] {9000, 9000, 9000, 7000, 1000}, + "Multiplies coolant by 2"), }; static final CustomHTGRSimpleSubItemClass aHTGR_Materials; static final ArrayList<LangEntry_> aHTGR_Localizations = new ArrayList<LangEntry_>(); - static{ - String[] sHTGR_Materials = new String[sHTGR_Bases.length*sHTGR_Fuel.length]; + + static { + String[] sHTGR_Materials = new String[sHTGR_Bases.length * sHTGR_Fuel.length]; HashMap<Integer, String> tooltip = new HashMap<Integer, String>(); int i = 0; - for(Fuel_ fuel : sHTGR_Fuel) - for(Base_ base : sHTGR_Bases) - { + for (Fuel_ fuel : sHTGR_Fuel) + for (Base_ base : sHTGR_Bases) { sHTGR_Materials[i] = "HTGR" + base.sName + fuel.sName; - aHTGR_Localizations.add(new LangEntry_("item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); - if(((i+1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) && fuel.tooltip != null && fuel.tooltip != "") - tooltip.put(i, fuel.tooltip); + aHTGR_Localizations.add(new LangEntry_( + "item." + sHTGR_Materials[i] + ".name", base.sEnglish + " (" + fuel.sEnglish + ")")); + if (((i + 1) % MATERIALS_PER_FUEL == (USABLE_FUEL_INDEX + 1)) + && fuel.tooltip != null + && fuel.tooltip != "") tooltip.put(i, fuel.tooltip); i++; } aHTGR_Materials = new CustomHTGRSimpleSubItemClass(tooltip, sHTGR_Materials); } - - public static void registeraTHR_Materials(){ - for(LangEntry_ iName : aHTGR_Localizations) + public static void registeraTHR_Materials() { + for (LangEntry_ iName : aHTGR_Localizations) GT_LanguageManager.addStringLocalization(iName.sName, iName.sEnglish); - GameRegistry.registerItem(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials,"bw.HTGRMaterials"); + GameRegistry.registerItem(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, "bw.HTGRMaterials"); } - public static void registerTHR_Recipes(){ - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - new ItemStack(GregTech_API.sBlockCasings3,1,12), - GT_OreDictUnificator.get(OrePrefixes.plate,Materials.Europium,6), - GT_OreDictUnificator.get(OrePrefixes.screw,Materials.Europium,24) + public static void registerTHR_Recipes() { + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), + GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Europium, 6), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Europium, 24) }, Materials.Lead.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings8,1,5), + new ItemStack(GregTech_API.sBlockCasings8, 1, 5), 200, - BW_Util.getMachineVoltageFromTier(6) - ); + BW_Util.getMachineVoltageFromTier(6)); int i = 0; - for(Fuel_ fuel : sHTGR_Fuel){ - GT_Values.RA.addMixerRecipe(fuel.mainItem, fuel.secondaryItem ,GT_Utility.getIntegratedCircuit(1),null,null,null,new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), Materials.Carbon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3),40,30); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, null, null, null, null, 32000, 30, 0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, null, null, null, null,48000,30,0); + for (Fuel_ fuel : sHTGR_Fuel) { + GT_Values.RA.addMixerRecipe( + fuel.mainItem, + fuel.secondaryItem, + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + 400, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i), + Materials.Carbon.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 1), + Materials.Silicon.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 2), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + 40, + 30); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 3), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 4)}, + null, + null, + null, + null, + 32000, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 5), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 64, i + 6)}, + null, + null, + null, + null, + 48000, + 30, + 0); GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), GT_Values.NI, GT_Values.NF, + new ItemStack(GT_TileEntity_HTGR.HTGRMaterials.aHTGR_Materials, 1, i + 6), + GT_Values.NI, + GT_Values.NF, fuel.recycledFluid, fuel.recycledItems[0], fuel.recycledItems[1], @@ -572,10 +827,10 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase fuel.recycledItems[4], fuel.recycledItems[5], fuel.recycleChances, - 1200, 30); + 1200, + 30); i += sHTGR_Bases.length; } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 84837e8760..366b6cc81b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -42,6 +42,8 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collections; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -52,13 +54,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.Collections; - - public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { - private static final byte TEXID_SIDE = 0; private static final byte TEXID_CHARGING = 1; private static final byte TEXID_IDLE = 2; @@ -79,7 +76,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { super(aName); } - @Override public boolean isEnetOutput() { return true; @@ -99,7 +95,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public long maxAmperesIn() { int ret = 0; for (int i = 0; i < 5; ++i) - if (this.circuits[i] != null && this.circuits[i].getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) + if (this.circuits[i] != null + && this.circuits[i] + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem())) ret += this.circuits[i].getItemDamage(); return ret > 0 ? ret : 1; } @@ -158,9 +157,11 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public String[] getDescription() { ArrayList<String> e = new ArrayList<>(); - String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); + String[] dsc = + StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); Collections.addAll(e, dsc); - e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU"); + e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + + GT_Utility.formatNumbers(ConfigHandler.energyPerCell) + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); @@ -191,7 +192,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } }; } - } @Override @@ -206,31 +206,36 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public boolean isClientSide() { if (this.getWorld() != null) - return this.getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return this.getWorld().isRemote + ? FMLCommonHandler.instance().getSide() == Side.CLIENT + : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } - @Override @SuppressWarnings("ALL") - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] ret = new ITexture[0]; if (this.isClientSide()) { for (int i = 0; i < GT_TileEntity_LESU.iTextures.length; i++) { - GT_TileEntity_LESU.iTextures[i][0] = TextureFactory.of(GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); + GT_TileEntity_LESU.iTextures[i][0] = TextureFactory.of( + GT_TileEntity_LESU.iIconContainers[i], Dyes.getModulation(0, Dyes.MACHINE_METAL.mRGBa)); } if (aSide == aFacing && this.getBaseMetaTileEntity().getUniversalEnergyStored() <= 0) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_EMPTY]; - else if (aSide == aFacing && !aActive) - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; - else if (aSide == aFacing && aActive) - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; - else - ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; + else if (aSide == aFacing && !aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_IDLE]; + else if (aSide == aFacing && aActive) ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_CHARGING]; + else ret = GT_TileEntity_LESU.iTextures[GT_TileEntity_LESU.TEXID_SIDE]; } return ret; @@ -253,17 +258,14 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override public ItemStack getStackInSlot(int p_70301_1_) { - if (p_70301_1_ > 1) - return this.circuits[(p_70301_1_ - 2)]; + if (p_70301_1_ > 1) return this.circuits[(p_70301_1_ - 2)]; return this.mInventory[p_70301_1_]; } @Override public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ < 2) - this.mInventory[p_70299_1_] = p_70299_2_; - else - this.circuits[(p_70299_1_ - 2)] = p_70299_2_; + if (p_70299_1_ < 2) this.mInventory[p_70299_1_] = p_70299_2_; + else this.circuits[(p_70299_1_ - 2)] = p_70299_2_; } @Override @@ -294,7 +296,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { case 1: return true; default: - return p_94041_2_ != null && p_94041_2_.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return p_94041_2_ != null + && p_94041_2_ + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } @@ -328,8 +333,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { this.mMaxProgresstime = 1; - if (aTick % 20 == 0) - this.checkMachine(aBaseMetaTileEntity, null); + if (aTick % 20 == 0) this.checkMachine(aBaseMetaTileEntity, null); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; @@ -369,9 +373,20 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { long startingTime = System.nanoTime(); this.connectedcells = new ConnectedBlocksChecker(); - this.connectedcells.get_connected(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord(), ItemRegistry.BW_BLOCKS[1]); - - if (this.connectedcells.get_meta_of_sideblocks(aBaseMetaTileEntity.getWorld(), this.getBaseMetaTileEntity().getMetaTileID(), new int[]{aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()}, true)) { + this.connectedcells.get_connected( + aBaseMetaTileEntity.getWorld(), + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord(), + ItemRegistry.BW_BLOCKS[1]); + + if (this.connectedcells.get_meta_of_sideblocks( + aBaseMetaTileEntity.getWorld(), + this.getBaseMetaTileEntity().getMetaTileID(), + new int[] { + aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() + }, + true)) { this.getBaseMetaTileEntity().disableWorking(); this.getBaseMetaTileEntity().setActive(false); this.mStorage = 0; @@ -381,7 +396,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { } this.mEfficiency = this.getMaxEfficiency(null); - this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) ? Long.MAX_VALUE - 1 : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); + this.mStorage = (ConfigHandler.energyPerCell * this.connectedcells.hashset.size() >= Long.MAX_VALUE - 1 + || ConfigHandler.energyPerCell * this.connectedcells.hashset.size() < 0) + ? Long.MAX_VALUE - 1 + : ConfigHandler.energyPerCell * this.connectedcells.hashset.size(); this.mMaxProgresstime = 1; this.mProgresstime = 0; @@ -396,9 +414,15 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.getBaseMetaTileEntity().setActive(true); long finishedTime = System.nanoTime(); - //System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); + // System.out.println("LESU LookUp: "+((finishedTime - startingTime) / 1000000)+"ms"); if (finishedTime - startingTime > 5000000) - MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + ((finishedTime - startingTime) / 1000000) + "ms) Owner:"+this.getBaseMetaTileEntity().getOwnerName()+" Check at x:" + this.getBaseMetaTileEntity().getXCoord() + " y:" + this.getBaseMetaTileEntity().getYCoord() + " z:" + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); + MainMod.LOGGER.warn("LESU LookUp took longer than 5ms!(" + (finishedTime - startingTime) + "ns / " + + ((finishedTime - startingTime) / 1000000) + "ms) Owner:" + + this.getBaseMetaTileEntity().getOwnerName() + " Check at x:" + + this.getBaseMetaTileEntity().getXCoord() + " y:" + + this.getBaseMetaTileEntity().getYCoord() + " z:" + + this.getBaseMetaTileEntity().getZCoord() + " DIM-ID: " + + this.getBaseMetaTileEntity().getWorld().provider.dimensionId); return true; } @@ -425,5 +449,4 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public World getWorld() { return this.getBaseMetaTileEntity().getWorld(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index adfad9bcc6..38736f5849 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -22,6 +22,14 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElementNoPlacement; @@ -43,14 +51,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import static com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry.BW_BLOCKS; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; - public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_ManualTrafo> { private byte mode; @@ -70,58 +70,61 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl private static final String STRUCTURE_PIECE_LAYER = "layer"; private static final String STRUCTURE_PIECE_TOP = "top"; private static final String STRUCTURE_PIECE_TAP_LAYER = "taplayer"; - private static final IStructureDefinition<GT_TileEntity_ManualTrafo> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_ManualTrafo>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ - {"b~b", "bbb", "bbb"} - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ - {"ttt", "tft", "ttt"} - })) - .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][]{ - {"ooo", "ooo", "ooo"} - })) - .addShape(STRUCTURE_PIECE_TAP_LAYER, transpose(new String[][]{ - {" TTT ", "TtttT", "TtftT", "TtttT", " TTT "} - })) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), - ofHatchAdder(GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), - ofBlock(GregTech_API.sBlockCasings1, 2) - )) - .addElement('o', ofHatchAdderOptional(GT_TileEntity_ManualTrafo::addDynamoToMachineList, CASING_INDEX, 2, GregTech_API.sBlockCasings1, 2)) - .addElement('t', ofBlock(BW_BLOCKS[2], 1)) - .addElement('f', ofBlock(BW_BLOCKS[2], 0)) - .addElement('T', new IStructureElementNoPlacement<GT_TileEntity_ManualTrafo>() { - @Override - public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { - if(world.isAirBlock(x, y, z)) - return true; - TileEntity tileEntity = world.getTileEntity(x, y, z); - if(tileEntity == null) - return true; - if(!(tileEntity instanceof IGregTechTileEntity)) - return true; - IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); - if(mte instanceof GT_MetaTileEntity_Hatch_Dynamo || mte instanceof GT_MetaTileEntity_Hatch_Energy) { - int intier = te.mEnergyHatches.get(0).mTier; - if(((GT_MetaTileEntity_TieredMachineBlock) mte).mTier == intier + (te.upstep ? te.mTiers : -te.mTiers)){ - te.addToMachineList((IGregTechTileEntity)tileEntity, CASING_INDEX); + private static final IStructureDefinition<GT_TileEntity_ManualTrafo> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_ManualTrafo>builder() + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] {{"b~b", "bbb", "bbb"}})) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"ttt", "tft", "ttt"}})) + .addShape(STRUCTURE_PIECE_TOP, transpose(new String[][] {{"ooo", "ooo", "ooo"}})) + .addShape( + STRUCTURE_PIECE_TAP_LAYER, + transpose(new String[][] {{" TTT ", "TtttT", "TtftT", "TtttT", " TTT "}})) + .addElement( + 'b', + ofChain( + ofHatchAdder( + GT_TileEntity_ManualTrafo::addEnergyInputToMachineList, CASING_INDEX, 1), + ofHatchAdder( + GT_TileEntity_ManualTrafo::addMaintenanceToMachineList, CASING_INDEX, 1), + ofBlock(GregTech_API.sBlockCasings1, 2))) + .addElement( + 'o', + ofHatchAdderOptional( + GT_TileEntity_ManualTrafo::addDynamoToMachineList, + CASING_INDEX, + 2, + GregTech_API.sBlockCasings1, + 2)) + .addElement('t', ofBlock(BW_BLOCKS[2], 1)) + .addElement('f', ofBlock(BW_BLOCKS[2], 0)) + .addElement('T', new IStructureElementNoPlacement<GT_TileEntity_ManualTrafo>() { + @Override + public boolean check(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z) { + if (world.isAirBlock(x, y, z)) return true; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity == null) return true; + if (!(tileEntity instanceof IGregTechTileEntity)) return true; + IMetaTileEntity mte = ((IGregTechTileEntity) tileEntity).getMetaTileEntity(); + if (mte instanceof GT_MetaTileEntity_Hatch_Dynamo + || mte instanceof GT_MetaTileEntity_Hatch_Energy) { + int intier = te.mEnergyHatches.get(0).mTier; + if (((GT_MetaTileEntity_TieredMachineBlock) mte).mTier + == intier + (te.upstep ? te.mTiers : -te.mTiers)) { + te.addToMachineList((IGregTechTileEntity) tileEntity, CASING_INDEX); + return true; + } else return false; + } return true; } - else - return false; - } - return true; - } - - @Override - public boolean spawnHint(GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); - return true; - } - } - ) - .build(); + + @Override + public boolean spawnHint( + GT_TileEntity_ManualTrafo te, World world, int x, int y, int z, ItemStack itemStack) { + StructureLibAPI.hintParticle( + world, x, y, z, StructureLibAPI.getBlockHint(), 2 /* aDots: 3 */); + return true; + } + }) + .build(); @Override public IStructureDefinition<GT_TileEntity_ManualTrafo> getStructureDefinition() { @@ -132,26 +135,26 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Transformer") - .addInfo("Controller block for the Manual Trafo") - .addInfo("Operates in 4 diffrent modes:") - .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") - .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") - .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") - .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") - .addSeparator() - .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) - .addController("Front bottom center") - .addCasingInfo("MV Machine Casing", 0) - .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") - .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") - .addMaintenanceHatch("Any bottom layer casing", 1) - .addEnergyHatch("Any bottom layer casing", 1) - .addDynamoHatch("Any top layer casing", 2) - .addStructureInfo("---------TAPPED MODE---------") - .addEnergyHatch("Touching Transformer-Winding Blocks", 3) - .addDynamoHatch("Touching Transformer-Winding Blocks", 3) - .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") - .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + .addInfo("Controller block for the Manual Trafo") + .addInfo("Operates in 4 diffrent modes:") + .addInfo("Mode 1: Circuit 0 in controller: Direct-Upstep") + .addInfo("Mode 2: Circuit 1 in controller: Direct-Downstep") + .addInfo("Mode 3: Circuit 2 in controller: Tapped-Upstep (currently disabled)") + .addInfo("Mode 4: Circuit 2 in controller: Tapped-Downstep (currently disabled)") + .addSeparator() + .beginVariableStructureBlock(3, 3, 3, 10, 3, 3, false) + .addController("Front bottom center") + .addCasingInfo("MV Machine Casing", 0) + .addOtherStructurePart("Transformer-Winding Blocks", "1 Layer for each tier transformed") + .addOtherStructurePart("Nickel-Zinc-Ferrite Blocks", "Middle of Transformer-Winding Blocks") + .addMaintenanceHatch("Any bottom layer casing", 1) + .addEnergyHatch("Any bottom layer casing", 1) + .addDynamoHatch("Any top layer casing", 2) + .addStructureInfo("---------TAPPED MODE---------") + .addEnergyHatch("Touching Transformer-Winding Blocks", 3) + .addDynamoHatch("Touching Transformer-Winding Blocks", 3) + .addStructureInfo("Hatches touching Transformer-Winding Blocks must be tiered from bottom to top") + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -162,8 +165,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if (!this.getBaseMetaTileEntity().isAllowedToWork()) - this.stopMachine(); + if (!this.getBaseMetaTileEntity().isAllowedToWork()) this.stopMachine(); super.onPostTick(aBaseMetaTileEntity, aTick); } @@ -178,16 +180,19 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.mMaxProgresstime = 1; if (this.getBaseMetaTileEntity().getTimer() % 40 == 0) - if (this.mEfficiency < this.getMaxEfficiency(null)) - this.mEfficiency += 100; - else - this.mEfficiency = this.getMaxEfficiency(null); + if (this.mEfficiency < this.getMaxEfficiency(null)) this.mEfficiency += 100; + else this.mEfficiency = this.getMaxEfficiency(null); if (this.mode > 1) { - return false;//this.onRunningTickTabbedMode(); Tapped mode is disable + return false; // this.onRunningTickTabbedMode(); Tapped mode is disable } - return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null)); + return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) + && this.addEnergyOutput(this.getInputTier() + * 2 + * this.mEnergyHatches.size() + * (long) this.mEfficiency + / this.getMaxEfficiency(null)); } public boolean onRunningTickTabbedMode() { @@ -197,8 +202,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl long vtt = I.getEUVar() >= (V[E.mTier] / 2) && E.getEUVar() < E.maxEUStore() ? I.getEUVar() : 0; - if (vtt == 0) - continue; + if (vtt == 0) continue; long vtp = E.getEUVar() + (vtt); long avt = Math.min(vtp, E.maxEUStore()); @@ -210,16 +214,17 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl return ret; } - public long getInputTier() { if (this.mEnergyHatches.size() > 0) - return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + return GT_Utility.getTier( + this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); else return 0L; } public long getOutputTier() { if (this.mDynamoHatches.size() > 0) - return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + return GT_Utility.getTier( + this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); else return 0L; } @@ -230,61 +235,48 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl this.stopMachine(); return false; } - if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; - else - this.mode = (byte)Math.min(3, itemStack.getItemDamage()); + if (itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + else this.mode = (byte) Math.min(3, itemStack.getItemDamage()); this.upstep = this.mode % 2 == 0; this.mProgresstime = 0; this.mMaxProgresstime = 1; this.mEfficiency = Math.max(this.mEfficiency, 100); - return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mTiers : this.getInputTier() - this.getOutputTier() == this.mTiers; + return this.upstep + ? this.getOutputTier() - this.getInputTier() == this.mTiers + : this.getInputTier() - this.getOutputTier() == this.mTiers; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { - if(itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; - else - this.mode = (byte)Math.min(3, itemStack.getItemDamage()); + if (itemStack == null || !itemStack.getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + else this.mode = (byte) Math.min(3, itemStack.getItemDamage()); this.upstep = this.mode % 2 == 0; boolean tapmode = this.mode > 1; - if(!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) return false; - if(this.mEnergyHatches.size() == 0) - return false; + if (this.mEnergyHatches.size() == 0) return false; byte intier = this.mEnergyHatches.get(0).mTier; - for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) - if (in.mTier != intier) - return false; + for (GT_MetaTileEntity_Hatch_Energy in : this.mEnergyHatches) if (in.mTier != intier) return false; int mHeight; - for(mHeight = 1; mHeight <= 8; mHeight++) { - if(tapmode) - { + for (mHeight = 1; mHeight <= 8; mHeight++) { + if (tapmode) { this.mTiers = mHeight; - if(!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) - break; - } - else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) - break; + if (!checkPiece(STRUCTURE_PIECE_TAP_LAYER, 2, mHeight, 1)) break; + } else if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) break; } - if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_TOP, 1, mHeight, 0)) return false; this.mTiers = mHeight - 1; - if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) - return false; + if (this.mDynamoHatches.size() == 0 || mMaintenanceHatches.size() != 1 || this.mTiers == 0) return false; byte outtier = this.mDynamoHatches.get(0).mTier; for (GT_MetaTileEntity_Hatch_Dynamo out : this.mDynamoHatches) { - if (out.mTier != outtier) - return false; + if (out.mTier != outtier) return false; } return true; @@ -332,35 +324,54 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_EnhancedMultiBl } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override public void construct(ItemStack itemStack, boolean b) { - if(this.mInventory[1] == null || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) - this.mode = 0; - else - this.mode = (byte)Math.min(3, this.mInventory[1].getItemDamage()); + if (this.mInventory[1] == null + || !this.mInventory[1].getUnlocalizedName().startsWith("gt.integrated_circuit")) this.mode = 0; + else this.mode = (byte) Math.min(3, this.mInventory[1].getItemDamage()); int mHeight = Math.min(itemStack.stackSize, 8); boolean tapmode = this.mode > 1; buildPiece(STRUCTURE_PIECE_BASE, itemStack, b, 1, 0, 0); - for(int i = 0; i < mHeight; i++) { - if (tapmode) - buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); - else - buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); + for (int i = 0; i < mHeight; i++) { + if (tapmode) buildPiece(STRUCTURE_PIECE_TAP_LAYER, itemStack, b, 2, i + 1, 1); + else buildPiece(STRUCTURE_PIECE_LAYER, itemStack, b, 1, i + 1, 0); } buildPiece(STRUCTURE_PIECE_TOP, itemStack, b, 1, mHeight + 1, 0); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 1f98de8cb9..7ec2734fd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -45,65 +49,197 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.Arrays; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.Arrays; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_THTR> { private static final int BASECASINGINDEX = 44; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_THTR> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_THTR>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" BBBBBBB "," BBBBBBBBB ","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB","BBBBBBBBBBB"," BBBBBBBBB "," BBBBBBB "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" ccccccc "," c-------c ","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c","c---------c"," c-------c "," ccccccc "}, - {" bbb~bbb "," bbbbbbbbb ","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb","bbbbbbbbbbb"," bbbbbbbbb "," bbbbbbb "}, - })) - .addElement('c', - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings3, 12)) - ) - .addElement('b', ofChain( - ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), - ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings3, 12)) - )) - .addElement('B', ofChain( - ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), - onElementPass( - x -> x.mCasing++, - ofBlock(GregTech_API.sBlockCasings3, 12)) - )) - //ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, GregTech_API.sBlockCasings3, 12)) - .build(); - - - + private static final IStructureDefinition<GT_TileEntity_THTR> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_THTR>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " BBBBBBB ", + " BBBBBBBBB ", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + "BBBBBBBBBBB", + " BBBBBBBBB ", + " BBBBBBB " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " ccccccc ", + " c-------c ", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + "c---------c", + " c-------c ", + " ccccccc " + }, + { + " bbb~bbb ", + " bbbbbbbbb ", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + "bbbbbbbbbbb", + " bbbbbbbbb ", + " bbbbbbb " + }, + })) + .addElement('c', onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12))) + .addElement( + 'b', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addOutputToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addMaintenanceToMachineList, BASECASINGINDEX, 1), + ofHatchAdder(GT_TileEntity_THTR::addEnergyInputToMachineList, BASECASINGINDEX, 1), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + .addElement( + 'B', + ofChain( + ofHatchAdder(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2), + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings3, 12)))) + // ofHatchAdderOptional(GT_TileEntity_THTR::addInputToMachineList, BASECASINGINDEX, 2, + // GregTech_API.sBlockCasings3, 12)) + .build(); private static final int HELIUM_NEEDED = 730000; - private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5)/2; + private static final int powerUsage = BW_Util.getMachineVoltageFromTier(5) / 2; private static final int maxcapacity = 675000; private static final int mincapacity = 100000; private int HeliumSupply; @@ -138,7 +274,8 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase .addInfo("Needs a constant supply of coolant while running") .addInfo("Needs at least 100k Fuel pebbles to start operation (can hold up to 675k pebbles)") .addInfo("Consumes up to 0.5% of total Fuel Pellets per Operation depending on efficiency") - .addInfo("Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") + .addInfo( + "Efficiency is calculated exponentially depending on the amount of pebbles in the internal buffer") .addInfo("Reactor will take 4 800L/t of coolant multiplied by efficiency") .addInfo("Uses " + GT_Utility.formatNumbers(powerUsage) + " EU/t") .addInfo("One Operation takes 9 hour") @@ -170,16 +307,14 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { this.mCasing = 0; - return ( - checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) && - this.mCasing >= 500 && - this.mMaintenanceHatches.size() == 1 && - this.mInputHatches.size() > 0 && - this.mOutputHatches.size() > 0 && - this.mInputBusses.size() > 0 && - this.mOutputBusses.size() > 0 && - this.mEnergyHatches.size() > 0 - ); + return (checkPiece(STRUCTURE_PIECE_MAIN, 5, 11, 0) + && this.mCasing >= 500 + && this.mMaintenanceHatches.size() == 1 + && this.mInputHatches.size() > 0 + && this.mOutputHatches.size() > 0 + && this.mInputBusses.size() > 0 + && this.mOutputBusses.size() > 0 + && this.mEnergyHatches.size() > 0); } @Override @@ -203,23 +338,25 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide() && !this.empty){ - if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED){ - for (FluidStack fluidStack : this.getStoredFluids()){ + if (aBaseMetaTileEntity.isServerSide() && !this.empty) { + if (this.HeliumSupply < GT_TileEntity_THTR.HELIUM_NEEDED) { + for (FluidStack fluidStack : this.getStoredFluids()) { if (fluidStack.isFluidEqual(Materials.Helium.getGas(1))) { int toget = Math.min(GT_TileEntity_THTR.HELIUM_NEEDED - this.HeliumSupply, fluidStack.amount); fluidStack.amount -= toget; this.HeliumSupply += toget; - if(GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) + if (GT_TileEntity_THTR.HELIUM_NEEDED == this.HeliumSupply && fluidStack.amount == 0) fluidStack = null; } } } - if(this.fuelsupply < maxcapacity){ + if (this.fuelsupply < maxcapacity) { for (ItemStack itemStack : this.getStoredInputs()) { - if (GT_Utility.areStacksEqual(itemStack, new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { + if (GT_Utility.areStacksEqual( + itemStack, + new ItemStack(THTRMaterials.aTHTR_Materials, 1, THTRMaterials.MATERIAL_FUEL_INDEX))) { int toget = Math.min(maxcapacity - this.fuelsupply, itemStack.stackSize); - if(toget == 0) continue; + if (toget == 0) continue; itemStack.stackSize -= toget; this.fuelsupply += toget; } @@ -232,28 +369,32 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase @Override public boolean checkRecipe(ItemStack controllerStack) { - if(this.empty) - { - if(this.HeliumSupply > 0 || this.fuelsupply > 0){ + if (this.empty) { + if (this.HeliumSupply > 0 || this.fuelsupply > 0) { this.mEfficiency = 10000; this.mMaxProgresstime = 100; return true; } return false; } - if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) - return false; + if (!(this.HeliumSupply >= GT_TileEntity_THTR.HELIUM_NEEDED && this.fuelsupply >= mincapacity)) return false; - double eff = Math.min(Math.pow((double)(this.fuelsupply - mincapacity)/((maxcapacity-mincapacity)/10D), 2D)+1, 100D)/100D - ((double)(getIdealStatus() - getRepairStatus()) / 10D); - if(eff <= 0D) - return false; + double eff = Math.min( + Math.pow( + (double) (this.fuelsupply - mincapacity) + / ((maxcapacity - mincapacity) / 10D), + 2D) + + 1, + 100D) + / 100D + - ((double) (getIdealStatus() - getRepairStatus()) / 10D); + if (eff <= 0D) return false; - int toReduce = MathUtils.floorInt((double)this.fuelsupply * 0.005D * eff); + int toReduce = MathUtils.floorInt((double) this.fuelsupply * 0.005D * eff); this.fuelsupply -= toReduce; - int burnedballs = toReduce/64; - if(burnedballs > 0) - toReduce -= burnedballs*64; + int burnedballs = toReduce / 64; + if (burnedballs > 0) toReduce -= burnedballs * 64; int meta = THTRMaterials.MATERIAL_USED_FUEL_INDEX; @@ -264,46 +405,44 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase // this.updateSlots(); not needed ? - this.coolanttaking = (int)(4800D * eff); - this.mEfficiency = (int)(eff*10000D); - this.mEUt=-powerUsage; - this.mMaxProgresstime=648000; + this.coolanttaking = (int) (4800D * eff); + this.mEfficiency = (int) (eff * 10000D); + this.mEUt = -powerUsage; + this.mMaxProgresstime = 648000; return true; } @Override public boolean onRunningTick(ItemStack aStack) { - if (this.empty){ + if (this.empty) { this.addOutput(Materials.Helium.getGas(this.HeliumSupply)); - this.addOutput(new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); + this.addOutput( + new ItemStack(THTRMaterials.aTHTR_Materials, this.fuelsupply, THTRMaterials.MATERIAL_FUEL_INDEX)); this.HeliumSupply = 0; this.fuelsupply = 0; this.updateSlots(); return true; } - if(!super.onRunningTick(aStack)) - return false; + if (!super.onRunningTick(aStack)) return false; int takecoolant = coolanttaking; int drainedamount = 0; - for(GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { if (isValidMetaTileEntity(tHatch)) { FluidStack tLiquid = tHatch.getFluid(); - if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant",1))){ + if (tLiquid != null && tLiquid.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1))) { FluidStack drained = tHatch.drain(takecoolant, true); takecoolant -= drained.amount; drainedamount += drained.amount; - if(takecoolant <= 0) - break; + if (takecoolant <= 0) break; } } } - if(drainedamount > 0) - addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); + if (drainedamount > 0) addOutput(FluidRegistry.getFluidStack("ic2hotcoolant", drainedamount)); this.updateSlots(); @@ -335,92 +474,185 @@ public class GT_TileEntity_THTR extends GT_MetaTileEntity_EnhancedMultiBlockBase return new GT_TileEntity_THTR(this.mName); } - @Override public String[] getInfoData() { - return new String[]{ - "Progress:", GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", - "TRISO-Pebbles:", GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) + "psc.", - "Helium-Level:", GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", - "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", - "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) + return new String[] { + "Progress:", + GT_Utility.formatNumbers(this.mProgresstime / 20) + "secs /" + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + "secs", + "TRISO-Pebbles:", + GT_Utility.formatNumbers(this.fuelsupply) + "pcs. / " + GT_Utility.formatNumbers(this.fuelsupply) + + "psc.", + "Helium-Level:", + GT_Utility.formatNumbers(this.HeliumSupply) + "L / " + + GT_Utility.formatNumbers(GT_TileEntity_THTR.HELIUM_NEEDED) + "L", + "Coolant/t:", GT_Utility.formatNumbers(this.mProgresstime == 0 ? 0 : coolanttaking) + "L/t", + "Problems:", String.valueOf(this.getIdealStatus() - this.getRepairStatus()) }; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ - Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER).extFacing().build(), - TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(GT_TileEntity_THTR.BASECASINGINDEX)}; } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if(this.mMaxProgresstime > 0) - { + if (this.mMaxProgresstime > 0) { GT_Utility.sendChatToPlayer(aPlayer, "THTR mode cannot be changed while the machine is running."); return; } this.empty = !this.empty; - GT_Utility.sendChatToPlayer(aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); + GT_Utility.sendChatToPlayer( + aPlayer, "THTR is now running in " + (this.empty ? "emptying mode." : "normal Operation")); } - public static class THTRMaterials{ + public static class THTRMaterials { static final SimpleSubItemClass aTHTR_Materials = new SimpleSubItemClass( - "BISOPelletCompound", // 0 - "BISOPelletBall", // 1 + "BISOPelletCompound", // 0 + "BISOPelletBall", // 1 "TRISOPelletCompound", // 2 - "TRISOPelletBall", // 3 - "TRISOPellet", // 4 + "TRISOPelletBall", // 3 + "TRISOPellet", // 4 "BurnedOutTRISOPelletBall", // 5 "BurnedOutTRISOPellet" // 6 - ); + ); public static final int MATERIAL_FUEL_INDEX = 4; public static final int MATERIAL_USED_FUEL_INDEX = 5; - public static void registeraTHR_Materials(){ - GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); + + public static void registeraTHR_Materials() { + GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, "bw.THTRMaterials"); } - public static void registerTHR_Recipes(){ + public static void registerTHR_Recipes() { GT_Values.RA.addCentrifugeRecipe( - Materials.Thorium.getDust(1),GT_Values.NI,GT_Values.NF,GT_Values.NF, - Materials.Thorium.getDust(1),Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1),WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1), - WerkstoffLoader.Thorium232.get(OrePrefixes.dust,1),GT_Values.NI, - new int[]{800,375,22,22,5}, - 10000, BW_Util.getMachineVoltageFromTier(4)); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - GT_OreDictUnificator.get(OrePrefixes.plateDense,Materials.Lead,6), - GT_OreDictUnificator.get(OrePrefixes.frameGt,Materials.TungstenSteel,1) + Materials.Thorium.getDust(1), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 1), + GT_Values.NI, + new int[] {800, 375, 22, 22, 5}, + 10000, + BW_Util.getMachineVoltageFromTier(4)); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Lead, 6), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.TungstenSteel, 1) }, Materials.Concrete.getMolten(1296), - new ItemStack(GregTech_API.sBlockCasings3,1,12), + new ItemStack(GregTech_API.sBlockCasings3, 1, 12), 40, - BW_Util.getMachineVoltageFromTier(5) - ); - GT_Values.RA.addMixerRecipe(WerkstoffLoader.Thorium232.get(OrePrefixes.dust,10),Materials.Uranium235.getDust(1),GT_Utility.getIntegratedCircuit(2),null,null,null,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),400,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,1),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,1),Materials.Silicon.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),40,30); - GT_Values.RA.addFormingPressRecipe(new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,2),Materials.Graphite.getDust(64),new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,3),40,30); + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addMixerRecipe( + WerkstoffLoader.Thorium232.get(OrePrefixes.dust, 10), + Materials.Uranium235.getDust(1), + GT_Utility.getIntegratedCircuit(2), + null, + null, + null, + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + 400, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 1), + Materials.Silicon.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + 40, + 30); + GT_Values.RA.addFormingPressRecipe( + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 2), + Materials.Graphite.getDust(64), + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + 40, + 30); ItemStack[] pellets = new ItemStack[6]; - Arrays.fill(pellets,new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,4)); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,3),GT_Utility.getIntegratedCircuit(17)}, pellets,null,null,null,null,48000,30,0); - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(false,new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,1,5),GT_Utility.getIntegratedCircuit(17)}, new ItemStack[]{new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,64,6)},null,null,null,null,48000,30,0); + Arrays.fill(pellets, new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 4)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 3), + GT_Utility.getIntegratedCircuit(17) + }, + pellets, + null, + null, + null, + null, + 48000, + 30, + 0); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe( + false, + new ItemStack[] { + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 5), + GT_Utility.getIntegratedCircuit(17) + }, + new ItemStack[] {new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 64, 6)}, + null, + null, + null, + null, + 48000, + 30, + 0); GT_Values.RA.addCentrifugeRecipe( - new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), GT_Values.NI, GT_Values.NF, GT_Values.NF, - Materials.Lead.getDust(1), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, - new int[]{300}, - 1200, 30); + new ItemStack(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials, 1, 6), + GT_Values.NI, + GT_Values.NF, + GT_Values.NF, + Materials.Lead.getDust(1), + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + GT_Values.NI, + new int[] {300}, + 1200, + 30); } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index ece992b765..78ff775ca5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_Values.V; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_Windmill; import com.github.bartimaeusnek.bartworks.common.tileentities.classic.BW_RotorBlock; @@ -51,6 +55,9 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayerMP; @@ -63,15 +70,8 @@ import net.minecraft.tileentity.TileEntityDispenser; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_Values.V; - -public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_Windmill> implements ISurvivalConstructable { +public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_TileEntity_Windmill> + implements ISurvivalConstructable { private static final IIcon[] iIcons = new IIcon[2]; private static final IIconContainer[] iIconContainers = new IIconContainer[2]; @@ -91,30 +91,34 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_Windmill> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_Windmill>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" ", " ", " ", " p ", " ", " ", " "}, - {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, - {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, - {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, - {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, - {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, - })) - .addElement('p', ofBlockAnyMeta(Blocks.planks)) - .addElement('c', ofChain( - onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), - ofTileAdder(GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), - onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)) - )) - .addElement('b', ofBlock(Blocks.brick_block, 0)) - .addElement('s', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) - .build(); + private static final IStructureDefinition<GT_TileEntity_Windmill> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_Windmill>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {" ", " ", " ", " p ", " ", " ", " "}, + {" ", " ", " ppp ", " p p ", " ppp ", " ", " "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppspp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ppppp ", "p p", "p p", "p p", "p p", "p p", " ppppp "}, + {" ", " ppppp ", " p p ", " p p ", " p p ", " ppppp ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" ", " ccc ", " c c ", " c c ", " c c ", " ccc ", " "}, + {" bb~bb ", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", "bbbbbbb", " bbbbb "}, + })) + .addElement('p', ofBlockAnyMeta(Blocks.planks)) + .addElement( + 'c', + ofChain( + onElementPass(t -> t.mHardenedClay++, ofBlock(Blocks.hardened_clay, 0)), + ofTileAdder( + GT_TileEntity_Windmill::addDispenserToOutputSet, Blocks.hardened_clay, 0), + onElementPass(t -> t.mDoor++, ofBlock(Blocks.wooden_door, 0)))) + .addElement('b', ofBlock(Blocks.brick_block, 0)) + .addElement( + 's', ofTileAdder(GT_TileEntity_Windmill::setRotorBlock, StructureLibAPI.getBlockHint(), 0)) + .build(); @Override public IStructureDefinition<GT_TileEntity_Windmill> getStructureDefinition() { @@ -129,20 +133,19 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt. - addMachineType("Windmill"). - addInfo("Controller block for the Windmill"). - addInfo("A primitive Grinder powered by Kinetic energy"). - addInfo("The structure is too complex!"). - addInfo("Follow the StructureLib hologram projector to build the main structure."). - addSeparator(). - beginStructureBlock(7, 12, 7, false). - addController("Front bottom center"). - addCasingInfo("Hardened Clay block", 40). - addOtherStructurePart("Dispenser", "Any Hardened Clay block"). - addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block"). - addStructureHint("Primitive Kinetic Shaftbox", 1). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Windmill") + .addInfo("Controller block for the Windmill") + .addInfo("A primitive Grinder powered by Kinetic energy") + .addInfo("The structure is too complex!") + .addInfo("Follow the StructureLib hologram projector to build the main structure.") + .addSeparator() + .beginStructureBlock(7, 12, 7, false) + .addController("Front bottom center") + .addCasingInfo("Hardened Clay block", 40) + .addOtherStructurePart("Dispenser", "Any Hardened Clay block") + .addOtherStructurePart("0-1 Wooden door", "Any Hardened Clay block") + .addStructureHint("Primitive Kinetic Shaftbox", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -155,8 +158,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean onRunningTick(ItemStack aStack) { - if (this.mMaxProgresstime > 0) - this.mProgresstime += this.rotorBlock.getGrindPower(); + if (this.mMaxProgresstime > 0) this.mProgresstime += this.rotorBlock.getGrindPower(); return this.rotorBlock.getGrindPower() > 0; } @@ -166,37 +168,63 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock } public boolean recipe_fallback(ItemStack aStack) { - //sight... fallback to the macerator recipes + // sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); - if (tRecipe == null) - return false; + if (tRecipe == null) return false; if (tRecipe.getOutput(0) != null) { // Decrease input stack by appropriate amount (Not always 1) tRecipe.isRecipeInputEqual(true, null, aStack); this.mOutputItems[0] = tRecipe.getOutput(0); if (new XSTR().nextInt(2) == 0) { - if (tRecipe.getOutput(1) != null) - this.mOutputItems[1] = tRecipe.getOutput(1); - else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) || - !( - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL) || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTALLISABLE) - ) - || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Flint || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Sugar || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wheat || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Wood || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Ash || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Snow || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.Stone || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatRaw || - BW_Util.checkStackAndPrefix(this.mOutputItems[0]) && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial == Materials.MeatCooked - ) - this.mOutputItems[1] = tRecipe.getOutput(0); + if (tRecipe.getOutput(1) != null) this.mOutputItems[1] = tRecipe.getOutput(1); + else if (!BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + || !(BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.METAL) + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.CRYSTAL) + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.CRYSTALLISABLE)) + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Flint + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Sugar + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Wheat + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Wood + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Ash + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Snow + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.Stone + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.MeatRaw + || BW_Util.checkStackAndPrefix(this.mOutputItems[0]) + && GT_OreDictUnificator.getAssociation(this.mOutputItems[0]).mMaterial.mMaterial + == Materials.MeatCooked) this.mOutputItems[1] = tRecipe.getOutput(0); } } this.mMaxProgresstime = (tRecipe.mDuration * 2 * 100); @@ -212,14 +240,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock input.stackSize -= 1; this.mMaxProgresstime = maxProgresstime; if (randomise) { - if (localRandomInstance.nextInt(2) == 0) - this.mOutputItems[0] = outputs[0]; - else - this.mOutputItems[0] = outputs[1]; + if (localRandomInstance.nextInt(2) == 0) this.mOutputItems[0] = outputs[0]; + else this.mOutputItems[0] = outputs[1]; } else { this.mOutputItems[0] = outputs[0]; - if (outputs.length == 2) - this.mOutputItems[1] = outputs[1]; + if (outputs.length == 2) this.mOutputItems[1] = outputs[1]; } return true; } @@ -227,14 +252,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public boolean checkRecipe(ItemStack itemStack) { - if (itemStack == null || itemStack.getItem() == null) - return false; + if (itemStack == null || itemStack.getItem() == null) return false; - if (this.mOutputItems == null) - this.mOutputItems = new ItemStack[2]; + if (this.mOutputItems == null) this.mOutputItems = new ItemStack[2]; - //Override Recipes that doesnt quite work well with OreUnificator - //Items + // Override Recipes that doesnt quite work well with OreUnificator + // Items if (itemStack.getItem().equals(Items.wheat)) { return hardOverride( 30000, @@ -244,21 +267,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Wheat, 1L)); } else if (itemStack.getItem().equals(Items.bone)) { return hardOverride( - 30000, - true, - itemStack, - new ItemStack(Items.dye, 4, 15), - new ItemStack(Items.dye, 3, 15)); + 30000, true, itemStack, new ItemStack(Items.dye, 4, 15), new ItemStack(Items.dye, 3, 15)); } - //Blocks + // Blocks else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.gravel)) { - return hardOverride( - 60000, - true, - itemStack, - new ItemStack(Items.flint, 2), - new ItemStack(Items.flint)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { + return hardOverride(60000, true, itemStack, new ItemStack(Items.flint, 2), new ItemStack(Items.flint)); + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.cobblestone) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stone)) { return hardOverride( 120000, true, @@ -266,38 +281,19 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 2L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.sandstone)) { - return hardOverride( - 120000, - true, - itemStack, - new ItemStack(Blocks.sand, 3), - new ItemStack(Blocks.sand, 2)); - } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { - return hardOverride( - 120000, - true, - itemStack, - Materials.Clay.getDust(2), - Materials.Clay.getDust(1)); + return hardOverride(120000, true, itemStack, new ItemStack(Blocks.sand, 3), new ItemStack(Blocks.sand, 2)); + } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.hardened_clay) + || Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.stained_hardened_clay)) { + return hardOverride(120000, true, itemStack, Materials.Clay.getDust(2), Materials.Clay.getDust(1)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.redstone_block)) { - return hardOverride( - 120000, - false, - itemStack, - Materials.Redstone.getDust(9)); + return hardOverride(120000, false, itemStack, Materials.Redstone.getDust(9)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glass)) { return hardOverride( - 120000, - false, - itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L))); + 120000, false, itemStack, (GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 1L))); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.wool)) { return hardOverride( - 120000, - true, - itemStack, - new ItemStack(Items.string, 3), - new ItemStack(Items.string, 2)); + 120000, true, itemStack, new ItemStack(Items.string, 3), new ItemStack(Items.string, 2)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.glowstone)) { return hardOverride( 120000, @@ -335,84 +331,111 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock new ItemStack(Items.pumpkin_seeds, 1)); } else if (Block.getBlockFromItem(itemStack.getItem()).equals(Blocks.melon_block)) { return hardOverride( - 30000, - true, - itemStack, - new ItemStack(Items.melon_seeds, 2), - new ItemStack(Items.melon_seeds, 1)); + 30000, true, itemStack, new ItemStack(Items.melon_seeds, 2), new ItemStack(Items.melon_seeds, 1)); } - //null checks for GT shit - if (GT_OreDictUnificator.getAssociation(itemStack) == null || - GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null || - GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.getDust(1) == null - ) - return this.recipe_fallback(itemStack); //fallback for all non-unificated Items - - //Ore Unificator shit for balance - if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { + // null checks for GT shit + if (GT_OreDictUnificator.getAssociation(itemStack) == null + || GT_OreDictUnificator.getAssociation(itemStack).mPrefix == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial == null + || GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .getDust(1) + == null) return this.recipe_fallback(itemStack); // fallback for all non-unificated Items + + // Ore Unificator shit for balance + if (OrePrefixes.ingot.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.gem.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 90000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.ore.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 120000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.crushed, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.crushed, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.nugget.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 30000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dustTiny, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dustTiny, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.crushed.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 60000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dustImpure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dustImpure, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.crushedPurified.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 60000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dustPure, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dustPure, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + 1L))); } else if (OrePrefixes.crushedCentrifuged.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 60000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } else if (OrePrefixes.block.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 120000, false, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, (GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.METAL) || GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mSubTags.contains(SubTag.CRYSTAL)) ? 9L : 1L))); - } else if ( - OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) || - OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) - ) { + (GT_OreDictUnificator.get( + OrePrefixes.dust, + GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, + (GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.METAL) + || GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .mSubTags + .contains(SubTag.CRYSTAL)) + ? 9L + : 1L))); + } else if (OrePrefixes.stone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneChiseled.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCobble.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneCracked.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossy.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneMossyBricks.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.stoneSmooth.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix) + || OrePrefixes.cobblestone.equals(GT_OreDictUnificator.getAssociation(itemStack).mPrefix)) { return hardOverride( 120000, true, itemStack, - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)), - (GT_OreDictUnificator.get(OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 2L)), + (GT_OreDictUnificator.get( + OrePrefixes.dust, GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial, 1L))); } - return this.recipe_fallback(itemStack); //2nd fallback + return this.recipe_fallback(itemStack); // 2nd fallback } @Override @@ -433,7 +456,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return false; } - public boolean setRotorBlock(TileEntity aTileEntity){ + public boolean setRotorBlock(TileEntity aTileEntity) { if (aTileEntity instanceof BW_RotorBlock) { this.rotorBlock = (BW_RotorBlock) aTileEntity; return true; @@ -444,12 +467,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @SuppressWarnings("ALL") @Override public boolean addOutput(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) - return false; + if (GT_Utility.isStackInvalid(aStack)) return false; for (TileEntityDispenser tHatch : this.tileEntityDispensers) { for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { - if (tHatch.getStackInSlot(i) == null || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { + if (tHatch.getStackInSlot(i) == null + || GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack) + && aStack.stackSize + tHatch.getStackInSlot(i).stackSize <= 64) { if (GT_Utility.areStacksEqual(tHatch.getStackInSlot(i), aStack)) { ItemStack merge = tHatch.getStackInSlot(i).copy(); merge.stackSize = aStack.stackSize + tHatch.getStackInSlot(i).stackSize; @@ -479,11 +503,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mDoor = 0; this.mHardenedClay = 0; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0)) return false; - if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) - return false; + if (this.tileEntityDispensers.isEmpty() || this.mDoor > 2 || this.mHardenedClay < 40) return false; this.mWrench = true; this.mScrewdriver = true; @@ -495,13 +517,11 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return true; } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { this.mProgresstime++; if (aBaseMetaTileEntity.isServerSide()) { - if (this.mEfficiency < 0) - this.mEfficiency = 0; + if (this.mEfficiency < 0) this.mEfficiency = 0; if (--this.mUpdate == 0 || --this.mStartUpCheck == 0 || this.mStructureChanged) { checkStructure(true, aBaseMetaTileEntity); this.mUpdate = 100; @@ -522,28 +542,29 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mMaxProgresstime = 0; this.mEfficiencyIncrease = 0; if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) - this.updateSlots(); + if (this.checkRecipe(this.mInventory[1])) this.updateSlots(); } } } } else { - if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { + if (aTick % 100 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled() + || aBaseMetaTileEntity.hasInventoryBeenModified()) { if (aBaseMetaTileEntity.isAllowedToWork()) { - if (this.checkRecipe(this.mInventory[1])) - this.updateSlots(); + if (this.checkRecipe(this.mInventory[1])) this.updateSlots(); } } } } else { - //this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); + // this.mMachine = this.checkMachine(aBaseMetaTileEntity, this.mInventory[1]); return; } } else { this.stopMachine(); } } - aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); + aBaseMetaTileEntity.setErrorDisplayID( + (aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (this.mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(this.mMaxProgresstime > 0); } @@ -579,7 +600,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return false; } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_TileEntity_Windmill(this.mName); @@ -587,7 +607,12 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public String[] getInfoData() { - return new String[]{"Progress:", this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", "GrindPower:", this.rotorBlock.getGrindPower() + "KU/t"}; + return new String[] { + "Progress:", + this.mProgresstime + " Grindings of " + this.mMaxProgresstime + " needed Grindings", + "GrindPower:", + this.rotorBlock.getGrindPower() + "KU/t" + }; } @SideOnly(Side.CLIENT) @@ -628,12 +653,16 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock return new ResourceLocation(MainMod.MOD_ID + ":windmill_top"); } }; - - } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] ret = new ITexture[6]; @@ -655,7 +684,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock public boolean isClientSide() { if (this.getBaseMetaTileEntity().getWorld() != null) - return this.getBaseMetaTileEntity().getWorld().isRemote ? FMLCommonHandler.instance().getSide() == Side.CLIENT : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; + return this.getBaseMetaTileEntity().getWorld().isRemote + ? FMLCommonHandler.instance().getSide() == Side.CLIENT + : FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; return FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT; } @@ -667,6 +698,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, IItemSource source, EntityPlayerMP actor) { if (mMachine) return -1; - return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); + return survivialBuildPiece( + STRUCTURE_PIECE_MAIN, stackSize, 3, 11, 0, elementBudget, source, actor, false, true); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index ab03d1305c..3ab76bcef1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -22,6 +22,17 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import static gregtech.api.util.GT_StructureUtility.ofCoil; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -46,6 +57,8 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.*; +import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -54,50 +67,65 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.*; -import java.util.stream.Collectors; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.withChannel; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gregtech.api.util.GT_StructureUtility.ofCoil; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaBlastFurnace> implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaBlastFurnace> + implements ISurvivalConstructable { private static final int CASING_INDEX = 11; - private static final IStructureDefinition<GT_TileEntity_MegaBlastFurnace> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaBlastFurnace>builder() - .addShape("main", createShape()) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement('t', - buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast(OutputHatch.withAdder(GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList).withCount(t -> t.mPollutionOutputHatches.size())) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) - ) - .addElement('m', Muffler.newAny(CASING_INDEX, 2)) - .addElement('C', withChannel("coil", ofCoil(GT_TileEntity_MegaBlastFurnace::setCoilLevel, GT_TileEntity_MegaBlastFurnace::getCoilLevel))) - .addElement('g', withChannel("glass", BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier))) - .addElement('b', buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX) - ) - .build(); + private static final IStructureDefinition<GT_TileEntity_MegaBlastFurnace> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_MegaBlastFurnace>builder() + .addShape("main", createShape()) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 't', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast(OutputHatch.withAdder( + GT_TileEntity_MegaBlastFurnace::addOutputHatchToTopList) + .withCount(t -> t.mPollutionOutputHatches.size())) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .addElement('m', Muffler.newAny(CASING_INDEX, 2)) + .addElement( + 'C', + withChannel( + "coil", + ofCoil( + GT_TileEntity_MegaBlastFurnace::setCoilLevel, + GT_TileEntity_MegaBlastFurnace::getCoilLevel))) + .addElement( + 'g', + withChannel( + "glass", + BorosilicateGlass.ofBoroGlass( + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + (te, t) -> te.glasTier = t, + te -> te.glasTier))) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaBlastFurnace.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings1, CASING_INDEX)) + .build(); private static String[][] createShape() { String[][] raw = new String[20][]; raw[0] = new String[15]; - String topCasing = "ttttttttttttttt"; + String topCasing = "ttttttttttttttt"; String mufflerLine = "tmmmmmmmmmmmmmt"; raw[0][0] = topCasing; for (int i = 1; i < 14; i++) { @@ -106,8 +134,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock raw[0][14] = topCasing; raw[1] = new String[15]; - String allGlass = "ggggggggggggggg"; - String allCoil = "gCCCCCCCCCCCCCg"; + String allGlass = "ggggggggggggggg"; + String allCoil = "gCCCCCCCCCCCCCg"; String middleLine = "gC===========Cg"; raw[1][0] = allGlass; raw[1][1] = allCoil; @@ -133,8 +161,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private HeatingCoilLevel mCoilLevel; protected final ArrayList<GT_MetaTileEntity_Hatch_Output> mPollutionOutputHatches = new ArrayList<>(); - protected final FluidStack[] pollutionFluidStacks = {Materials.CarbonDioxide.getGas(1000), - Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000)}; + protected final FluidStack[] pollutionFluidStacks = { + Materials.CarbonDioxide.getGas(1000), + Materials.CarbonMonoxide.getGas(1000), + Materials.SulfurDioxide.getGas(1000) + }; private int mHeatingCapacity; private byte glasTier; private int polPtick = ConfigHandler.basePollutionMBFSecond / 20 * ConfigHandler.megaMachinesMax; @@ -161,7 +192,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock .addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus") .addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)") .addInfo("Each 1800K over the min. Heat required grants one perfect overclock") - .addInfo("For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") + .addInfo( + "For each perfect overclock the EBF will reduce recipe time 4 times (instead of 2) (100% efficiency)") .addInfo("Additionally gives +100K for every tier past MV") .addPollutionAmount(20 * getPollutionPerTick(null)) .addSeparator() @@ -200,38 +232,62 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer.isSneaking()) { --circuitMode; - if (circuitMode < 0) - circuitMode = 24; + if (circuitMode < 0) circuitMode = 24; } else { ++circuitMode; - if (circuitMode > 24) - circuitMode = 0; + if (circuitMode > 24) circuitMode = 0; } - GT_Utility.sendChatToPlayer(aPlayer, circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); + GT_Utility.sendChatToPlayer( + aPlayer, + circuitMode > 0 ? "MEBF will prioritise circuit: " + circuitMode : "Circuit prioritisation disabled."); } @Override - public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick( + byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; - GT_Utility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + GT_Utility.sendChatToPlayer( + aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); return true; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override @@ -244,10 +300,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if(super.addMufflerToMachineList(aTileEntity, aBaseCasingIndex)) - { - if(mufflerTier == -1) - mufflerTier = this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; + if (super.addMufflerToMachineList(aTileEntity, aBaseCasingIndex)) { + if (mufflerTier == -1) mufflerTier = this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; return mufflerTier == this.mMufflerHatches.get(this.mMufflerHatches.size() - 1).mTier; } return false; @@ -270,22 +324,24 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } protected boolean addBottomHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) || - addInputToMachineList(aTileEntity, aBaseCasingIndex) || - addOutputToMachineList(aTileEntity, aBaseCasingIndex) || - addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return addMaintenanceToMachineList(aTileEntity, aBaseCasingIndex) + || addInputToMachineList(aTileEntity, aBaseCasingIndex) + || addOutputToMachineList(aTileEntity, aBaseCasingIndex) + || addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "ElectricBlastFurnace.png"); } @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = null; FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); GT_Recipe tRecipe = null; @@ -302,27 +358,37 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } } } - tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + tInputs = + Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, tInputList.size()); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(false, tFluids, tInputs))) { break; } } } else { tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { - List<ItemStack> modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); + if (circuitMode > 0 + && Arrays.stream(tInputs) + .anyMatch(e -> + GT_Utility.areStacksEqual(e, GT_Utility.getIntegratedCircuit(circuitMode), true))) { + List<ItemStack> modInputs = Arrays.stream(tInputs) + .filter(Objects::nonNull) + .filter(e -> !e.getItem() + .equals(GT_Utility.getIntegratedCircuit(circuitMode) + .getItem())) + .collect(Collectors.toList()); modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); tInputs = modInputs.toArray(new ItemStack[0]); } - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); if (tRecipe == null) { - if (circuitMode == 0) - return false; + if (circuitMode == 0) return false; tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); - if (tRecipe == null) - return false; + tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tFluids, tInputs); + if (tRecipe == null) return false; } } @@ -353,19 +419,18 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mEfficiencyIncrease = 10000; long actualEUT = precutRecipeVoltage * processed; - byte overclockCount = this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); + byte overclockCount = + this.calculateOverclockedNessMultiInternal(actualEUT, tRecipe.mDuration, nominalV, false); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; - if (this.lEUt > 0) - this.lEUt = (-this.lEUt); + if (this.lEUt > 0) this.lEUt = (-this.lEUt); if (tHeatCapacityDivTiers > 0) { - this.mMaxProgresstime >>= Math.min(tHeatCapacityDivTiers / 2, overclockCount); //extra free overclocking if possible - if (this.mMaxProgresstime < 1) - this.mMaxProgresstime = 1; //no eu efficiency correction + this.mMaxProgresstime >>= + Math.min(tHeatCapacityDivTiers / 2, overclockCount); // extra free overclocking if possible + if (this.mMaxProgresstime < 1) this.mMaxProgresstime = 1; // no eu efficiency correction } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); @@ -414,13 +479,11 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock @Override public boolean addOutput(FluidStack aLiquid) { - if (aLiquid == null) - return false; + if (aLiquid == null) return false; FluidStack tLiquid = aLiquid.copy(); boolean isOutputPollution = false; for (FluidStack pollutionFluidStack : pollutionFluidStacks) { - if (!tLiquid.isFluidEqual(pollutionFluidStack)) - continue; + if (!tLiquid.isFluidEqual(pollutionFluidStack)) continue; isOutputPollution = true; break; @@ -430,8 +493,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock tOutputHatches = this.mPollutionOutputHatches; int pollutionReduction = 0; for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (!isValidMetaTileEntity(tHatch)) - continue; + if (!isValidMetaTileEntity(tHatch)) continue; pollutionReduction = 100 - tHatch.calculatePollutionReduction(100); break; } @@ -439,11 +501,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock } else { tOutputHatches = this.mOutputHatches; } - return dumpFluid(tOutputHatches, tLiquid, true) || - dumpFluid(tOutputHatches, tLiquid, false); + return dumpFluid(tOutputHatches, tLiquid, true) || dumpFluid(tOutputHatches, tLiquid, false); } - @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { if (LoaderReference.tectech) { @@ -459,24 +519,22 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock this.mPollutionOutputHatches.clear(); - if (!checkPiece("main", 7, 17, 0)) - return false; + if (!checkPiece("main", 7, 17, 0)) return false; - if (getCoilLevel() == HeatingCoilLevel.None) - return false; + if (getCoilLevel() == HeatingCoilLevel.None) return false; - if (mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (!areLazorsLowPowa() + || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + if (this.glasTier < hatchEnergy.mTier) return false; + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); this.mHeatingCapacity = (int) getCoilLevel().getHeat() + 100 * (BW_Util.getTier(nominalV) - 2); return true; @@ -487,8 +545,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } @@ -496,6 +553,4 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_TileEntity_MegaMultiBlock public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sBlastRecipes; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java index d24df3c587..1a9b1e7130 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaChemicalReactor.java @@ -22,6 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -44,25 +53,19 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collection; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Collection; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaChemicalReactor> implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaChemicalReactor + extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaChemicalReactor> implements ISurvivalConstructable { private byte glasTier; @@ -84,7 +87,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl .addInfo("The structure is too complex!") .addInfo("Follow the Structure Lib hologram projector to build the main structure.") .addSeparator() - .beginStructureBlock(5, 5, 9, false) + .beginStructureBlock(5, 5, 9, false) .addController("Front center") .addStructureInfo("46x Chemically Inert Machine Casing (minimum)") .addStructureInfo("7x Fusion Coil Block") @@ -92,11 +95,11 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl .addStructureInfo("64x Borosilicate Glass Block (any tier)") .addStructureInfo("The glass tier limits the Energy Input tier") .addEnergyHatch("Hint block ", 3) - .addMaintenanceHatch("Hint block ",2) - .addInputHatch("Hint block ",1) - .addInputBus("Hint block ",1) - .addOutputBus("Hint block ",1) - .addOutputHatch("Hint block ",1) + .addMaintenanceHatch("Hint block ", 2) + .addInputHatch("Hint block ", 1) + .addInputBus("Hint block ", 1) + .addOutputBus("Hint block ", 1) + .addOutputHatch("Hint block ", 1) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -107,24 +110,47 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{ + if (aActive) + return new ITexture[] { + casingTexturePages[1][48], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ - casingTexturePages[1][48], - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_LARGE_CHEMICAL_REACTOR_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[1][48]}; + return new ITexture[] {casingTexturePages[1][48]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeChemicalReactor.png"); } @Override @@ -139,11 +165,13 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl ArrayList<ItemStack> outputItems = new ArrayList<>(); ArrayList<FluidStack> outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; @@ -164,9 +192,9 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl if (found_Recipe) { this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = ((long)tRecipe.mEUt) * processed; + long actualEUT = ((long) tRecipe.mEUt) * processed; calculatePerfectOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } @@ -185,7 +213,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl @Override public void construct(ItemStack aStack, boolean aHintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,2,2,0); + buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 2, 2, 0); } @Override @@ -194,7 +222,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 0, realBudget, source, actor, false, true); } -// -------------- TEC TECH COMPAT ---------------- + // -------------- TEC TECH COMPAT ---------------- @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -204,54 +232,54 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl this.getTecTechEnergyTunnels().clear(); } - if(!checkPiece(STRUCTURE_PIECE_MAIN,2,2,0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 0)) return false; - if(mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (!areLazorsLowPowa() + || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; - + if (this.glasTier < hatchEnergy.mTier) return false; return true; } - - private static final int CASING_INDEX = 176; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_MegaChemicalReactor> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaChemicalReactor>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd","ttttt"}, - {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, - {"tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret"}, - {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, - {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd","ttttt"}, - })) - .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) - .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) - .addElement('d', buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) - .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings8, 0) - ) - .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) - .addElement('e', ofChain( - TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), - ofBlock(GregTech_API.sBlockCasings8, 0) - )) - .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); - + private static final IStructureDefinition<GT_TileEntity_MegaChemicalReactor> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_MegaChemicalReactor>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt"}, + {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, + {"tg~gt", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", " gcg ", "teret"}, + {"tgggt", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", " ggg ", "teeet"}, + {"ttttt", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "dptpd", "ttttt"}, + })) + .addElement('p', ofBlock(GregTech_API.sBlockCasings8, 1)) + .addElement('t', ofBlock(GregTech_API.sBlockCasings8, 0)) + .addElement( + 'd', + buildHatchAdder(GT_TileEntity_MegaChemicalReactor.class) + .atLeast(InputBus, InputHatch, OutputBus, OutputHatch) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings8, 0)) + .addElement('r', Maintenance.newAny(CASING_INDEX, 2)) + .addElement( + 'e', + ofChain( + TTEnabledEnergyHatchElement.INSTANCE.newAny(CASING_INDEX, 3), + ofBlock(GregTech_API.sBlockCasings8, 0))) + .addElement('c', ofBlock(GregTech_API.sBlockCasings4, 7)) + .addElement( + 'g', + BorosilicateGlass.ofBoroGlass( + (byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .build(); @Override public IStructureDefinition<GT_TileEntity_MegaChemicalReactor> getStructureDefinition() { @@ -263,9 +291,7 @@ public class GT_TileEntity_MegaChemicalReactor extends GT_TileEntity_MegaMultiBl private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index e07aa62364..0a6154d086 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -22,6 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -46,26 +55,20 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaDistillTower> implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaDistillTower> + implements ISurvivalConstructable { protected static final int CASING_INDEX = 49; protected static final String STRUCTURE_PIECE_BASE = "base"; protected static final String STRUCTURE_PIECE_LAYER = "layer"; @@ -73,72 +76,261 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock private static final IStructureDefinition<GT_TileEntity_MegaDistillTower> STRUCTURE_DEFINITION; static { - IHatchElement<GT_TileEntity_MegaDistillTower> layeredOutputHatch = OutputHatch - .withCount(GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) - .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); + IHatchElement<GT_TileEntity_MegaDistillTower> layeredOutputHatch = OutputHatch.withCount( + GT_TileEntity_MegaDistillTower::getCurrentLayerOutputHatchCount) + .withAdder(GT_TileEntity_MegaDistillTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaDistillTower>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][]{ - {"bbbbbbb~bbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb", "bbbbbbbbbbbbbbb"}, - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][]{ - {"lllllllllllllll", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lcccccccccccccl", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][]{ - {"lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - {"lllllllllllllll", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "l=============l", "lllllllllllllll"}, - })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement('b', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1))) - ) - .addElement('l', buildHatchAdder(GT_TileEntity_MegaDistillTower.class) - .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(GT_TileEntity_MegaDistillTower::onCasingFound, ofBlock(GregTech_API.sBlockCasings4, 1))) - ) - .addElement('c', (IStructureElementCheckOnly<GT_TileEntity_MegaDistillTower>) (t, world, x, y, z) -> { - if (world.isAirBlock(x, y, z)) { - if (t.mTopState < 1) { - t.mTopState = 0; - return true; + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { + { + "bbbbbbb~bbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb", + "bbbbbbbbbbbbbbb" + }, + })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { + { + "lllllllllllllll", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lcccccccccccccl", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { + { + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + { + "lllllllllllllll", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "l=============l", + "lllllllllllllll" + }, + })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'b', + buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement( + 'l', + buildHatchAdder(GT_TileEntity_MegaDistillTower.class) + .atLeast(layeredOutputHatch, Maintenance, TTEnabledEnergyHatchElement.INSTANCE) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(onElementPass( + GT_TileEntity_MegaDistillTower::onCasingFound, + ofBlock(GregTech_API.sBlockCasings4, 1)))) + .addElement('c', (IStructureElementCheckOnly<GT_TileEntity_MegaDistillTower>) (t, world, x, y, z) -> { + if (world.isAirBlock(x, y, z)) { + if (t.mTopState < 1) { + t.mTopState = 0; + return true; + } + // definitely top - cannot be air + return false; } - // definitely top - cannot be air - return false; - } - // from here on we must be looking at a top layer, since it's not air - if (t.mTopState == 0) - // must be air but failed, so no - return false; - t.mTopState = 1; - // hatch adder - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof IGregTechTileEntity) { - IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; - if (t.addLayerOutputHatch(entity, CASING_INDEX)) { - t.onTopLayerFound(false); + // from here on we must be looking at a top layer, since it's not air + if (t.mTopState == 0) + // must be air but failed, so no + return false; + t.mTopState = 1; + // hatch adder + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity entity = (IGregTechTileEntity) tileEntity; + if (t.addLayerOutputHatch(entity, CASING_INDEX)) { + t.onTopLayerFound(false); + return true; + } + } + // block adder + if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 + && world.getBlockMetadata(x, y, z) == 1) { + t.onTopLayerFound(true); return true; + } else { + return false; } - } - // block adder - if (world.getBlock(x, y, z) == GregTech_API.sBlockCasings4 && world.getBlockMetadata(x, y, z) == 1) { - t.onTopLayerFound(true); - return true; - } else { - return false; - } - }) - .build(); + }) + .build(); } protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>(); @@ -167,14 +359,16 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); + return mOutputHatchesByLayer.size() < mHeight + ? 0 + : mOutputHatchesByLayer.get(mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) - return false; - while (mOutputHatchesByLayer.size() < mHeight) - mOutputHatchesByLayer.add(new ArrayList<>()); + if (aTileEntity == null + || aTileEntity.isDead() + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; + while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); return mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); @@ -182,29 +376,51 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock protected void onTopLayerFound(boolean aIsCasing) { mTopLayerFound = true; - if (aIsCasing) - onCasingFound(); + if (aIsCasing) onCasingFound(); } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { if (aActive) - return new ITexture[]{ + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{ + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_INDEX), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_DISTILLATION_TOWER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; + return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(CASING_INDEX)}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); } @Override @@ -252,18 +468,18 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock mTopState = -1; // check base - if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_BASE, 7, 0, 0)) return false; // check each layer while (mHeight < 12 && checkPiece(STRUCTURE_PIECE_LAYER, 7, mHeight * 5, 0) && !mTopLayerFound) { - if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) - // layer without output hatch - return false; - mTopState = -1; - // not top - mHeight++; - } + if (mOutputHatchesByLayer.size() < mHeight + || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + // layer without output hatch + return false; + mTopState = -1; + // not top + mHeight++; + } // validate final invariants... return mCasing >= 75 * mHeight + 10 && mHeight >= 2 && mTopLayerFound && mMaintenanceHatches.size() == 1; @@ -284,16 +500,19 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock if (mMachine) return -1; int realBudget = elementBudget >= 200 ? elementBudget : Math.min(200, elementBudget * 5); mHeight = 0; - int built = survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, realBudget, source, actor, false, true); + int built = + survivialBuildPiece(STRUCTURE_PIECE_BASE, stackSize, 1, 0, 0, realBudget, source, actor, false, true); if (built >= 0) return built; int tTotalHeight = Math.min(12, stackSize.stackSize + 2); // min 2 output layer, so at least 1 + 2 height for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; - built = survivialBuildPiece(STRUCTURE_PIECE_LAYER, stackSize, 1, i, 0, realBudget, source, actor, false, true); + built = survivialBuildPiece( + STRUCTURE_PIECE_LAYER, stackSize, 1, i, 0, realBudget, source, actor, false, true); if (built >= 0) return built; } mHeight = tTotalHeight; - return survivialBuildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, realBudget, source, actor, false, true); + return survivialBuildPiece( + STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, realBudget, source, actor, false, true); } @Override @@ -315,7 +534,8 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock } } - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(0, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); @@ -326,12 +546,13 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock Pair<ArrayList<FluidStack>, ArrayList<ItemStack>> Outputs; int processed = 0; boolean found_Recipe = false; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe(this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[]{tFluid}, tItems); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sDistillationRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, GT_Values.V[tTier], new FluidStack[] {tFluid}, tItems); if (tRecipe != null) { found_Recipe = true; long tMaxPara = Math.min(ConfigHandler.megaMachinesMax, nominalV / tRecipe.mEUt); - int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[]{tFluid}, null, (int) tMaxPara); + int tCurrentPara = handleParallelRecipe(tRecipe, new FluidStack[] {tFluid}, null, (int) tMaxPara); this.updateSlots(); processed = tCurrentPara; Outputs = getMultiOutput(tRecipe, tCurrentPara); @@ -339,24 +560,20 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock outputItems = Outputs.getValue(); } - if (!found_Recipe) - continue; + if (!found_Recipe) continue; this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - long actualEUT = ((long)tRecipe.mEUt) * processed; + long actualEUT = ((long) tRecipe.mEUt) * processed; calculateOverclockedNessMulti(actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputFluids = outputFluids.toArray(new FluidStack[0]); - if (!outputItems.isEmpty()) - this.mOutputItems = outputItems.toArray(new ItemStack[0]); - else - this.mOutputItems = null; + if (!outputItems.isEmpty()) this.mOutputItems = outputItems.toArray(new ItemStack[0]); + else this.mOutputItems = null; return true; } } @@ -371,5 +588,4 @@ public class GT_TileEntity_MegaDistillTower extends GT_TileEntity_MegaMultiBlock dumpFluid(mOutputHatchesByLayer.get(i), tStack, false); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java index 8af3ff320d..7cd9595d00 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaMultiBlockBase.java @@ -1,5 +1,8 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static gregtech.api.enums.GT_HatchElement.Energy; +import static gregtech.api.enums.GT_Values.V; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -19,6 +22,10 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -28,16 +35,12 @@ import net.minecraft.util.IChatComponent; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.function.Consumer; - -import static gregtech.api.enums.GT_HatchElement.Energy; -import static gregtech.api.enums.GT_Values.V; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_MegaMultiBlockBase<T>> extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> implements TecTechEnabledMulti { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_MegaMultiBlockBase<T>> + extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> implements TecTechEnabledMulti { protected GT_TileEntity_MegaMultiBlockBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,8 +80,7 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M Collection collection = this.getTecTechEnergyTunnels(); if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (!(tecTechEnergyMulti instanceof LowPowerLaser)) - return false; + if (!(tecTechEnergyMulti instanceof LowPowerLaser)) return false; return true; } @@ -104,28 +106,26 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M @Override public boolean drainEnergyInput(long aEU) { - if (LoaderReference.tectech) - return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); + if (LoaderReference.tectech) return TecTechUtils.drainEnergyMEBFTecTech(this, aEU); return MegaUtils.drainEnergyMegaVanilla(this, aEU); } @Override public long getMaxInputVoltage() { - if (LoaderReference.tectech) - return TecTechUtils.getMaxInputVoltage(this); + if (LoaderReference.tectech) return TecTechUtils.getMaxInputVoltage(this); return super.getMaxInputVoltage(); } @Deprecated @Override protected void calculateOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { - calculateOverclockedNessMultiInternal((long)aEUt, aDuration, maxInputVoltage, false); + calculateOverclockedNessMultiInternal((long) aEUt, aDuration, maxInputVoltage, false); } @Deprecated @Override protected void calculatePerfectOverclockedNessMulti(int aEUt, int aDuration, int mAmperage, long maxInputVoltage) { - calculateOverclockedNessMultiInternal((long)aEUt, aDuration, maxInputVoltage, true); + calculateOverclockedNessMultiInternal((long) aEUt, aDuration, maxInputVoltage, true); } @Override @@ -154,43 +154,49 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M } } - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); String tName = BW_Util.getTierNameFromVoltage(nominalV); - if(tName.equals("MAX+")) tName = EnumChatFormatting.OBFUSCATED + "MAX+"; - - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + - " EU/t(*" + GT_Utility.formatNumbers(TecTechUtils.getMaxInputAmperage(this)) + "A) = " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(nominalV) + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + tName + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", - BW_Tooltip_Reference.BW}; + if (tName.equals("MAX+")) tName = EnumChatFormatting.OBFUSCATED + "MAX+"; + + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*" + + GT_Utility.formatNumbers(TecTechUtils.getMaxInputAmperage(this)) + "A) = " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(nominalV) + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + tName + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %", + BW_Tooltip_Reference.BW + }; } - // Special overclocking to handle over MAX voltage - protected byte calculateOverclockedNessMultiInternal(long aEUt, int aDuration, long maxInputVoltage, boolean perfectOC) { + protected byte calculateOverclockedNessMultiInternal( + long aEUt, int aDuration, long maxInputVoltage, boolean perfectOC) { byte mTier = (byte) Math.max(0, BW_Util.getTier(maxInputVoltage)), overclockCount = 0; if (mTier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long this.lEUt = Integer.MAX_VALUE - 1; this.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { @@ -198,49 +204,48 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M this.mMaxProgresstime = (int) xMaxProgresstime; } } else { - //Long EUt calculation + // Long EUt calculation long xEUt = aEUt; - //Isnt too low EUt check? + // Isnt too low EUt check? long tempEUt = Math.max(xEUt, V[1]); this.mMaxProgresstime = aDuration; while (tempEUt <= BW_Util.getTierVoltage(mTier - 1)) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - this.mMaxProgresstime >>= perfectOC ? 2 : 1;//this is effect of overclocking - xEUt = this.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + this.mMaxProgresstime >>= perfectOC ? 2 : 1; // this is effect of overclocking + xEUt = this.mMaxProgresstime <= 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power overclockCount++; } - while (xEUt > maxInputVoltage && xEUt >= aEUt){ - //downclock one notch until we are good again, we have overshot. + while (xEUt > maxInputVoltage && xEUt >= aEUt) { + // downclock one notch until we are good again, we have overshot. xEUt >>= 2; this.mMaxProgresstime <<= perfectOC ? 2 : 1; overclockCount--; } - if (xEUt < aEUt){ + if (xEUt < aEUt) { xEUt <<= 2; this.mMaxProgresstime >>= perfectOC ? 2 : 1; overclockCount++; } this.lEUt = xEUt; - if (this.lEUt == 0) - this.lEUt = 1; - if (this.mMaxProgresstime <= 0) - this.mMaxProgresstime = 1;//set time to 1 tick + if (this.lEUt == 0) this.lEUt = 1; + if (this.mMaxProgresstime <= 0) this.mMaxProgresstime = 1; // set time to 1 tick } return overclockCount; } - - protected void calculateOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage){ + protected void calculateOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage) { calculateOverclockedNessMultiInternal(aEUt, aDuration, maxInputVoltage, false); } - protected void calculatePerfectOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage){ + protected void calculatePerfectOverclockedNessMulti(long aEUt, int aDuration, long maxInputVoltage) { calculateOverclockedNessMultiInternal(aEUt, aDuration, maxInputVoltage, true); } @@ -248,11 +253,9 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (LoaderReference.tectech) { int tier = TecTechUtils.addEnergyInputToMachineList(this, aTileEntity, aBaseCasingIndex, energyTier); - if(energyTier == -1) energyTier = tier; + if (energyTier == -1) energyTier = tier; return tier != -1; - } - else - { + } else { if (aTileEntity == null) { return false; } else { @@ -260,12 +263,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - if(energyTier == -1) - energyTier = ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier; - if(((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier != energyTier) - return false; - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + if (energyTier == -1) energyTier = ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier; + if (((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier != energyTier) return false; + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity); } else { return false; } @@ -282,9 +283,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M @Override public boolean onRunningTick(ItemStack aStack) { if (this.lEUt > 0) { - this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); + this.addEnergyOutput(this.lEUt * (long) this.mEfficiency / 10000L); return true; - } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + } else if (this.lEUt < 0 + && !this.drainEnergyInput((-this.lEUt) * 10000L / (long) Math.max(1000, this.mEfficiency))) { this.stopMachine(); return false; } else { @@ -318,10 +320,9 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M private static final List<? extends Class<? extends IMetaTileEntity>> mteClasses; static { - ImmutableList.Builder<Class<? extends IMetaTileEntity>> builder = ImmutableList.<Class<? extends IMetaTileEntity>>builder() - .addAll(Energy.mteClasses()); - if (LoaderReference.tectech) - builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); + ImmutableList.Builder<Class<? extends IMetaTileEntity>> builder = + ImmutableList.<Class<? extends IMetaTileEntity>>builder().addAll(Energy.mteClasses()); + if (LoaderReference.tectech) builder.add(GT_MetaTileEntity_Hatch_EnergyMulti.class); mteClasses = builder.build(); } @@ -343,11 +344,14 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M protected static class StructureElementAirNoHint<T> implements IStructureElement<T> { private static final StructureElementAirNoHint<?> INSTANCE = new StructureElementAirNoHint<>(); + @SuppressWarnings("unchecked") public static <T> IStructureElement<T> getInstance() { return (IStructureElement<T>) INSTANCE; } + private StructureElementAirNoHint() {} + @Override public boolean check(T o, World world, int x, int y, int z) { return world.isAirBlock(x, y, z); @@ -355,9 +359,10 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M @Override public boolean spawnHint(T o, World world, int x, int y, int z, ItemStack trigger) { - if (world.blockExists(x, y, z) && ! world.isAirBlock(x, y, z)) + if (world.blockExists(x, y, z) && !world.isAirBlock(x, y, z)) // hint if this is obstructed. in case *someone* ever finish the transparent rendering - StructureLibAPI.hintParticle(world, x, y, z, StructureLibAPI.getBlockHint(), StructureLibAPI.HINT_BLOCK_META_AIR); + StructureLibAPI.hintParticle( + world, x, y, z, StructureLibAPI.getBlockHint(), StructureLibAPI.HINT_BLOCK_META_AIR); return true; } @@ -368,7 +373,16 @@ public abstract class GT_TileEntity_MegaMultiBlockBase<T extends GT_TileEntity_M } @Override - public PlaceResult survivalPlaceBlock(T o, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + public PlaceResult survivalPlaceBlock( + T o, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter) { if (check(o, world, x, y, z)) return PlaceResult.SKIP; if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, actor)) return PlaceResult.REJECT; world.setBlock(x, y, z, Blocks.air, 0, 2); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java index f0885a48f6..3d3babc9cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaOilCracker.java @@ -22,6 +22,16 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.InputHatch; +import static gregtech.api.enums.GT_HatchElement.Maintenance; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.*; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; @@ -47,57 +57,134 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.InputHatch; -import static gregtech.api.enums.GT_HatchElement.Maintenance; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.*; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaOilCracker> implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaOilCracker> + implements ISurvivalConstructable { private static final int CASING_INDEX = 49; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_MegaOilCracker> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaOilCracker>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {" p p ", "ppgggggggggpp", " pgggggggggp ", " pgggpppgggp ", " pgggpMpgggp ", " pgggpppgggp ", " pgggggggggp ", "ppgggggggggpp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c c c p ", " l c c c c r ", " p c c c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " p c c p ", " p c c c c p ", " p c c p ", " g c c c c g ", "pgggggggggggp", " p p "}, - {" p p ", "pgggggggggggp", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", " g c c c c g ", "pgggggggggggp", " p p "}, - {"ppmmmm~mmmmpp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppppppppppppp", "ppmmmmmmmmmpp"}, - - })) - .addElement('c', ofCoil(GT_TileEntity_MegaOilCracker::setCoilLevel, GT_TileEntity_MegaOilCracker::getCoilLevel)) - .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) - .addElement('l', ofChain( // TODO figure out what to do with this - ofHatchAdder(GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2) - )) - .addElement('r', ofChain( - ofHatchAdder(GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3) - )) - .addElement('m', buildHatchAdder(GT_TileEntity_MegaOilCracker.class) - .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(GregTech_API.sBlockCasings4, 1) - ) - .addElement('M', InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList).newAny(CASING_INDEX, 4)) - .addElement('g', BorosilicateGlass.ofBoroGlass((byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) - .build(); + private static final IStructureDefinition<GT_TileEntity_MegaOilCracker> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_MegaOilCracker>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + " p p ", + "ppgggggggggpp", + " pgggggggggp ", + " pgggpppgggp ", + " pgggpMpgggp ", + " pgggpppgggp ", + " pgggggggggp ", + "ppgggggggggpp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " p c c p ", + " p c c c c p ", + " p c c p ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " p c c c c p ", + " l c c c c r ", + " p c c c c p ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " p c c p ", + " p c c c c p ", + " p c c p ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + " p p ", + "pgggggggggggp", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + " g c c c c g ", + "pgggggggggggp", + " p p " + }, + { + "ppmmmm~mmmmpp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppppppppppppp", + "ppmmmmmmmmmpp" + }, + })) + .addElement( + 'c', + ofCoil( + GT_TileEntity_MegaOilCracker::setCoilLevel, + GT_TileEntity_MegaOilCracker::getCoilLevel)) + .addElement('p', ofBlock(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'l', + ofChain( // TODO figure out what to do with this + ofHatchAdder( + GT_TileEntity_MegaOilCracker::addLeftHatchToMachineList, CASING_INDEX, 2))) + .addElement( + 'r', + ofChain(ofHatchAdder( + GT_TileEntity_MegaOilCracker::addRightHatchToMachineList, CASING_INDEX, 3))) + .addElement( + 'm', + buildHatchAdder(GT_TileEntity_MegaOilCracker.class) + .atLeast(TTEnabledEnergyHatchElement.INSTANCE, Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain(GregTech_API.sBlockCasings4, 1)) + .addElement( + 'M', + InputHatch.withAdder(GT_TileEntity_MegaOilCracker::addMiddleInputToMachineList) + .newAny(CASING_INDEX, 4)) + .addElement( + 'g', + BorosilicateGlass.ofBoroGlass( + (byte) 0, (byte) 1, Byte.MAX_VALUE, (te, t) -> te.glasTier = t, te -> te.glasTier)) + .build(); private byte glasTier; private HeatingCoilLevel heatLevel; protected final List<GT_MetaTileEntity_Hatch_Input> mMiddleInputHatches = new ArrayList<>(); @@ -129,11 +216,11 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa .addController("Front bottom") .addStructureInfo("The glass tier limits the Energy Input tier") .addInfo("Gets 10% EU/t reduction per coil tier, up to a maximum of 50%") - .addEnergyHatch("Hint block",1) - .addMaintenanceHatch("Hint block",1) - .addInputHatch("Hint block",2,3) - .addOutputHatch("Hint block",2,3) - .addInputHatch("Steam/Hydrogen ONLY, Hint block",4) + .addEnergyHatch("Hint block", 1) + .addMaintenanceHatch("Hint block", 1) + .addInputHatch("Hint block", 2, 3) + .addOutputHatch("Hint block", 2, 3) + .addInputHatch("Steam/Hydrogen ONLY, Hint block", 4) .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -144,24 +231,49 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { if (aSide == aFacing) { - if (aActive) return new ITexture[]{casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW).extFacing().glow().build()}; - return new ITexture[]{casingTexturePages[0][CASING_INDEX], - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW).extFacing().glow().build()}; + if (aActive) + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; + return new ITexture[] { + casingTexturePages[0][CASING_INDEX], + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_OIL_CRACKER_GLOW) + .extFacing() + .glow() + .build() + }; } - return new ITexture[]{casingTexturePages[0][CASING_INDEX]}; + return new ITexture[] {casingTexturePages[0][CASING_INDEX]}; } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "OilCrackingUnit.png"); } - @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sCrackingRecipes; @@ -174,17 +286,18 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa ArrayList<ItemStack> outputItems = new ArrayList<>(); ArrayList<FluidStack> outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = getRecipeMap().findRecipe( - getBaseMetaTileEntity(), - false, - gregtech.api.enums.GT_Values.V[tTier], - tInputFluids, - mInventory[1] - ); + GT_Recipe tRecipe = getRecipeMap() + .findRecipe( + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tInputFluids, + mInventory[1]); boolean found_Recipe = false; int processed = 0; @@ -208,15 +321,14 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine + // In case recipe is too OP for that machine if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) { return false; } if (this.getCoilLevel().getTier() < 5) { this.lEUt *= 1 - (0.1D * (this.getCoilLevel().getTier() + 1)); - } - else { + } else { this.lEUt *= 0.5; } @@ -243,7 +355,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa @Override public void construct(ItemStack aStack, boolean aHintsOnly) { - buildPiece(STRUCTURE_PIECE_MAIN,aStack,aHintsOnly,6,6,0); + buildPiece(STRUCTURE_PIECE_MAIN, aStack, aHintsOnly, 6, 6, 0); } @Override @@ -263,22 +375,20 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa this.getTecTechEnergyTunnels().clear(); } - if(!checkPiece(STRUCTURE_PIECE_MAIN,6,6,0)) - return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 6, 6, 0)) return false; - if(mMaintenanceHatches.size() != 1) - return false; + if (mMaintenanceHatches.size() != 1) return false; if (LoaderReference.tectech && this.glasTier < 8) - if (!areLazorsLowPowa() || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) - return false; + if (!areLazorsLowPowa() + || areThingsNotProperlyTiered(this.getTecTechEnergyTunnels()) + || areThingsNotProperlyTiered(this.getTecTechEnergyMultis())) return false; if (this.glasTier < 8 && !this.mEnergyHatches.isEmpty()) for (GT_MetaTileEntity_Hatch_Energy hatchEnergy : this.mEnergyHatches) - if (this.glasTier < hatchEnergy.mTier) - return false; + if (this.glasTier < hatchEnergy.mTier) return false; - return true; + return true; } private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -290,7 +400,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 1){ + if (mInputOnSide == 1) { return false; } mInputOnSide = 0; @@ -301,7 +411,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 1){ + if (mOutputOnSide == 1) { return false; } mInputOnSide = 1; @@ -322,7 +432,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return false; } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - if (mInputOnSide == 0){ + if (mInputOnSide == 0) { return false; } mInputOnSide = 1; @@ -333,7 +443,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa return mInputHatches.add(tHatch); } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - if (mOutputOnSide == 0){ + if (mOutputOnSide == 0) { return false; } mInputOnSide = 0; @@ -395,10 +505,7 @@ public class GT_TileEntity_MegaOilCracker extends GT_TileEntity_MegaMultiBlockBa private boolean areThingsNotProperlyTiered(Collection collection) { if (!collection.isEmpty()) for (Object tecTechEnergyMulti : collection) - if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) - return true; + if (((GT_MetaTileEntity_TieredMachineBlock) tecTechEnergyMulti).mTier > this.glasTier) return true; return false; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index e252a7e10e..93f6cf6aa3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -22,6 +22,15 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; +import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.enums.GT_HatchElement.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.Textures.BlockIcons.*; +import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -41,24 +50,18 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTWORKS; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.getMultiOutput; -import static com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel.handleParallelRecipe; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.enums.GT_HatchElement.*; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; - -@Optional.Interface(iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", modid = "tectech", striprefs = true) -public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaVacuumFreezer> implements ISurvivalConstructable { +@Optional.Interface( + iface = "com.github.bartimaeusnek.crossmod.tectech.TecTechEnabledMulti", + modid = "tectech", + striprefs = true) +public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBlockBase<GT_TileEntity_MegaVacuumFreezer> + implements ISurvivalConstructable { public GT_TileEntity_MegaVacuumFreezer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -77,51 +80,299 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc private static final int CASING_INDEX = 17; private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GT_TileEntity_MegaVacuumFreezer> STRUCTURE_DEFINITION = StructureDefinition.<GT_TileEntity_MegaVacuumFreezer>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][]{ - {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccc~ccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "c=============c", "ccccccccccccccc"}, - {"ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc", "ccccccccccccccc"} - })) - .addElement('=', StructureElementAirNoHint.getInstance()) - .addElement('c', buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) - .atLeast(TTEnabledEnergyHatchElement.INSTANCE, InputHatch, InputBus, OutputHatch, OutputBus, Maintenance) - .casingIndex(CASING_INDEX) - .dot(1) - .buildAndChain(onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1))) - ) - .build(); - + private static final IStructureDefinition<GT_TileEntity_MegaVacuumFreezer> STRUCTURE_DEFINITION = + StructureDefinition.<GT_TileEntity_MegaVacuumFreezer>builder() + .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { + { + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccc~ccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "c=============c", + "ccccccccccccccc" + }, + { + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc", + "ccccccccccccccc" + } + })) + .addElement('=', StructureElementAirNoHint.getInstance()) + .addElement( + 'c', + buildHatchAdder(GT_TileEntity_MegaVacuumFreezer.class) + .atLeast( + TTEnabledEnergyHatchElement.INSTANCE, + InputHatch, + InputBus, + OutputHatch, + OutputBus, + Maintenance) + .casingIndex(CASING_INDEX) + .dot(1) + .buildAndChain( + onElementPass(x -> x.mCasing++, ofBlock(GregTech_API.sBlockCasings2, 1)))) + .build(); @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Vacuum Freezer"). - addInfo("Controller Block for the Mega Vacuum Freezer"). - addInfo("Cools hot ingots and cells"). - addSeparator(). - beginStructureBlock(15, 15, 15, true). - addController("Front center"). - addCasingInfo("Frost Proof Machine Casing", 900). - addEnergyHatch("Any casing", 1). - addMaintenanceHatch("Any casing", 1). - addInputHatch("Any casing", 1). - addOutputHatch("Any casing", 1). - addInputBus("Any casing", 1). - addOutputBus("Any casing", 1). - toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); + tt.addMachineType("Vacuum Freezer") + .addInfo("Controller Block for the Mega Vacuum Freezer") + .addInfo("Cools hot ingots and cells") + .addSeparator() + .beginStructureBlock(15, 15, 15, true) + .addController("Front center") + .addCasingInfo("Frost Proof Machine Casing", 900) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addInputHatch("Any casing", 1) + .addOutputHatch("Any casing", 1) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTWORKS); return tt; } @@ -149,7 +400,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); + return new GT_GUIContainer_MultiMachine( + aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "VacuumFreezer.png"); } @Override @@ -159,11 +411,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc ArrayList<ItemStack> outputItems = new ArrayList<>(); ArrayList<FluidStack> outputFluids = new ArrayList<>(); - long nominalV = LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); + long nominalV = + LoaderReference.tectech ? TecTechUtils.getnominalVoltageTT(this) : BW_Util.getnominalVoltage(this); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(nominalV), V.length - 1)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe(this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.findRecipe( + this.getBaseMetaTileEntity(), false, V[tTier], tInputFluids, tInputs); boolean found_Recipe = false; int processed = 0; @@ -184,9 +438,8 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.mEfficiencyIncrease = 10000; long actualEUT = (long) (tRecipe.mEUt) * processed; calculateOverclockedNessMulti((int) actualEUT, tRecipe.mDuration, nominalV); - //In case recipe is too OP for that machine - if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) - return false; + // In case recipe is too OP for that machine + if (this.mMaxProgresstime == Integer.MAX_VALUE - 1 && this.lEUt == Integer.MAX_VALUE - 1) return false; if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } @@ -200,8 +453,6 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc return false; } - - // -------------- TEC TECH COMPAT ---------------- @Override @@ -211,34 +462,55 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_TileEntity_MegaMultiBloc this.getTecTechEnergyTunnels().clear(); } this.mCasing = 0; - if(!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) - return false; - return - this.mMaintenanceHatches.size() == 1 && - (LoaderReference.tectech ? - (!this.getTecTechEnergyMultis().isEmpty() || !this.getTecTechEnergyTunnels().isEmpty() || !this.mEnergyHatches.isEmpty()) : - !this.mEnergyHatches.isEmpty()) && - this.mCasing >= 900; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 7, 7, 0)) return false; + return this.mMaintenanceHatches.size() == 1 + && (LoaderReference.tectech + ? (!this.getTecTechEnergyMultis().isEmpty() + || !this.getTecTechEnergyTunnels().isEmpty() + || !this.mEnergyHatches.isEmpty()) + : !this.mEnergyHatches.isEmpty()) + && this.mCasing >= 900; } - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { ITexture[] rTexture; if (aSide == aFacing) { if (aActive) { - rTexture = new ITexture[]{ + rTexture = new ITexture[] { casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE_GLOW) + .extFacing() + .glow() + .build() + }; } else { - rTexture = new ITexture[]{ + rTexture = new ITexture[] { casingTexturePages[0][17], - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER).extFacing().build(), - TextureFactory.builder().addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW).extFacing().glow().build()}; + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER) + .extFacing() + .build(), + TextureFactory.builder() + .addIcon(OVERLAY_FRONT_VACUUM_FREEZER_GLOW) + .extFacing() + .glow() + .build() + }; } } else { - rTexture = new ITexture[]{casingTexturePages[0][17]}; + rTexture = new ITexture[] {casingTexturePages[0][17]}; } return rTexture; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index e22641040f..044a53105b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -37,8 +37,9 @@ import net.minecraft.util.StatCollector; public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGenerator { - public GT_MetaTileEntity_AcidGenerator(int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { - super(aID, aName, aNameRegional, aTier, new String[]{}, aTextures); + public GT_MetaTileEntity_AcidGenerator( + int aID, String aName, String aNameRegional, int aTier, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, new String[] {}, aTextures); } public GT_MetaTileEntity_AcidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { @@ -66,43 +67,81 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public ITexture[] getFront(byte aColor) { - return new ITexture[]{super.getFront(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFront(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; } public ITexture[] getBack(byte aColor) { - return new ITexture[]{super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBack(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getBottom(byte aColor) { - return new ITexture[]{super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBottom(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getTop(byte aColor) { - return new ITexture[]{super.getTop(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")).glow().build()}; + return new ITexture[] { + super.getTop(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow() + .build() + }; } public ITexture[] getSides(byte aColor) { - return new ITexture[]{super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getSides(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getFrontActive(byte aColor) { - return new ITexture[]{super.getFrontActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + return new ITexture[] { + super.getFrontActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; } public ITexture[] getBackActive(byte aColor) { - return new ITexture[]{super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBackActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getBottomActive(byte aColor) { - return new ITexture[]{super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getBottomActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public ITexture[] getTopActive(byte aColor) { - return new ITexture[]{super.getTopActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()}; + return new ITexture[] { + super.getTopActive(aColor)[0], + TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL), + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build() + }; } public ITexture[] getSidesActive(byte aColor) { - return new ITexture[]{super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD)}; + return new ITexture[] { + super.getSidesActive(aColor)[0], TextureFactory.of(Textures.BlockIcons.MACHINE_CASING_ACIDHAZARD) + }; } public boolean isOutputFacing(byte aSide) { @@ -110,6 +149,16 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene } public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), + StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + + GT_Values.V[this.mTier], + StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + + this.getEfficiency(), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + + this.maxAmperesOut(), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index c477f88460..2bba0d833e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -60,17 +60,91 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { private static final int INCUBATION_MODULE = 5; public GT_MetaTileEntity_BioLab(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, (String) null, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, null, TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")).glow().build()/*this is topactive*/), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")).glow().build()/*this is top*/), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")).glow().build()), TextureFactory.of(TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), TextureFactory.builder().addIcon(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")).glow().build())); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + (String) null, + 6, + 2, + GT_MetaTileEntity_BioLab.MGUINAME, + null, + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/fluid_extractor/OVERLAY_SIDE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/fluid_extractor/OVERLAY_SIDE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/microwave/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/microwave/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/microwave/OVERLAY_FRONT_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_ACTIVE_GLOW")) + .glow() + .build() /*this is topactive*/), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/chemical_reactor/OVERLAY_FRONT")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/chemical_reactor/OVERLAY_FRONT_GLOW")) + .glow() + .build() /*this is top*/), + TextureFactory.of( + TextureFactory.of( + new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/polarizer/OVERLAY_BOTTOM_ACTIVE_GLOW")) + .glow() + .build()), + TextureFactory.of( + TextureFactory.of(new Textures.BlockIcons.CustomIcon("basicmachines/polarizer/OVERLAY_BOTTOM")), + TextureFactory.builder() + .addIcon(new Textures.BlockIcons.CustomIcon( + "basicmachines/polarizer/OVERLAY_BOTTOM_GLOW")) + .glow() + .build())); } - public GT_MetaTileEntity_BioLab(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { + public GT_MetaTileEntity_BioLab( + String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, String aNEIName) { super(aName, aTier, aAmperage, aDescription, aTextures, 6, 2, GT_MetaTileEntity_BioLab.MGUINAME, aNEIName); } @Override @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); + return new GT_MetaTileEntity_BioLab( + this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); } @Override @@ -87,25 +161,40 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { public int checkRecipe(boolean skipOC) { int rTier = 3; - FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L); + FluidStack dnaFluid = LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L); if (this.getSpecialSlot() != null && this.getSpecialSlot().getItem() instanceof LabModule) { int damage = this.getSpecialSlot().getItemDamage(); switch (damage) { case DNA_EXTRACTION_MODULE: - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && this.mInventory[getInputSlot()].getItem() instanceof LabParts && this.mInventory[getInputSlot()].getItemDamage() == 0 && this.mInventory[getInputSlot()].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 1].getItemDamage() == 1 && this.mInventory[getInputSlot() + 1].getTagCompound() == null && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 && - GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) && - this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000 - ) { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && this.mInventory[getInputSlot()].getItem() instanceof LabParts + && this.mInventory[getInputSlot()].getItemDamage() == 0 + && this.mInventory[getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && this.mInventory[getInputSlot() + 1].getItem() instanceof LabParts + && this.mInventory[getInputSlot() + 1].getItemDamage() == 1 + && this.mInventory[getInputSlot() + 1].getTagCompound() == null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && this.mInventory[getInputSlot() + 2].getItem() instanceof LabParts + && this.mInventory[getInputSlot() + 2].getItemDamage() == 3 + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], Materials.Ethanol.getCells(1)) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA"); - if (DNABioDataTag == null) - return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA").getString("Name")); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); + NBTTagCompound DNABioDataTag = + this.mInventory[getInputSlot()].getTagCompound().getCompoundTag("DNA"); + if (DNABioDataTag == null) return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(this.mInventory[getInputSlot()] + .getTagCompound() + .getCompoundTag("DNA") + .getString("Name")); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); if (this.mTier < rTier + cultureDNABioData.getTier()) return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; @@ -118,146 +207,194 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 1000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); + this.mOutputItems[0] = + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(cultureDNABioData)); } this.mOutputItems[1] = GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(rTier + cultureDNABioData.getTier()), 500); return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } break; - case PCR_THERMOCYCLE_MODULE: { - if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && this.mInventory[getInputSlot()].getItem() instanceof LabParts && this.mInventory[getInputSlot()].getItemDamage() == 1 && this.mInventory[getInputSlot()].getTagCompound() != null && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) && - this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && this.mFluid.amount >= 1000) { - NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); - if (DNABioDataTag == null) - return super.checkRecipe(skipOC); - BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); + case PCR_THERMOCYCLE_MODULE: + { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && this.mInventory[getInputSlot()].getItem() instanceof LabParts + && this.mInventory[getInputSlot()].getItemDamage() == 1 + && this.mInventory[getInputSlot()].getTagCompound() != null + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], FluidLoader.BioLabFluidCells[0]) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[3]) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && this.mFluid.amount >= 1000) { + NBTTagCompound DNABioDataTag = this.mInventory[getInputSlot()].getTagCompound(); + if (DNABioDataTag == null) return super.checkRecipe(skipOC); + BioData cultureDNABioData = BioData.getBioDataFromName(DNABioDataTag.getString("Name")); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - - for (int i = 0; i < 4; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - this.mFluid.amount -= 1000; + for (int i = 0; i < 4; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); + this.mFluid.amount -= 1000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = Outp; - } else - this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + Behaviour_DataOrb.setDataName(Outp, cultureDNABioData.getName()); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = Outp; + } else this.mOutputItems[0] = ItemList.Tool_DataOrb.get(1L); + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(2L); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - } - } - break; - case PLASMID_SYNTHESIS_MODULE: { - ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); - Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - if ( - GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) && //checks if it is a Culture - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]).equals("DNA Sample") && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]).isEmpty())) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) && - this.mFluid != null && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 1000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 2; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.mFluid.amount -= 1000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - - } - break; - case TRANSFORMATION_MODULE: { - if ( - GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) && this.mInventory[getInputSlot()].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) && this.mInventory[getInputSlot() + 1].getTagCompound() != null && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) && - this.mFluid != null && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) && this.mFluid.amount >= 1000) { - BioData cultureDNABioData = BioData.getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); - BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag(this.mInventory[getInputSlot()].getTagCompound()); - if (cultureDNABioData == null || bioCulture == null) - return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; + break; + case PLASMID_SYNTHESIS_MODULE: + { + ItemStack inp2 = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); + Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility.areStacksEqual( + FluidLoader.BioLabFluidCells[1], this.mInventory[getInputSlot()]) + && // checks if it is a Culture + GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], ItemList.Tool_DataOrb.get(1L), true) + && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 2]) + .equals("DNA Sample") + && (!(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2]) + .isEmpty())) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], inp2) + && this.mFluid != null + && this.mFluid.isFluidEqual(dnaFluid) + && (this.mFluid.amount >= 1000)) { + BioData cultureDNABioData = BioData.getBioDataFromName( + Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 2])); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); + if (this.mTier < 1 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 2; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 1000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(1 + rTier + cultureDNABioData.getTier()), 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.mFluid.amount -= 1000; - bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + } + break; + case TRANSFORMATION_MODULE: + { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot()], BioItemList.getPetriDish(null), true) + && this.mInventory[getInputSlot()].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], BioItemList.getPlasmidCell(null), true) + && this.mInventory[getInputSlot() + 1].getTagCompound() != null + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], FluidLoader.BioLabFluidCells[2]) + && this.mFluid != null + && this.mFluid.isFluidEqual(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + && this.mFluid.amount >= 1000) { + BioData cultureDNABioData = + BioData.getBioDataFromNBTTag(this.mInventory[getInputSlot() + 1].getTagCompound()); + BioCulture bioCulture = BioCulture.getBioCultureFromNBTTag( + this.mInventory[getInputSlot()].getTagCompound()); + if (cultureDNABioData == null || bioCulture == null) return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 1000; + bioCulture = bioCulture.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + this.mOutputItems[0] = BioItemList.getPetriDish(bioCulture); + } + this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.mOutputItems[1] = ItemList.Cell_Universal_Fluid.get(1L); - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - } - break; - case CLONAL_CELLULAR_SYNTHESIS_MODULE: { - - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); + break; + case CLONAL_CELLULAR_SYNTHESIS_MODULE: + { + ItemStack Outp = ItemList.Tool_DataOrb.get(1L); + Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); - if ( - GT_Utility.isStackValid(this.mInventory[getInputSlot()]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) && - GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) && GT_Utility.areStacksEqual(this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) && - Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]).equals("DNA Sample") && this.mFluid.isFluidEqual(dnaFluid) && (this.mFluid.amount >= 8000)) { + if (GT_Utility.isStackValid(this.mInventory[getInputSlot()]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot()], BioItemList.getPetriDish(null)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 1]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 1], BioItemList.getOther(4)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 2]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 2], ItemList.Circuit_Chip_Stemcell.get(2L)) + && GT_Utility.isStackValid(this.mInventory[getInputSlot() + 3]) + && GT_Utility.areStacksEqual( + this.mInventory[getInputSlot() + 3], ItemList.Tool_DataOrb.get(1L), true) + && Behaviour_DataOrb.getDataTitle(this.mInventory[getInputSlot() + 3]) + .equals("DNA Sample") + && this.mFluid.isFluidEqual(dnaFluid) + && (this.mFluid.amount >= 8000)) { - BioData cultureDNABioData = BioData.getBioDataFromName(Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); - if (cultureDNABioData == null) - return super.checkRecipe(skipOC); - if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) - return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - for (int i = 0; i < 3; i++) { - if (this.mInventory[getInputSlot() + i] != null) - this.mInventory[getInputSlot() + i].stackSize--; - } - this.mFluid.amount -= 8000; - if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { - BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); - if (out == null) - return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; - out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); - this.mOutputItems[0] = BioItemList.getPetriDish(out); + BioData cultureDNABioData = BioData.getBioDataFromName( + Behaviour_DataOrb.getDataName(this.mInventory[getInputSlot() + 3])); + if (cultureDNABioData == null) return super.checkRecipe(skipOC); + if (this.mTier < 3 + rTier + cultureDNABioData.getTier()) + return GT_MetaTileEntity_BasicMachine.FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + for (int i = 0; i < 3; i++) { + if (this.mInventory[getInputSlot() + i] != null) + this.mInventory[getInputSlot() + i].stackSize--; + } + this.mFluid.amount -= 8000; + if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { + BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + if (out == null) return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; + out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); + this.mOutputItems[0] = BioItemList.getPetriDish(out); + } + this.calculateOverclockedNess( + BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); + return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - this.calculateOverclockedNess(BW_Util.getMachineVoltageFromTier(3 + rTier + cultureDNABioData.getTier()), 500); - return GT_MetaTileEntity_BasicMachine.FOUND_AND_SUCCESSFULLY_USED_RECIPE; } - } - break; + break; case INCUBATION_MODULE: default: break; @@ -268,6 +405,9 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { @Override public String[] getDescription() { - return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } 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 index 4105c99c3c..998b87a606 100644 --- 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 @@ -36,7 +36,8 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha this.mDescriptionArray[1] = "Capacity: 100000000L"; } - public GT_MetaTileEntity_CompressedFluidHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_CompressedFluidHatch( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -52,6 +53,7 @@ public class GT_MetaTileEntity_CompressedFluidHatch extends GT_MetaTileEntity_Ha @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_CompressedFluidHatch(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + 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_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index ee32f18f84..41bc0490c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -63,17 +63,14 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); - if (this.getBaseMetaTileEntity().getWorld().isRemote) - return; + if (this.getBaseMetaTileEntity().getWorld().isRemote) return; if (!aPlayer.isSneaking()) { --this.aAmps; - if (this.aAmps < 0) - this.aAmps = this.maxAmps; + if (this.aAmps < 0) this.aAmps = this.maxAmps; GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); - }else{ + } else { ++this.aAmps; - if (this.aAmps > this.maxAmps) - this.aAmps = 0; + if (this.aAmps > this.maxAmps) this.aAmps = 0; GT_Utility.sendChatToPlayer(aPlayer, "Max Amps: " + this.aAmps); } } @@ -108,30 +105,30 @@ public class GT_MetaTileEntity_Diode extends GT_MetaTileEntity_BasicHull { } private long getAmpsfromMeta(int meta) { - if (meta > ConfigHandler.IDOffset + GT_Values.VN.length && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) - return 2L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) - return 4L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) - return 8L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) - return 12L; - else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) - return 16L; - else - return 0L; + if (meta > ConfigHandler.IDOffset + GT_Values.VN.length + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 2) return 2L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 2 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 3) return 4L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 3 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 4) return 8L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 4 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 5) return 12L; + else if (meta > ConfigHandler.IDOffset + GT_Values.VN.length * 5 + && meta <= ConfigHandler.IDOffset + GT_Values.VN.length * 6) return 16L; + else return 0L; } @SuppressWarnings("deprecation") public String[] getDescription() { - return new String[]{ - this.mDescription, - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + - ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + - ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + - ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + this.mDescription, + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 49f89d1592..c7914e59cf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -42,7 +42,8 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_EnergyDistributor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_EnergyDistributor( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -72,15 +73,15 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans } public String[] getDescription() { - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " - + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " - + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesIn()), - StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " - + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.maxAmperesOut()), - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(GT_Values.V[this.mTier]), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesIn()), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + + GT_Utility.formatNumbers(this.maxAmperesOut()), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } - } 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 index 1aa313c19b..9478cdf222 100644 --- 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 @@ -34,7 +34,8 @@ public class GT_MetaTileEntity_GiantOutputHatch extends GT_MetaTileEntity_Hatch_ this.mDescriptionArray[1] = "Capacity: 100000000L"; } - public GT_MetaTileEntity_GiantOutputHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_GiantOutputHatch( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index 1ab44a530c..d82181ea08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.tiered; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; + import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.API.LoaderReference; @@ -42,16 +44,13 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.HashMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import java.util.HashMap; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; - public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private final int cap; @@ -64,7 +63,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { private static HashMap<Integer, Long> sievertDecayCache = new HashMap<>(); public GT_MetaTileEntity_RadioHatch(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[]{StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + ((aTier - 2) >= 2 ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}); + super(aID, aName, aNameRegional, aTier, 1, new String[] { + StatCollector.translateToLocal("tooltip.tile.radhatch.0.name"), + StatCollector.translateToLocal("tooltip.tile.tiereddsc.3.name") + " " + (aTier - 2) + " " + + ((aTier - 2) >= 2 + ? StatCollector.translateToLocal("tooltip.bw.kg.1.name") + : StatCollector.translateToLocal("tooltip.bw.kg.0.name")), + StatCollector.translateToLocal("tooltip.tile.radhatch.1.name"), + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }); this.cap = aTier - 2; } @@ -80,20 +87,15 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public static long calcDecayTicks(int x) { long ret = GT_MetaTileEntity_RadioHatch.sievertDecayCache.getOrDefault(x, 0L); - if (ret != 0) - return ret; - - if (x == 43) - ret = 5000; - else if (x == 61) - ret = 4500; - else if (x <= 100) - ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); - else - ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); + if (ret != 0) return ret; + + if (x == 43) ret = 5000; + else if (x == 61) ret = 4500; + else if (x <= 100) ret = MathUtils.ceilLong((8000D * Math.tanh(-x / 20D) + 8000D) * 1000D); + else ret = MathUtils.ceilLong(((8000D * Math.tanh(-x / 65D) + 8000D))); GT_MetaTileEntity_RadioHatch.sievertDecayCache.put(x, ret); - return ret;//*20; + return ret; // *20; } public int getSievert() { @@ -101,9 +103,8 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public short[] getColorForGUI() { - if (this.colorForGUI != null) - return this.colorForGUI; - return new short[]{0xFA, 0xFA, 0xFF}; + if (this.colorForGUI != null) return this.colorForGUI; + return new short[] {0xFA, 0xFA, 0xFF}; } public byte getMass() { @@ -116,21 +117,18 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { public void setCoverage(short coverage) { byte nu; - if (coverage > 100) - nu = 100; - else if (coverage < 0) - nu = 0; - else - nu = (byte) coverage; + if (coverage > 100) nu = 100; + else if (coverage < 0) nu = 0; + else nu = (byte) coverage; this.coverage = nu; } public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + return new ITexture[] {aBaseTexture, TextureFactory.of(Textures.BlockIcons.OVERLAY_PIPE_IN)}; } @Override @@ -140,8 +138,14 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - aPlayer.openGui(MainMod.MOD_ID, 2, this.getBaseMetaTileEntity().getWorld(), this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()); - //super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + aPlayer.openGui( + MainMod.MOD_ID, + 2, + this.getBaseMetaTileEntity().getWorld(), + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getYCoord(), + this.getBaseMetaTileEntity().getZCoord()); + // super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { @@ -154,15 +158,13 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public void updateSlots() { - if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) - this.mInventory[0] = null; + if (this.mInventory[0] != null && this.mInventory[0].stackSize <= 0) this.mInventory[0] = null; } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (this.getBaseMetaTileEntity().isServerSide()) { - if (this.mass > 0) - ++this.timer; + if (this.mass > 0) ++this.timer; if (this.mass > 0 && this.sievert > 0) { float decayTicks = GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert); @@ -176,41 +178,34 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } } - if(this.mass >= this.cap) - return; + if (this.mass >= this.cap) return; ItemStack lStack = this.mInventory[0]; isStackValidRadioMaterial(lStack, true); - } } - public boolean isStackValidRadioMaterial(ItemStack lStack) - { + public boolean isStackValidRadioMaterial(ItemStack lStack) { return isStackValidRadioMaterial(lStack, false); } - public boolean isStackValidRadioMaterial(ItemStack lStack, boolean use){ - if (lStack == null) - return false; + public boolean isStackValidRadioMaterial(ItemStack lStack, boolean use) { + if (lStack == null) return false; IRadMaterial radmat = null; - //gt++ compat - if (LoaderReference.miscutils) - radmat = RadioHatchCompat.GTppRadChecker(lStack); + // gt++ compat + if (LoaderReference.miscutils) radmat = RadioHatchCompat.GTppRadChecker(lStack); - //GT++ and BW Materials check + // GT++ and BW Materials check if (lStack.getItem() instanceof IRadMaterial || radmat != null) { - if (radmat == null) - radmat = ((IRadMaterial) lStack.getItem()); + if (radmat == null) radmat = ((IRadMaterial) lStack.getItem()); int sv = radmat.getRadiationLevel(lStack); int amount = radmat.getAmountOfMaterial(lStack); - if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) - BioVatLogicAdder.RadioHatch.MaxSV = sv; + if (sv > BioVatLogicAdder.RadioHatch.getMaxSv()) BioVatLogicAdder.RadioHatch.MaxSV = sv; if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { - if(use) { + if (use) { if (this.mass + amount <= this.cap) { String name = radmat.getNameForGUI(lStack); if (this.mass == 0 || this.material.equals(name)) { @@ -233,7 +228,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { for (ItemStack varStack : BioVatLogicAdder.RadioHatch.getIsSv().keySet()) { if (GT_Utility.areStacksEqual(varStack, lStack, true)) { - int amount = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack,0); + int amount = BioVatLogicAdder.RadioHatch.getIsKg().getOrDefault(varStack, 0); int sv = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); if ((this.mass == 0 || this.sievert == sv) && sv > 0 && amount > 0) { if (use) { @@ -241,10 +236,12 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { String name = StatCollector.translateToLocal(varStack.getUnlocalizedName()); if (this.mass == 0 || this.material.equals(name)) { this.mass += amount; - this.sievert = BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); + this.sievert = + BioVatLogicAdder.RadioHatch.getIsSv().get(varStack); this.mInventory[0].stackSize--; this.updateSlots(); - this.colorForGUI = BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); + this.colorForGUI = + BioVatLogicAdder.RadioHatch.getIsColor().get(varStack); this.material = name; return true; } @@ -258,16 +255,20 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { // Rest - //check material for general validity - if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { - //check orePrefix for general validity + // check material for general validity + if (GT_OreDictUnificator.getAssociation(lStack) != null + && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null + && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + // check orePrefix for general validity if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; - //check orePrefix for specialised validity + // check orePrefix for specialised validity if (orePrefixes.equals(OrePrefixes.stickLong) || orePrefixes.equals(OrePrefixes.stick)) { Materials materials = GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial; - //check material for specialised validity - if (materials.getProtons() >= 83 && materials.getProtons() != 125 || materials.getProtons() == 61 || materials.getProtons() == 43) { + // check material for specialised validity + if (materials.getProtons() >= 83 && materials.getProtons() != 125 + || materials.getProtons() == 61 + || materials.getProtons() == 43) { if (use) { int sv = calculateSv(materials); int amount = (orePrefixes.equals(OrePrefixes.stickLong) ? 2 : 1); @@ -303,24 +304,40 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { @Override public String[] getInfoData() { if (this.sievert != 0) - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, - StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, - StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + - StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + "/" + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 + - StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + "/" + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 + - StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + "/" + - ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) / 20 / 60 / 60 + - StatCollector.translateToLocal("tooltip.tile.radhatch.9.name")}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + this.material, + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + this.sievert, + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + this.mass, + StatCollector.translateToLocal("tooltip.tile.radhatch.5.name") + " " + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert) * 60)) + + StatCollector.translateToLocal("tooltip.tile.radhatch.6.name") + + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) + / 20 + + StatCollector.translateToLocal("tooltip.tile.radhatch.7.name") + + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) + / 20 + / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.8.name") + + "/" + + ((GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert)) + - this.timer % (GT_MetaTileEntity_RadioHatch.calcDecayTicks(this.sievert))) + / 20 + / 60 + / 60 + + StatCollector.translateToLocal("tooltip.tile.radhatch.9.name") + }; else - return new String[]{ - StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + StatCollector.translateToLocal("tooltip.bw.empty.name"), - StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", - StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0"}; + return new String[] { + StatCollector.translateToLocal("tooltip.tile.radhatch.2.name") + " " + + StatCollector.translateToLocal("tooltip.bw.empty.name"), + StatCollector.translateToLocal("tooltip.tile.radhatch.3.name") + " " + "0", + StatCollector.translateToLocal("tooltip.tile.radhatch.4.name") + " " + "0" + }; } public boolean isSimpleMachine() { @@ -344,8 +361,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (aSide == this.getBaseMetaTileEntity().getFrontFacing() && - isStackValidRadioMaterial(aStack)); + return (aSide == this.getBaseMetaTileEntity().getFrontFacing() && isStackValidRadioMaterial(aStack)); } public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { @@ -362,8 +378,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { aNBT.setByte("mSv", (byte) (this.sievert - 100)); aNBT.setByte("mCoverage", this.coverage); aNBT.setInteger("mTextColor", BW_ColorUtil.getColorFromRGBArray(this.getColorForGUI())); - if (this.material != null && !this.material.isEmpty()) - aNBT.setString("mMaterial", this.material); + if (this.material != null && !this.material.isEmpty()) aNBT.setString("mMaterial", this.material); aNBT.setLong("timer", this.timer); super.saveNBTData(aNBT); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index d5afddb264..90fd02b3e2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -37,11 +37,13 @@ import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachineBlock { boolean powered; - public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Transistor( + int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } - public GT_MetaTileEntity_Transistor(int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + public GT_MetaTileEntity_Transistor( + int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 0, aDescription, aTextures); } @@ -58,18 +60,54 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; - rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; - rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier]}; - rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; + rTextures[0][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + rTextures[1][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + rTextures[2][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + rTextures[3][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[4][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[5][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[6][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] + }; + rTextures[7][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] + }; + rTextures[8][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[this.mTier] + }; + rTextures[9][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[10][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[11][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; } return rTextures; @@ -81,9 +119,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public void saveNBTData(NBTTagCompound nbtTagCompound) { - - } + public void saveNBTData(NBTTagCompound nbtTagCompound) {} public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { @@ -95,7 +131,8 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin return; } IBasicEnergyContainer tileAtSide = (IBasicEnergyContainer) tTileEntity; - if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) || !tileAtSide.isUniversalEnergyStored(4L)) { + if (!tileAtSide.outputsEnergyTo((byte) ForgeDirection.WEST.flag) + || !tileAtSide.isUniversalEnergyStored(4L)) { this.powered = false; return; } @@ -108,8 +145,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } } - if (aBaseMetaTileEntity.isAllowedToWork()) - this.powered = !this.powered; + if (aBaseMetaTileEntity.isAllowedToWork()) this.powered = !this.powered; } } @@ -132,9 +168,7 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public void loadNBTData(NBTTagCompound nbtTagCompound) { - - } + public void loadNBTData(NBTTagCompound nbtTagCompound) {} @Override public boolean allowPullStack(IGregTechTileEntity iGregTechTileEntity, int i, byte b, ItemStack itemStack) { @@ -147,7 +181,8 @@ public class GT_MetaTileEntity_Transistor extends GT_MetaTileEntity_TieredMachin } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index d1dac08766..616219ef8c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -36,7 +36,11 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioLabHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage( + GT_Values.GT, + "NEIPlugins", + "register-crafting-handler", + "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -47,10 +51,12 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { } public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : getCache()) - if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) - arecipes.add(recipe); + if (NEI_BW_Config.checkRecipe(aResult, recipe.mOutputs)) arecipes.add(recipe); } else { super.loadCraftingRecipes(aResult); } @@ -58,10 +64,12 @@ public class BW_NEI_BioLabHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { for (CachedDefaultRecipe recipe : getCache()) - if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) - arecipes.add(recipe); + if (NEI_BW_Config.checkRecipe(aResult, recipe.mInputs)) arecipes.add(recipe); } else { super.loadUsageRecipes(aResult); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index c91568946a..1ae67d1360 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -34,19 +34,23 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - import java.awt.*; import java.util.Collections; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) { super(aRecipeMap); - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect( + new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier())); if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage( + GT_Values.GT, + "NEIPlugins", + "register-crafting-handler", + "gregtech@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); GuiUsageRecipe.usagehandlers.add(this); } @@ -61,27 +65,51 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { int[] lines = {base, base + 8, base + 16, base + 24, base + 32, base + 40, base + 48, base + 56, base + 64}; int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - String[] recipeDesc = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); + String[] recipeDesc = + ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc(); int tSpecial; if (recipeDesc == null) { if (tEUt != 0) { - drawText(10, lines[0], this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", -16777216); - drawText(10, lines[1], this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", -16777216); + drawText( + 10, + lines[0], + this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU", + -16777216); + drawText( + 10, + lines[1], + this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t", + -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, lines[2], this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - drawText(10, lines[3], this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), -16777216); + drawText( + 10, + lines[2], + this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + + " EU", + -16777216); + drawText( + 10, + lines[3], + this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage), + -16777216); } else { drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216); drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216); } } - if (tDuration > 0) { - drawText(10, lines[4], this.trans("158", "Time: ") + GT_Utility.formatNumbers(0.05d * tDuration) + this.trans("161", " secs"), -16777216); + drawText( + 10, + lines[4], + this.trans("158", "Time: ") + + GT_Utility.formatNumbers(0.05d * tDuration) + + this.trans("161", " secs"), + -16777216); } - tSpecial = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; + tSpecial = + ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial); @@ -95,8 +123,18 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { drawText(10, lines[7], this.trans("160", "Needs Cleanroom & LowGrav"), -16777216); } else if (tSpecialA[1] == -400) { drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216); - } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { - drawText(10, lines[6], (tSpecialA[2] == 1 ? StatCollector.translateToLocal("nei.biovat.1.name") : StatCollector.translateToLocal("nei.biovat.2.name")) + this.mRecipeMap.mNEISpecialValuePre + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre) + || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) { + drawText( + 10, + lines[6], + (tSpecialA[2] == 1 + ? StatCollector.translateToLocal("nei.biovat.1.name") + : StatCollector.translateToLocal("nei.biovat.2.name")) + + this.mRecipeMap.mNEISpecialValuePre + + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier) + + this.mRecipeMap.mNEISpecialValuePost, + -16777216); } } else { tSpecial = 0; @@ -106,7 +144,6 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { ++tSpecial; } } - } private void loadLabPartRecipes(ItemStack aResult) { @@ -115,8 +152,7 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { // see constructor of CachedDefaultRecipe on why relx==120 and rely==52 means special slot for (PositionedStack stack : recipe.mInputs) { if (stack.relx == 120 && stack.rely == 52) { - if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) - arecipes.add(recipe); + if (NEI_BW_Config.checkRecipe(aResult, Collections.singletonList(stack))) arecipes.add(recipe); } } } @@ -124,7 +160,10 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadUsageRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { loadLabPartRecipes(aResult); } else { super.loadUsageRecipes(aResult); @@ -133,7 +172,10 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { @Override public void loadCraftingRecipes(ItemStack aResult) { - if (aResult != null && aResult.getItem() instanceof LabParts && aResult.getItemDamage() < 3 && aResult.getTagCompound() != null) { + if (aResult != null + && aResult.getItem() instanceof LabParts + && aResult.getItemDamage() < 3 + && aResult.getTagCompound() != null) { loadLabPartRecipes(aResult); } else { super.loadCraftingRecipes(aResult); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 8bb59713ae..727aa9fb97 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -36,20 +36,23 @@ import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.OrePrefixes; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; - import java.awt.*; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Objects; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; public class BW_NEI_OreHandler extends TemplateRecipeHandler { public BW_NEI_OreHandler() { if (!NEI_BW_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(MainMod.MOD_ID, "NEIPlugins", "register-crafting-handler", MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + FMLInterModComms.sendRuntimeMessage( + MainMod.MOD_ID, + "NEIPlugins", + "register-crafting-handler", + MainMod.MOD_ID + "@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); GuiCraftingRecipe.craftinghandlers.add(this); } } @@ -61,7 +64,8 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void loadTransferRects() { - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0,40,40,120),"quickanddirtyneihandler")); + this.transferRects.add( + new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(0, 40, 40, 120), "quickanddirtyneihandler")); } @Override @@ -73,10 +77,14 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equalsIgnoreCase("quickanddirtyneihandler")) { HashSet<ItemStack> result = new HashSet<>(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)).forEach(w -> result.add(w.get(OrePrefixes.ore))); + Werkstoff.werkstoffHashSet.stream() + .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + .forEach(w -> result.add(w.get(OrePrefixes.ore))); result.forEach(this::loadCraftingRecipes); result.clear(); - Werkstoff.werkstoffHashSet.stream().filter(w -> w.hasGenerationFeature(OrePrefixes.ore)).forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); + Werkstoff.werkstoffHashSet.stream() + .filter(w -> w.hasGenerationFeature(OrePrefixes.ore)) + .forEach(w -> result.add(w.get(OrePrefixes.oreSmall))); result.forEach(this::loadCraftingRecipes); result.clear(); HashSet<TemplateRecipeHandler.CachedRecipe> hashSet = new HashSet<>(this.arecipes); @@ -84,7 +92,7 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { this.arecipes.addAll(hashSet); } if (outputId.equals("item")) { - this.loadCraftingRecipes((ItemStack)results[0]); + this.loadCraftingRecipes((ItemStack) results[0]); HashSet<TemplateRecipeHandler.CachedRecipe> hashSet = new HashSet<>(this.arecipes); this.arecipes.clear(); this.arecipes.addAll(hashSet); @@ -93,42 +101,50 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { @Override public void drawExtras(int recipe) { - if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe) ) { - CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); - - if (cachedOreRecipe == null || cachedOreRecipe.getOtherStacks() == null || cachedOreRecipe.getOtherStacks().size() == 0) - return; - - if (!cachedOreRecipe.small) { - if (cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(0).item == null - || cachedOreRecipe.getOtherStacks().get(1) == null - || cachedOreRecipe.getOtherStacks().get(2) == null || cachedOreRecipe.getOtherStacks().get(3) == null || cachedOreRecipe.getOtherStacks().get(1).item == null - || cachedOreRecipe.getOtherStacks().get(2).item == null || cachedOreRecipe.getOtherStacks().get(3).item == null - ) - return; - } else if (cachedOreRecipe.getOtherStacks().get(0) == null || cachedOreRecipe.getOtherStacks().get(0).item == null) - return; - - if (cachedOreRecipe.worldGen != null) - GuiDraw.drawString(ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), 0, 40, 0, false); - - GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); - - if (!cachedOreRecipe.small) { - GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); - GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); - GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); - } else { - if (cachedOreRecipe.worldGen != null) { - GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); - GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); + if ((recipe < this.arecipes.size()) && (this.arecipes.get(recipe) instanceof CachedOreRecipe)) { + CachedOreRecipe cachedOreRecipe = (CachedOreRecipe) this.arecipes.get(recipe); + + if (cachedOreRecipe == null + || cachedOreRecipe.getOtherStacks() == null + || cachedOreRecipe.getOtherStacks().size() == 0) return; + + if (!cachedOreRecipe.small) { + if (cachedOreRecipe.getOtherStacks().get(0) == null + || cachedOreRecipe.getOtherStacks().get(0).item == null + || cachedOreRecipe.getOtherStacks().get(1) == null + || cachedOreRecipe.getOtherStacks().get(2) == null + || cachedOreRecipe.getOtherStacks().get(3) == null + || cachedOreRecipe.getOtherStacks().get(1).item == null + || cachedOreRecipe.getOtherStacks().get(2).item == null + || cachedOreRecipe.getOtherStacks().get(3).item == null) return; + } else if (cachedOreRecipe.getOtherStacks().get(0) == null + || cachedOreRecipe.getOtherStacks().get(0).item == null) return; + + if (cachedOreRecipe.worldGen != null) + GuiDraw.drawString( + ChatColorHelper.BOLD + "DIM: " + ChatColorHelper.RESET + cachedOreRecipe.worldGen.getDimName(), + 0, + 40, + 0, + false); + + GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false); + + if (!cachedOreRecipe.small) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "InBetween:", 0, 90, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(2).item.getDisplayName(), 0, 100, 0, false); + GuiDraw.drawString(ChatColorHelper.BOLD + "Sporadic:", 0, 110, 0, false); + GuiDraw.drawString(cachedOreRecipe.getOtherStacks().get(3).item.getDisplayName(), 0, 120, 0, false); + } else { + if (cachedOreRecipe.worldGen != null) { + GuiDraw.drawString(ChatColorHelper.BOLD + "Amount per Chunk:", 0, 70, 0, false); + GuiDraw.drawString(cachedOreRecipe.worldGen.mDensity + "", 0, 80, 0, false); + } } } - } super.drawExtras(recipe); } @@ -136,13 +152,12 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack result) { Block ore = Block.getBlockFromItem(result.getItem()); if (ore instanceof BW_MetaGenerated_Ores) { - BW_OreLayer.NEIMAP.get( - (short) result.getItemDamage()) - .stream() - .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) || - !(l.getClass().equals(BW_WorldGenRoss128b.class) || - l.getClass().equals(BW_WorldGenRoss128ba.class))) - .forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); + BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).stream() + .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) + || !(l.getClass().equals(BW_WorldGenRoss128b.class) + || l.getClass().equals(BW_WorldGenRoss128ba.class))) + .forEach(l -> this.arecipes.add( + new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres))); } } @@ -156,32 +171,33 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler { return "BartWorks Ores"; } - class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe{ + class CachedOreRecipe extends TemplateRecipeHandler.CachedRecipe { public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result, boolean smallOres) { this.worldGen = worldGen; this.stack = new PositionedStack(result, 0, 0); this.small = smallOres; } + boolean small; BW_OreLayer worldGen; PositionedStack stack; - @Override - public PositionedStack getResult() { - return this.stack; - } + @Override + public PositionedStack getResult() { + return this.stack; + } - @Override - public List<PositionedStack> getOtherStacks() { - List<PositionedStack> ret = new ArrayList<>(); - int x = 0; - for (int i = 0; i < (small ? 1 : 4); i++) { - x += 20; - ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); - } - return ret; + @Override + public List<PositionedStack> getOtherStacks() { + List<PositionedStack> ret = new ArrayList<>(); + int x = 0; + for (int i = 0; i < (small ? 1 : 4); i++) { + x += 20; + ret.add(new PositionedStack(worldGen.getStacks().get(i), x, 12)); } + return ret; + } @Override public boolean equals(Object o) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 92779481bb..fad6574627 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -54,18 +54,30 @@ public class NEI_BW_Config implements IConfigureNEI { API.hideItem(new ItemStack(FluidLoader.bioFluidBlock)); API.hideItem(new ItemStack(ItemRegistry.bw_fake_glasses)); ItemStack[] prefixesToHide = { - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite).copy(), - WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite).copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustTiny, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustSmall, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushed, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedCentrifuged, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.nugget, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemChipped, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawed, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemFlawless, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.gemExquisite, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustImpure, WerkstoffLoader.Bismutite) + .copy(), + WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dustPure, WerkstoffLoader.Bismutite) + .copy(), }; for (ItemStack stack : prefixesToHide) { stack.setItemDamage(Short.MAX_VALUE); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index a2943e67e1..c2125a8e70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -40,68 +40,66 @@ import net.minecraftforge.oredict.OreDictionary; public class ServerEventHandler { - //MinecraftForge.EVENT_BUS + // MinecraftForge.EVENT_BUS @SubscribeEvent(priority = EventPriority.LOWEST) public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { - if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) - return; - MainMod.BW_Network_instance.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); - MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity); + if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) return; + MainMod.BW_Network_instance.sendToPlayer( + new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity); + MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null), (EntityPlayerMP) event.entity); } - //FMLCommonHandler.instance().bus() + // FMLCommonHandler.instance().bus() @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) { - if (event == null || !(event.player instanceof EntityPlayerMP)) - return; + if (event == null || !(event.player instanceof EntityPlayerMP)) return; - if (event.player.worldObj.getTotalWorldTime() % 20 != 0) - return; + if (event.player.worldObj.getTotalWorldTime() % 20 != 0) return; boolean replace = false; ItemStack toReplace = null; for (int i = 0; i < event.player.inventory.mainInventory.length; i++) { - ItemStack stack = event.player.inventory.mainInventory[i]; - if (stack == null) - continue; - int[] oreIDs = OreDictionary.getOreIDs(stack); + ItemStack stack = event.player.inventory.mainInventory[i]; + if (stack == null) continue; + int[] oreIDs = OreDictionary.getOreIDs(stack); - if (oreIDs.length > 0){ - loop: for (int oreID : oreIDs) { - String oreDictName = OreDictionary.getOreName(oreID); - for (Werkstoff e : Werkstoff.werkstoffHashSet) { - replace = e.getGenerationFeatures().enforceUnification; - if (replace) { - if (oreDictName.contains(e.getVarName())) { - String prefix = oreDictName.replace(e.getVarName(), ""); - OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); - if (prefixes == null) { - continue; - } - toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); - break loop; - } else { - for (String s : e.getADDITIONAL_OREDICT()) { - if (oreDictName.contains(s)) { - String prefix = oreDictName.replace(s, ""); - OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); - if (prefixes == null) { - continue; - } - toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); - break loop; - } - } - } - } - replace = false; - } - } - } - if (replace && toReplace != null) { - event.player.inventory.setInventorySlotContents(i, toReplace); - replace = false; - } - } + if (oreIDs.length > 0) { + loop: + for (int oreID : oreIDs) { + String oreDictName = OreDictionary.getOreName(oreID); + for (Werkstoff e : Werkstoff.werkstoffHashSet) { + replace = e.getGenerationFeatures().enforceUnification; + if (replace) { + if (oreDictName.contains(e.getVarName())) { + String prefix = oreDictName.replace(e.getVarName(), ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; + } else { + for (String s : e.getADDITIONAL_OREDICT()) { + if (oreDictName.contains(s)) { + String prefix = oreDictName.replace(s, ""); + OrePrefixes prefixes = OrePrefixes.getPrefix(prefix); + if (prefixes == null) { + continue; + } + toReplace = GT_OreDictUnificator.get(prefixes, e.getVarName(), stack.stackSize); + break loop; + } + } + } + } + replace = false; + } + } + } + if (replace && toReplace != null) { + event.player.inventory.setInventorySlotContents(i, toReplace); + replace = false; + } + } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index ee959d878a..0d9cd5731b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -27,6 +27,8 @@ import com.github.bartimaeusnek.bartworks.server.container.Slots.BW_FuelSlot; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Slot_Render; +import java.nio.ByteBuffer; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -34,9 +36,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.nio.ByteBuffer; -import java.util.Iterator; - public class BW_Container_HeatedWaterPump extends Container { final BW_TileEntity_HeatedWaterPump TILE; @@ -79,8 +78,10 @@ public class BW_Container_HeatedWaterPump extends Container { slot.putStack(null); } } - } - else if (p_82846_2_ > 1 && slot.getStack() != null && ((Slot) this.inventorySlots.get(0)).getStack() == null && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())){ + } else if (p_82846_2_ > 1 + && slot.getStack() != null + && ((Slot) this.inventorySlots.get(0)).getStack() == null + && ((Slot) this.inventorySlots.get(0)).isItemValid(slot.getStack())) { ((Slot) this.inventorySlots.get(0)).putStack(slot.getStack()); slot.putStack(null); } @@ -91,8 +92,7 @@ public class BW_Container_HeatedWaterPump extends Container { @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); - if (this.TILE.getWorldObj().isRemote) - return; + if (this.TILE.getWorldObj().isRemote) return; this.fuel = this.TILE.fuel; this.maxfuel = this.TILE.maxfuel; @@ -101,8 +101,7 @@ public class BW_Container_HeatedWaterPump extends Container { this.netmaxfuel = ByteBuffer.allocate(8).putInt(this.maxfuel).array(); ++this.timer; Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) - this.timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; while (true) { do { if (!var2.hasNext()) { @@ -129,10 +128,8 @@ public class BW_Container_HeatedWaterPump extends Container { @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int packetID, int valure) { - if (this.netfuel == null) - this.netfuel = new byte[8]; - if (this.netmaxfuel == null) - this.netmaxfuel = new byte[8]; + if (this.netfuel == null) this.netfuel = new byte[8]; + if (this.netmaxfuel == null) this.netmaxfuel = new byte[8]; switch (packetID) { case 0: { this.water = valure; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 918713a50a..b53e3301db 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -25,6 +25,7 @@ package com.github.bartimaeusnek.bartworks.server.container; import com.github.bartimaeusnek.bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -33,8 +34,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.util.Iterator; - public class BW_Container_RadioHatch extends Container { public byte coverage, dcoverage; @@ -66,9 +65,7 @@ public class BW_Container_RadioHatch extends Container { } @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - - } + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {} @Override public String getInventoryName() { @@ -86,9 +83,7 @@ public class BW_Container_RadioHatch extends Container { } @Override - public void markDirty() { - - } + public void markDirty() {} @Override public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { @@ -96,14 +91,10 @@ public class BW_Container_RadioHatch extends Container { } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { @@ -128,12 +119,12 @@ public class BW_Container_RadioHatch extends Container { @Override @SuppressWarnings("rawtypes") public void detectAndSendChanges() { - if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { + if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() + && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { this.coverage = this.iGregTechTileEntity.getCoverage(); ++this.timer; Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) - this.timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; while (true) { do { if (!var2.hasNext()) { @@ -150,8 +141,7 @@ public class BW_Container_RadioHatch extends Container { @Override public void updateProgressBar(int p_75137_1_, int p_75137_2_) { - if (p_75137_1_ == 0) - this.coverage = (byte) p_75137_2_; + if (p_75137_1_ == 0) this.coverage = (byte) p_75137_2_; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java index fc11974864..f80986f198 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_Windmill.java @@ -33,7 +33,6 @@ public class BW_Container_Windmill extends GT_Container_MultiMachine { super(aInventoryPlayer, aTileEntity); } - public void addSlots(InventoryPlayer aInventoryPlayer) { this.addSlotToContainer(new Slot(this.mTileEntity, 1, 60, 36)); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 95ac8a9a09..bbb09a2c2a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -51,7 +51,7 @@ public class GT_Container_CircuitProgrammer extends Container { IInventory inv = new pinv(this.player); - this.addSlotToContainer(new Slot(inv, 0, 44, 61));//-45, 84)); + this.addSlotToContainer(new Slot(inv, 0, 44, 61)); // -45, 84)); for (int i = 1; i < 13; i++) { this.addSlotToContainer(new GT_Slot_Holo(inv, i, -64 + i * 18, 22, false, false, 1)); @@ -67,10 +67,10 @@ public class GT_Container_CircuitProgrammer extends Container { } for (int i = 0; i < 9; i++) { - if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) + if (GT_Utility.isStackValid(inventory.getStackInSlot(i)) + && inventory.getStackInSlot(i).getItem() instanceof Circuit_Programmer) this.addSlotToContainer(new GT_Slot_Render(inventory, i, 8 + i * 18, 142)); - else - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + else this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); } } @@ -97,7 +97,11 @@ public class GT_Container_CircuitProgrammer extends Container { Slot chipslot = (Slot) this.inventorySlots.get(0); if (SlotNR > 24) { Slot slot = (Slot) this.inventorySlots.get(SlotNR); - if (slot != null && slot.getStack() != null && slot.getStack().getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + if (slot != null + && slot.getStack() != null + && slot.getStack() + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem())) { if (chipslot.getStack() == null) { chipslot.putStack(slot.getStack().copy()); slot.decrStackSize(1); @@ -162,8 +166,12 @@ public class GT_Container_CircuitProgrammer extends Container { @Override public void setInventorySlotContents(int slotNR, ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem())) { - this.Slot = BW_Util.setStackSize(itemStack.copy(),1); + if (itemStack != null + && itemStack.getItem() != null + && itemStack + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem())) { + this.Slot = BW_Util.setStackSize(itemStack.copy(), 1); itemStack.stackSize--; this.tag = this.toBind.getTagCompound(); this.tag.setBoolean("HasChip", true); @@ -171,8 +179,15 @@ public class GT_Container_CircuitProgrammer extends Container { this.toBind.setTagCompound(this.tag); this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) itemStack.getItemDamage())); - } else if (BW_Util.checkStackAndPrefix(itemStack) && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.equals(Materials.Basic)) { + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( + this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) + itemStack.getItemDamage())); + } else if (BW_Util.checkStackAndPrefix(itemStack) + && GT_OreDictUnificator.getAssociation(itemStack).mPrefix.equals(OrePrefixes.circuit) + && GT_OreDictUnificator.getAssociation(itemStack) + .mMaterial + .mMaterial + .equals(Materials.Basic)) { this.Slot = GT_Utility.getIntegratedCircuit(0); this.Slot.stackSize = 1; itemStack.stackSize--; @@ -182,19 +197,21 @@ public class GT_Container_CircuitProgrammer extends Container { this.toBind.setTagCompound(this.tag); this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); - }/* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { - ForgeHooks.onPlayerTossEvent(Player, itemStack, false); - this.closeInventory(); - Player.closeScreen(); - }*/ else { + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( + this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), true, (byte) 0)); + } /* else if (GT_Utility.isStackValid(itemStack) && itemStack.getItem() instanceof Circuit_Programmer) { + ForgeHooks.onPlayerTossEvent(Player, itemStack, false); + this.closeInventory(); + Player.closeScreen(); + }*/ else { ForgeHooks.onPlayerTossEvent(this.Player, itemStack, false); this.tag = this.toBind.getTagCompound(); this.tag.setBoolean("HasChip", false); this.toBind.setTagCompound(this.tag); this.Player.inventory.setInventorySlotContents(this.Player.inventory.currentItem, this.toBind); if (!this.Player.isClientWorld()) - MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket(this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); + MainMod.BW_Network_instance.sendToServer(new CircuitProgrammerPacket( + this.Player.worldObj.provider.dimensionId, this.Player.getEntityId(), false, (byte) 0)); } } @@ -214,9 +231,7 @@ public class GT_Container_CircuitProgrammer extends Container { } @Override - public void markDirty() { - - } + public void markDirty() {} @Override public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { @@ -224,19 +239,17 @@ public class GT_Container_CircuitProgrammer extends Container { } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemStack) { - return itemStack != null && itemStack.getItem().equals(GT_Utility.getIntegratedCircuit(0).getItem()); + return itemStack != null + && itemStack + .getItem() + .equals(GT_Utility.getIntegratedCircuit(0).getItem()); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 7f82680495..60f849e766 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -63,4 +63,4 @@ public class GT_Container_Item_Destructopack extends Container { Slot slotObject = (Slot) this.inventorySlots.get(0); slotObject.decrStackSize(0); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 5541256158..198ff69c23 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -53,5 +53,4 @@ public class GT_Container_LESU extends GT_Container_MultiMachine { public int getShiftClickSlotCount() { return 6; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index 9d89ad03b3..855d73bb75 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -27,6 +27,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.nio.ByteBuffer; +import java.util.Iterator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -34,9 +36,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import java.nio.ByteBuffer; -import java.util.Iterator; - public class GT_Container_RadioHatch extends GT_Container_1by1 { public byte mass, dmass; @@ -68,8 +67,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { this.teTimer = ByteBuffer.allocate(8).putLong(this.TE.getTimer()).array(); ++this.timer; Iterator var2 = this.crafters.iterator(); - if (this.timer >= Long.MAX_VALUE - 1) - this.timer = 0; + if (this.timer >= Long.MAX_VALUE - 1) this.timer = 0; while (true) { do { if (!var2.hasNext()) { @@ -88,25 +86,20 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { var1.sendProgressBarUpdate(this, 21, this.mass); if (this.timer % 500 == 10 || this.dsievert != this.sievert) var1.sendProgressBarUpdate(this, 22, (this.sievert - 100)); - if (this.timer % 500 == 10 || this.dr != this.r) - var1.sendProgressBarUpdate(this, 23, this.r); - if (this.timer % 500 == 10 || this.dg != this.g) - var1.sendProgressBarUpdate(this, 24, this.g); - if (this.timer % 500 == 10 || this.db != this.b) - var1.sendProgressBarUpdate(this, 25, this.b); + if (this.timer % 500 == 10 || this.dr != this.r) var1.sendProgressBarUpdate(this, 23, this.r); + if (this.timer % 500 == 10 || this.dg != this.g) var1.sendProgressBarUpdate(this, 24, this.g); + if (this.timer % 500 == 10 || this.db != this.b) var1.sendProgressBarUpdate(this, 25, this.b); if (this.timer % 500 == 10 || this.dteTimer != this.teTimer) for (int i = 0; i < this.teTimer.length; i++) { var1.sendProgressBarUpdate(this, 26 + i, this.teTimer[i]); } - if (this.timer % 500 == 10 || this.dsv != this.sv) - var1.sendProgressBarUpdate(this, 34, this.sv); + if (this.timer % 500 == 10 || this.dsv != this.sv) var1.sendProgressBarUpdate(this, 34, this.sv); } while (this.timer % 500 != 10 && this.dmass == this.mass); } } } - @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { super.updateProgressBar(par1, par2); @@ -162,28 +155,25 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { // Handle shift-clicking @Override - public ItemStack transferStackInSlot(EntityPlayer player, int id){ - Slot slot = (Slot)this.inventorySlots.get(id); + public ItemStack transferStackInSlot(EntityPlayer player, int id) { + Slot slot = (Slot) this.inventorySlots.get(id); ItemStack stack = slot.getStack(); - if(stack == null) - return null; - if(slot instanceof RadioSlot) + if (stack == null) return null; + if (slot instanceof RadioSlot) return super.transferStackInSlot(player, id); + else if (((GT_MetaTileEntity_RadioHatch) this.mTileEntity.getMetaTileEntity()).isStackValidRadioMaterial(stack)) return super.transferStackInSlot(player, id); - else if (((GT_MetaTileEntity_RadioHatch)this.mTileEntity.getMetaTileEntity()).isStackValidRadioMaterial(stack)) - return super.transferStackInSlot(player, id); - else - return null; + else return null; } - private static class RadioSlot extends Slot{ + private static class RadioSlot extends Slot { public RadioSlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); } @Override public boolean isItemValid(ItemStack p_75214_1_) { - return ((GT_MetaTileEntity_RadioHatch)((IGregTechTileEntity)this.inventory).getMetaTileEntity()).isStackValidRadioMaterial(p_75214_1_); + return ((GT_MetaTileEntity_RadioHatch) ((IGregTechTileEntity) this.inventory).getMetaTileEntity()) + .isStackValidRadioMaterial(p_75214_1_); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java index 3ce3219bde..1ebf203610 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -36,6 +36,4 @@ public class BW_DelSlot extends Slot { p_75215_1_ = null; this.onSlotChanged(); } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java index 7bfb9a9234..d898826ed9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_GT_MaterialReference.java @@ -21,626 +21,948 @@ */ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; + import com.github.bartimaeusnek.bartworks.MainMod; import gregtech.api.enums.Materials; -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.Types.*; - public class BW_GT_MaterialReference { - private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = new Werkstoff.GenerationFeatures().disable().addCasings(); + private static final Werkstoff.GenerationFeatures ADD_CASINGS_ONLY = + new Werkstoff.GenerationFeatures().disable().addCasings(); - public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT,31_766+19); - public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT,31_766+103); - public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766+58); -// public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); - public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766+39); - public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766+63); - public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766+8); - public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766+90); - public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766+9); - public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766+62); -// public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); - public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766+10); - public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+55); - public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766+65); -// public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); - public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766+30); - public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766+33); - public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766+35); -// public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); - public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766+73); -// public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); - public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+75); - public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766+70); -// public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); - public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766+71); - public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766+37); - public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766+86); - public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+74); -// public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); -// public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); -// public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); - public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766+56); - public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766+84); - public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766+32); - public static Werkstoff Lanthanum = new Werkstoff(Materials.Lanthanum, ADD_CASINGS_ONLY, ELEMENT, 31_766+64); - public static Werkstoff Lead = new Werkstoff(Materials.Lead, ADD_CASINGS_ONLY, ELEMENT, 31_766+89); - public static Werkstoff Lithium = new Werkstoff(Materials.Lithium, ADD_CASINGS_ONLY, ELEMENT, 31_766+6); - public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766+78); - public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766+18); - public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766+31); -// public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); - public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766+48); - public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766+67); - public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT,31_766+129); - public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766+34); - public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766+47); -// public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); - public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766+83); -// public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); - public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766+52); - public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766+21); - public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766+85); - public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT,31_766+100); - public static Werkstoff Plutonium241 = new Werkstoff(Materials.Plutonium241, ADD_CASINGS_ONLY, ISOTOPE,31_766+101); - public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766+25); - public static Werkstoff Praseodymium = new Werkstoff(Materials.Praseodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766+66); - public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766+68); -// public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); - public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766+43); - public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766+69); - public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766+27); - public static Werkstoff Silicon = new Werkstoff(Materials.Silicon, ADD_CASINGS_ONLY, ELEMENT, 31_766+20); - public static Werkstoff Silver = new Werkstoff(Materials.Silver, ADD_CASINGS_ONLY, ELEMENT, 31_766+54); - public static Werkstoff Sodium = new Werkstoff(Materials.Sodium, ADD_CASINGS_ONLY, ELEMENT, 31_766+17); - public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766+44); - public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766+22); - public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766+80); -// public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); - public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+72); - public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766+96); - public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766+76); - public static Werkstoff Tin = new Werkstoff(Materials.Tin, ADD_CASINGS_ONLY, ELEMENT, 31_766+57); - public static Werkstoff Titanium = new Werkstoff(Materials.Titanium, ADD_CASINGS_ONLY, ELEMENT, 31_766+28); - public static Werkstoff Tritanium = new Werkstoff(Materials.Tritanium, ADD_CASINGS_ONLY, ELEMENT,31_766+329); - public static Werkstoff Tritium = new Werkstoff(Materials.Tritium, ADD_CASINGS_ONLY, ELEMENT, 31_766+3); - public static Werkstoff Tungsten = new Werkstoff(Materials.Tungsten, ADD_CASINGS_ONLY, ELEMENT, 31_766+81); - public static Werkstoff Uranium = new Werkstoff(Materials.Uranium, ADD_CASINGS_ONLY, ELEMENT, 31_766+98); - public static Werkstoff Uranium235 = new Werkstoff(Materials.Uranium235, ADD_CASINGS_ONLY, ISOTOPE, 31_766+97); - public static Werkstoff Vanadium = new Werkstoff(Materials.Vanadium, ADD_CASINGS_ONLY, ELEMENT, 31_766+29); - public static Werkstoff Ytterbium = new Werkstoff(Materials.Ytterbium, ADD_CASINGS_ONLY, ELEMENT, 31_766+77); - public static Werkstoff Yttrium = new Werkstoff(Materials.Yttrium, ADD_CASINGS_ONLY, ELEMENT, 31_766+45); - public static Werkstoff Zinc = new Werkstoff(Materials.Zinc, ADD_CASINGS_ONLY, ELEMENT, 31_766+36); - public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT,31_766+382); - public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT,31_766+324); - public static Werkstoff NaquadahAlloy = new Werkstoff(Materials.NaquadahAlloy, ADD_CASINGS_ONLY, COMPOUND,31_766+325); - public static Werkstoff NaquadahEnriched = new Werkstoff(Materials.NaquadahEnriched, ADD_CASINGS_ONLY, ISOTOPE,31_766+326); - public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT,31_766+327); - public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE,31_766+304); - public static Werkstoff AnnealedCopper = new Werkstoff(Materials.AnnealedCopper, ADD_CASINGS_ONLY, ISOTOPE,31_766+345); + public static Werkstoff Aluminium = new Werkstoff(Materials.Aluminium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 19); + public static Werkstoff Americium = new Werkstoff(Materials.Americium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 103); + public static Werkstoff Antimony = new Werkstoff(Materials.Antimony, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 58); + // public static Werkstoff Argon = new Werkstoff(Materials.Argon, ADD_CASINGS_ONLY, ELEMENT, 31_766+24); + public static Werkstoff Arsenic = new Werkstoff(Materials.Arsenic, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 39); + public static Werkstoff Barium = new Werkstoff(Materials.Barium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 63); + public static Werkstoff Beryllium = new Werkstoff(Materials.Beryllium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 8); + public static Werkstoff Bismuth = new Werkstoff(Materials.Bismuth, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 90); + public static Werkstoff Boron = new Werkstoff(Materials.Boron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 9); + public static Werkstoff Caesium = new Werkstoff(Materials.Caesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 62); + // public static Werkstoff Calcium = new Werkstoff(Materials.Calcium, ADD_CASINGS_ONLY, ELEMENT, 31_766+26); + public static Werkstoff Carbon = new Werkstoff(Materials.Carbon, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 10); + public static Werkstoff Cadmium = new Werkstoff(Materials.Cadmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 55); + public static Werkstoff Cerium = new Werkstoff(Materials.Cerium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 65); + // public static Werkstoff Chlorine = new Werkstoff(Materials.Chlorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+23); + public static Werkstoff Chrome = new Werkstoff(Materials.Chrome, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 30); + public static Werkstoff Cobalt = new Werkstoff(Materials.Cobalt, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 33); + public static Werkstoff Copper = new Werkstoff(Materials.Copper, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 35); + // public static Werkstoff Deuterium = new Werkstoff(Materials.Deuterium, ADD_CASINGS_ONLY, ELEMENT, 31_766+2); + public static Werkstoff Dysprosium = new Werkstoff(Materials.Dysprosium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 73); + // public static Werkstoff Empty = new Werkstoff(Materials.Empty, ADD_CASINGS_ONLY, ELEMENT, 31_766+0); + public static Werkstoff Erbium = new Werkstoff(Materials.Erbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 75); + public static Werkstoff Europium = new Werkstoff(Materials.Europium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 70); + // public static Werkstoff Fluorine = new Werkstoff(Materials.Fluorine, ADD_CASINGS_ONLY, ELEMENT, 31_766+14); + public static Werkstoff Gadolinium = new Werkstoff(Materials.Gadolinium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 71); + public static Werkstoff Gallium = new Werkstoff(Materials.Gallium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 37); + public static Werkstoff Gold = new Werkstoff(Materials.Gold, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 86); + public static Werkstoff Holmium = new Werkstoff(Materials.Holmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 74); + // public static Werkstoff Hydrogen = new Werkstoff(Materials.Hydrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+1); + // public static Werkstoff Helium = new Werkstoff(Materials.Helium, ADD_CASINGS_ONLY, ELEMENT, 31_766+4); + // public static Werkstoff Helium_3 = new Werkstoff(Materials.Helium_3, ADD_CASINGS_ONLY, ELEMENT, 31_766+5); + public static Werkstoff Indium = new Werkstoff(Materials.Indium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 56); + public static Werkstoff Iridium = new Werkstoff(Materials.Iridium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 84); + public static Werkstoff Iron = new Werkstoff(Materials.Iron, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 32); + public static Werkstoff Lanthanum = new Werkstoff(Materials.Lanthanum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 64); + public static Werkstoff Lead = new Werkstoff(Materials.Lead, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 89); + public static Werkstoff Lithium = new Werkstoff(Materials.Lithium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 6); + public static Werkstoff Lutetium = new Werkstoff(Materials.Lutetium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 78); + public static Werkstoff Magnesium = new Werkstoff(Materials.Magnesium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 18); + public static Werkstoff Manganese = new Werkstoff(Materials.Manganese, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 31); + // public static Werkstoff Mercury = new Werkstoff(Materials.Mercury, ADD_CASINGS_ONLY, ELEMENT, 31_766+87); + public static Werkstoff Molybdenum = new Werkstoff(Materials.Molybdenum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 48); + public static Werkstoff Neodymium = new Werkstoff(Materials.Neodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 67); + public static Werkstoff Neutronium = new Werkstoff(Materials.Neutronium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 129); + public static Werkstoff Nickel = new Werkstoff(Materials.Nickel, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 34); + public static Werkstoff Niobium = new Werkstoff(Materials.Niobium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 47); + // public static Werkstoff Nitrogen = new Werkstoff(Materials.Nitrogen, ADD_CASINGS_ONLY, ELEMENT, 31_766+12); + public static Werkstoff Osmium = new Werkstoff(Materials.Osmium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 83); + // public static Werkstoff Oxygen = new Werkstoff(Materials.Oxygen, ADD_CASINGS_ONLY, ELEMENT, 31_766+13); + public static Werkstoff Palladium = new Werkstoff(Materials.Palladium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 52); + public static Werkstoff Phosphorus = new Werkstoff(Materials.Phosphorus, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 21); + public static Werkstoff Platinum = new Werkstoff(Materials.Platinum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 85); + public static Werkstoff Plutonium = new Werkstoff(Materials.Plutonium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 100); + public static Werkstoff Plutonium241 = + new Werkstoff(Materials.Plutonium241, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 101); + public static Werkstoff Potassium = new Werkstoff(Materials.Potassium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 25); + public static Werkstoff Praseodymium = + new Werkstoff(Materials.Praseodymium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 66); + public static Werkstoff Promethium = new Werkstoff(Materials.Promethium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 68); + // public static Werkstoff Radon = new Werkstoff(Materials.Radon, ADD_CASINGS_ONLY, ELEMENT, 31_766+93); + public static Werkstoff Rubidium = new Werkstoff(Materials.Rubidium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 43); + public static Werkstoff Samarium = new Werkstoff(Materials.Samarium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 69); + public static Werkstoff Scandium = new Werkstoff(Materials.Scandium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 27); + public static Werkstoff Silicon = new Werkstoff(Materials.Silicon, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 20); + public static Werkstoff Silver = new Werkstoff(Materials.Silver, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 54); + public static Werkstoff Sodium = new Werkstoff(Materials.Sodium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 17); + public static Werkstoff Strontium = new Werkstoff(Materials.Strontium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 44); + public static Werkstoff Sulfur = new Werkstoff(Materials.Sulfur, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 22); + public static Werkstoff Tantalum = new Werkstoff(Materials.Tantalum, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 80); + // public static Werkstoff Tellurium = new Werkstoff(Materials.Tellurium, ADD_CASINGS_ONLY, ELEMENT, 31_766+59); + public static Werkstoff Terbium = new Werkstoff(Materials.Terbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 72); + public static Werkstoff Thorium = new Werkstoff(Materials.Thorium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 96); + public static Werkstoff Thulium = new Werkstoff(Materials.Thulium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 76); + public static Werkstoff Tin = new Werkstoff(Materials.Tin, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 57); + public static Werkstoff Titanium = new Werkstoff(Materials.Titanium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 28); + public static Werkstoff Tritanium = new Werkstoff(Materials.Tritanium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 329); + public static Werkstoff Tritium = new Werkstoff(Materials.Tritium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 3); + public static Werkstoff Tungsten = new Werkstoff(Materials.Tungsten, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 81); + public static Werkstoff Uranium = new Werkstoff(Materials.Uranium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 98); + public static Werkstoff Uranium235 = new Werkstoff(Materials.Uranium235, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 97); + public static Werkstoff Vanadium = new Werkstoff(Materials.Vanadium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 29); + public static Werkstoff Ytterbium = new Werkstoff(Materials.Ytterbium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 77); + public static Werkstoff Yttrium = new Werkstoff(Materials.Yttrium, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 45); + public static Werkstoff Zinc = new Werkstoff(Materials.Zinc, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 36); + public static Werkstoff Ardite = new Werkstoff(Materials.Ardite, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 382); + public static Werkstoff Naquadah = new Werkstoff(Materials.Naquadah, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 324); + public static Werkstoff NaquadahAlloy = + new Werkstoff(Materials.NaquadahAlloy, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 325); + public static Werkstoff NaquadahEnriched = + new Werkstoff(Materials.NaquadahEnriched, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 326); + public static Werkstoff Naquadria = new Werkstoff(Materials.Naquadria, ADD_CASINGS_ONLY, ELEMENT, 31_766 + 327); + public static Werkstoff WroughtIron = new Werkstoff(Materials.WroughtIron, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 304); + public static Werkstoff AnnealedCopper = + new Werkstoff(Materials.AnnealedCopper, ADD_CASINGS_ONLY, ISOTOPE, 31_766 + 345); - public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE,31_766+317); - public static Werkstoff SterlingSilver = new Werkstoff(Materials.SterlingSilver, ADD_CASINGS_ONLY, MIXTURE,31_766+350); - public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE,31_766+351); - public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE,31_766+352); - public static Werkstoff BismuthBronze = new Werkstoff(Materials.BismuthBronze, ADD_CASINGS_ONLY, MIXTURE,31_766+353); - public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+334); - public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+348); - public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+349); - public static Werkstoff DamascusSteel = new Werkstoff(Materials.DamascusSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+335); - public static Werkstoff TungstenSteel = new Werkstoff(Materials.TungstenSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+316); - public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE,31_766+344); - public static Werkstoff TungstenCarbide = new Werkstoff(Materials.TungstenCarbide, ADD_CASINGS_ONLY, MIXTURE,31_766+370); - public static Werkstoff VanadiumSteel = new Werkstoff(Materials.VanadiumSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+371); - public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE,31_766+372); - public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE,31_766+373); - public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE,31_766+374); - public static Werkstoff StainlessSteel = new Werkstoff(Materials.StainlessSteel, ADD_CASINGS_ONLY, MIXTURE,31_766+306); - public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE,31_766+301); - public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE,31_766+300); + public static Werkstoff Osmiridium = new Werkstoff(Materials.Osmiridium, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 317); + public static Werkstoff SterlingSilver = + new Werkstoff(Materials.SterlingSilver, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 350); + public static Werkstoff RoseGold = new Werkstoff(Materials.RoseGold, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 351); + public static Werkstoff BlackBronze = new Werkstoff(Materials.BlackBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 352); + public static Werkstoff BismuthBronze = + new Werkstoff(Materials.BismuthBronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 353); + public static Werkstoff BlackSteel = new Werkstoff(Materials.BlackSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 334); + public static Werkstoff RedSteel = new Werkstoff(Materials.RedSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 348); + public static Werkstoff BlueSteel = new Werkstoff(Materials.BlueSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 349); + public static Werkstoff DamascusSteel = + new Werkstoff(Materials.DamascusSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 335); + public static Werkstoff TungstenSteel = + new Werkstoff(Materials.TungstenSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 316); + public static Werkstoff Ultimet = new Werkstoff(Materials.Ultimet, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 344); + public static Werkstoff TungstenCarbide = + new Werkstoff(Materials.TungstenCarbide, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 370); + public static Werkstoff VanadiumSteel = + new Werkstoff(Materials.VanadiumSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 371); + public static Werkstoff HSSG = new Werkstoff(Materials.HSSG, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 372); + public static Werkstoff HSSE = new Werkstoff(Materials.HSSE, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 373); + public static Werkstoff HSSS = new Werkstoff(Materials.HSSS, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 374); + public static Werkstoff StainlessSteel = + new Werkstoff(Materials.StainlessSteel, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 306); + public static Werkstoff Brass = new Werkstoff(Materials.Brass, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 301); + public static Werkstoff Bronze = new Werkstoff(Materials.Bronze, ADD_CASINGS_ONLY, MIXTURE, 31_766 + 300); - public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+809); - // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, BIOLOGICAL,31_766+889); - //public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); + public static Werkstoff Wood = new Werkstoff(Materials.Wood, ADD_CASINGS_ONLY, BIOLOGICAL, 31_766 + 809); + // public static Werkstoff WoodSealed = new Werkstoff(Materials.WoodSealed, ADD_CASINGS_ONLY, + // BIOLOGICAL,31_766+889); + // public static Werkstoff Cheese = new Werkstoff(Materials.Cheese, new + // Werkstoff.GenerationFeatures().addCasings().addMetalItems().addMultipleIngotMetalWorkingItems().enforceUnification(), BIOLOGICAL,31_766+894); - public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND,31_766+305); - public static Werkstoff Polytetrafluoroethylene = new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND,31_766+473); - public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND,31_766+874); - public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND,31_766+470); - public static Werkstoff Magnesia = new Werkstoff(Materials.Magnesia, new Werkstoff.GenerationFeatures().disable().addMetalItems().addMolten(), COMPOUND,31_766+471); + public static Werkstoff Steel = new Werkstoff(Materials.Steel, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 305); + public static Werkstoff Polytetrafluoroethylene = + new Werkstoff(Materials.Polytetrafluoroethylene, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 473); + public static Werkstoff Plastic = new Werkstoff(Materials.Plastic, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 874); + public static Werkstoff Epoxid = new Werkstoff(Materials.Epoxid, ADD_CASINGS_ONLY, COMPOUND, 31_766 + 470); + public static Werkstoff Magnesia = new Werkstoff( + Materials.Magnesia, + new Werkstoff.GenerationFeatures().disable().addMetalItems().addMolten(), + COMPOUND, + 31_766 + 471); public static void init() { MainMod.LOGGER.info("Load Elements from GT"); } -// TODO: GT++ only? + // TODO: GT++ only? -// public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, <GenerationFeatures>, <TypeRef>,31_766+984); + // public static Werkstoff Flerovium = new Werkstoff(Materials.Flerovium, <GenerationFeatures>, + // <TypeRef>,31_766+984); -// public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, <GenerationFeatures>, <TypeRef>,31_766+770); -// public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, <GenerationFeatures>, <TypeRef>,31_766+241); -// public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, <GenerationFeatures>, <TypeRef>,31_766+975); -// public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, <GenerationFeatures>, <TypeRef>,31_766+976); -// public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, <GenerationFeatures>, <TypeRef>,31_766+319); -// public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, <GenerationFeatures>, <TypeRef>,31_766+485); -// public static Werkstoff Amber = new Werkstoff(Materials.Amber, <GenerationFeatures>, <TypeRef>,31_766+514); -// public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, <GenerationFeatures>, <TypeRef>,31_766+958); + // public static Werkstoff HeeEndium = new Werkstoff(Materials.HeeEndium, <GenerationFeatures>, + // <TypeRef>,31_766+770); + // public static Werkstoff PlatinumGroupSludge = new Werkstoff(Materials.PlatinumGroupSludge, + // <GenerationFeatures>, <TypeRef>,31_766+241); + // public static Werkstoff Draconium = new Werkstoff(Materials.Draconium, <GenerationFeatures>, + // <TypeRef>,31_766+975); + // public static Werkstoff DraconiumAwakened = new Werkstoff(Materials.DraconiumAwakened, <GenerationFeatures>, + // <TypeRef>,31_766+976); + // public static Werkstoff Adamantium = new Werkstoff(Materials.Adamantium, <GenerationFeatures>, + // <TypeRef>,31_766+319); + // public static Werkstoff Alduorite = new Werkstoff(Materials.Alduorite, <GenerationFeatures>, + // <TypeRef>,31_766+485); + // public static Werkstoff Amber = new Werkstoff(Materials.Amber, <GenerationFeatures>, <TypeRef>,31_766+514); + // public static Werkstoff Angmallen = new Werkstoff(Materials.Angmallen, <GenerationFeatures>, + // <TypeRef>,31_766+958); -// public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, <GenerationFeatures>, <TypeRef>,31_766+965); -// public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, <GenerationFeatures>, <TypeRef>,31_766+851); -// public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, <GenerationFeatures>, <TypeRef>,31_766+852); -// public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, <GenerationFeatures>, <TypeRef>,31_766+813); -// public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, <GenerationFeatures>, <TypeRef>,31_766+962); -// public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, <GenerationFeatures>, <TypeRef>,31_766+964); -// public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, <GenerationFeatures>, <TypeRef>,31_766+516); -// public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, <GenerationFeatures>, <TypeRef>,31_766+952); -// public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, <GenerationFeatures>, <TypeRef>,31_766+853); -// public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, <GenerationFeatures>, <TypeRef>,31_766+854); -// public static Werkstoff Chert = new Werkstoff(Materials.Chert, <GenerationFeatures>, <TypeRef>,31_766+857); -// public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, <GenerationFeatures>, <TypeRef>,31_766+858); -// public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, <GenerationFeatures>, <TypeRef>,31_766+859); -// public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, <GenerationFeatures>, <TypeRef>,31_766+342); -// public static Werkstoff Desh = new Werkstoff(Materials.Desh, <GenerationFeatures>, <TypeRef>,31_766+884); -// public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, <GenerationFeatures>, <TypeRef>,31_766+515); -// public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, <GenerationFeatures>, <TypeRef>,31_766+328); -// public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, <GenerationFeatures>, <TypeRef>,31_766+860); -// public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, <GenerationFeatures>, <TypeRef>,31_766+320); -// public static Werkstoff Emery = new Werkstoff(Materials.Emery, <GenerationFeatures>, <TypeRef>,31_766+861); -// public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, <GenerationFeatures>, <TypeRef>,31_766+380); -// public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, <GenerationFeatures>, <TypeRef>,31_766+862); -// public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, <GenerationFeatures>, <TypeRef>,31_766+959); -// public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, <GenerationFeatures>, <TypeRef>,31_766+346); -// public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, <GenerationFeatures>, <TypeRef>,31_766+347); -// public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, <GenerationFeatures>, <TypeRef>,31_766+512); -// public static Werkstoff Force = new Werkstoff(Materials.Force, <GenerationFeatures>, <TypeRef>,31_766+521); -// public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, <GenerationFeatures>, <TypeRef>,31_766+518); -// public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, <GenerationFeatures>, <TypeRef>,31_766+519); -// public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, <GenerationFeatures>, <TypeRef>,31_766+863); -// public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, <GenerationFeatures>, <TypeRef>,31_766+811); -// public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, <GenerationFeatures>, <TypeRef>,31_766+864); -// public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, <GenerationFeatures>, <TypeRef>,31_766+865); -// public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, <GenerationFeatures>, <TypeRef>,31_766+819); -// public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, <GenerationFeatures>, <TypeRef>,31_766+866); -// public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, <GenerationFeatures>, <TypeRef>,31_766+867); -// public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, <GenerationFeatures>, <TypeRef>,31_766+897); -// public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, <GenerationFeatures>, <TypeRef>,31_766+963); -// public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, <GenerationFeatures>, <TypeRef>,31_766+957); -// public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, <GenerationFeatures>, <TypeRef>,31_766+322); -// public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, <GenerationFeatures>, <TypeRef>,31_766+950); -// public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, <GenerationFeatures>, <TypeRef>,31_766+490); -// public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, <GenerationFeatures>, <TypeRef>,31_766+323); -// public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, <GenerationFeatures>, <TypeRef>,31_766+540); -// public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, <GenerationFeatures>, <TypeRef>,31_766+541); -// public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, <GenerationFeatures>, <TypeRef>,31_766+542); -// public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, <GenerationFeatures>, <TypeRef>,31_766+543); -// public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, <GenerationFeatures>, <TypeRef>,31_766+544); -// public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, <GenerationFeatures>, <TypeRef>,31_766+545); -// public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, <GenerationFeatures>, <TypeRef>,31_766+954); -// public static Werkstoff Jade = new Werkstoff(Materials.Jade, <GenerationFeatures>, <TypeRef>,31_766+537); -// public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, <GenerationFeatures>, <TypeRef>,31_766+511); -// public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, <GenerationFeatures>, <TypeRef>,31_766+953); -// public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, <GenerationFeatures>, <TypeRef>,31_766+869); -// public static Werkstoff Lava = new Werkstoff(Materials.Lava, <GenerationFeatures>, <TypeRef>,31_766+700); -// public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, <GenerationFeatures>, <TypeRef>,31_766+486); -// public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, <GenerationFeatures>, <TypeRef>,31_766+340); -// public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, <GenerationFeatures>, <TypeRef>,31_766+341); -// public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, <GenerationFeatures>, <TypeRef>,31_766+487); -// public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, <GenerationFeatures>, <TypeRef>,31_766+872); + // public static Werkstoff Atlarus = new Werkstoff(Materials.Atlarus, <GenerationFeatures>, + // <TypeRef>,31_766+965); + // public static Werkstoff Blizz = new Werkstoff(Materials.Blizz, <GenerationFeatures>, <TypeRef>,31_766+851); + // public static Werkstoff Blueschist = new Werkstoff(Materials.Blueschist, <GenerationFeatures>, + // <TypeRef>,31_766+852); + // public static Werkstoff Bluestone = new Werkstoff(Materials.Bluestone, <GenerationFeatures>, + // <TypeRef>,31_766+813); + // public static Werkstoff Carmot = new Werkstoff(Materials.Carmot, <GenerationFeatures>, <TypeRef>,31_766+962); + // public static Werkstoff Celenegil = new Werkstoff(Materials.Celenegil, <GenerationFeatures>, + // <TypeRef>,31_766+964); + // public static Werkstoff CertusQuartz = new Werkstoff(Materials.CertusQuartz, <GenerationFeatures>, + // <TypeRef>,31_766+516); + // public static Werkstoff Ceruclase = new Werkstoff(Materials.Ceruclase, <GenerationFeatures>, + // <TypeRef>,31_766+952); + // public static Werkstoff CobaltHexahydrate = new Werkstoff(Materials.CobaltHexahydrate, <GenerationFeatures>, + // <TypeRef>,31_766+853); + // public static Werkstoff ConstructionFoam = new Werkstoff(Materials.ConstructionFoam, <GenerationFeatures>, + // <TypeRef>,31_766+854); + // public static Werkstoff Chert = new Werkstoff(Materials.Chert, <GenerationFeatures>, <TypeRef>,31_766+857); + // public static Werkstoff CrudeOil = new Werkstoff(Materials.CrudeOil, <GenerationFeatures>, + // <TypeRef>,31_766+858); + // public static Werkstoff Dacite = new Werkstoff(Materials.Dacite, <GenerationFeatures>, <TypeRef>,31_766+859); + // public static Werkstoff DarkIron = new Werkstoff(Materials.DarkIron, <GenerationFeatures>, + // <TypeRef>,31_766+342); + // public static Werkstoff Desh = new Werkstoff(Materials.Desh, <GenerationFeatures>, <TypeRef>,31_766+884); + // public static Werkstoff Dilithium = new Werkstoff(Materials.Dilithium, <GenerationFeatures>, + // <TypeRef>,31_766+515); + // public static Werkstoff Duranium = new Werkstoff(Materials.Duranium, <GenerationFeatures>, + // <TypeRef>,31_766+328); + // public static Werkstoff Eclogite = new Werkstoff(Materials.Eclogite, <GenerationFeatures>, + // <TypeRef>,31_766+860); + // public static Werkstoff ElectrumFlux = new Werkstoff(Materials.ElectrumFlux, <GenerationFeatures>, + // <TypeRef>,31_766+320); + // public static Werkstoff Emery = new Werkstoff(Materials.Emery, <GenerationFeatures>, <TypeRef>,31_766+861); + // public static Werkstoff EnderiumBase = new Werkstoff(Materials.EnderiumBase, <GenerationFeatures>, + // <TypeRef>,31_766+380); + // public static Werkstoff Epidote = new Werkstoff(Materials.Epidote, <GenerationFeatures>, + // <TypeRef>,31_766+862); + // public static Werkstoff Eximite = new Werkstoff(Materials.Eximite, <GenerationFeatures>, + // <TypeRef>,31_766+959); + // public static Werkstoff FierySteel = new Werkstoff(Materials.FierySteel, <GenerationFeatures>, + // <TypeRef>,31_766+346); + // public static Werkstoff Firestone = new Werkstoff(Materials.Firestone, <GenerationFeatures>, + // <TypeRef>,31_766+347); + // public static Werkstoff FoolsRuby = new Werkstoff(Materials.FoolsRuby, <GenerationFeatures>, + // <TypeRef>,31_766+512); + // public static Werkstoff Force = new Werkstoff(Materials.Force, <GenerationFeatures>, <TypeRef>,31_766+521); + // public static Werkstoff Forcicium = new Werkstoff(Materials.Forcicium, <GenerationFeatures>, + // <TypeRef>,31_766+518); + // public static Werkstoff Forcillium = new Werkstoff(Materials.Forcillium, <GenerationFeatures>, + // <TypeRef>,31_766+519); + // public static Werkstoff Gabbro = new Werkstoff(Materials.Gabbro, <GenerationFeatures>, <TypeRef>,31_766+863); + // public static Werkstoff Glowstone = new Werkstoff(Materials.Glowstone, <GenerationFeatures>, + // <TypeRef>,31_766+811); + // public static Werkstoff Gneiss = new Werkstoff(Materials.Gneiss, <GenerationFeatures>, <TypeRef>,31_766+864); + // public static Werkstoff Graphite = new Werkstoff(Materials.Graphite, <GenerationFeatures>, + // <TypeRef>,31_766+865); + // public static Werkstoff Graphene = new Werkstoff(Materials.Graphene, <GenerationFeatures>, + // <TypeRef>,31_766+819); + // public static Werkstoff Greenschist = new Werkstoff(Materials.Greenschist, <GenerationFeatures>, + // <TypeRef>,31_766+866); + // public static Werkstoff Greenstone = new Werkstoff(Materials.Greenstone, <GenerationFeatures>, + // <TypeRef>,31_766+867); + // public static Werkstoff Greywacke = new Werkstoff(Materials.Greywacke, <GenerationFeatures>, + // <TypeRef>,31_766+897); + // public static Werkstoff Haderoth = new Werkstoff(Materials.Haderoth, <GenerationFeatures>, + // <TypeRef>,31_766+963); + // public static Werkstoff Hepatizon = new Werkstoff(Materials.Hepatizon, <GenerationFeatures>, + // <TypeRef>,31_766+957); + // public static Werkstoff HSLA = new Werkstoff(Materials.HSLA, <GenerationFeatures>, <TypeRef>,31_766+322); + // public static Werkstoff Ignatius = new Werkstoff(Materials.Ignatius, <GenerationFeatures>, + // <TypeRef>,31_766+950); + // public static Werkstoff Infuscolium = new Werkstoff(Materials.Infuscolium, <GenerationFeatures>, + // <TypeRef>,31_766+490); + // public static Werkstoff InfusedGold = new Werkstoff(Materials.InfusedGold, <GenerationFeatures>, + // <TypeRef>,31_766+323); + // public static Werkstoff InfusedAir = new Werkstoff(Materials.InfusedAir, <GenerationFeatures>, + // <TypeRef>,31_766+540); + // public static Werkstoff InfusedFire = new Werkstoff(Materials.InfusedFire, <GenerationFeatures>, + // <TypeRef>,31_766+541); + // public static Werkstoff InfusedEarth = new Werkstoff(Materials.InfusedEarth, <GenerationFeatures>, + // <TypeRef>,31_766+542); + // public static Werkstoff InfusedWater = new Werkstoff(Materials.InfusedWater, <GenerationFeatures>, + // <TypeRef>,31_766+543); + // public static Werkstoff InfusedEntropy = new Werkstoff(Materials.InfusedEntropy, <GenerationFeatures>, + // <TypeRef>,31_766+544); + // public static Werkstoff InfusedOrder = new Werkstoff(Materials.InfusedOrder, <GenerationFeatures>, + // <TypeRef>,31_766+545); + // public static Werkstoff Inolashite = new Werkstoff(Materials.Inolashite, <GenerationFeatures>, + // <TypeRef>,31_766+954); + // public static Werkstoff Jade = new Werkstoff(Materials.Jade, <GenerationFeatures>, <TypeRef>,31_766+537); + // public static Werkstoff Jasper = new Werkstoff(Materials.Jasper, <GenerationFeatures>, <TypeRef>,31_766+511); + // public static Werkstoff Kalendrite = new Werkstoff(Materials.Kalendrite, <GenerationFeatures>, + // <TypeRef>,31_766+953); + // public static Werkstoff Komatiite = new Werkstoff(Materials.Komatiite, <GenerationFeatures>, + // <TypeRef>,31_766+869); + // public static Werkstoff Lava = new Werkstoff(Materials.Lava, <GenerationFeatures>, <TypeRef>,31_766+700); + // public static Werkstoff Lemurite = new Werkstoff(Materials.Lemurite, <GenerationFeatures>, + // <TypeRef>,31_766+486); + // public static Werkstoff MeteoricIron = new Werkstoff(Materials.MeteoricIron, <GenerationFeatures>, + // <TypeRef>,31_766+340); + // public static Werkstoff MeteoricSteel = new Werkstoff(Materials.MeteoricSteel, <GenerationFeatures>, + // <TypeRef>,31_766+341); + // public static Werkstoff Meutoite = new Werkstoff(Materials.Meutoite, <GenerationFeatures>, + // <TypeRef>,31_766+487); + // public static Werkstoff Migmatite = new Werkstoff(Materials.Migmatite, <GenerationFeatures>, + // <TypeRef>,31_766+872); -// public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, <GenerationFeatures>, <TypeRef>,31_766+814); -// public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, <GenerationFeatures>, <TypeRef>,31_766+522); -// public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, <GenerationFeatures>, <TypeRef>,31_766+506); -// public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, <GenerationFeatures>, <TypeRef>,31_766+878); -// public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, <GenerationFeatures>, <TypeRef>,31_766+966); -// public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, <GenerationFeatures>, <TypeRef>,31_766+961); -// public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, <GenerationFeatures>, <TypeRef>,31_766+960); -// public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, <GenerationFeatures>, <TypeRef>,31_766+523); -// public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, <GenerationFeatures>, <TypeRef>,31_766+875); -// public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, <GenerationFeatures>, <TypeRef>,31_766+488); -// public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, <GenerationFeatures>, <TypeRef>,31_766+955); -// public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, <GenerationFeatures>, <TypeRef>,31_766+876); -// public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, <GenerationFeatures>, <TypeRef>,31_766+956); -// public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, <GenerationFeatures>, <TypeRef>,31_766+721); -// public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, <GenerationFeatures>, <TypeRef>,31_766+703); -// public static Werkstoff Void = new Werkstoff(Materials.Void, <GenerationFeatures>, <TypeRef>,31_766+970); -// public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, <GenerationFeatures>, <TypeRef>,31_766+489); -// public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, <GenerationFeatures>, <TypeRef>,31_766+951); -// public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, <GenerationFeatures>, <TypeRef>,31_766+705); -// public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, <GenerationFeatures>, <TypeRef>,31_766+704); -// public static CharcoalByproducts = new MaterialBuilder + // public static Werkstoff NetherBrick = new Werkstoff(Materials.NetherBrick, <GenerationFeatures>, + // <TypeRef>,31_766+814); + // public static Werkstoff NetherQuartz = new Werkstoff(Materials.NetherQuartz, <GenerationFeatures>, + // <TypeRef>,31_766+522); + // public static Werkstoff NetherStar = new Werkstoff(Materials.NetherStar, <GenerationFeatures>, + // <TypeRef>,31_766+506); + // public static Werkstoff Oilsands = new Werkstoff(Materials.Oilsands, <GenerationFeatures>, + // <TypeRef>,31_766+878); + // public static Werkstoff Orichalcum = new Werkstoff(Materials.Orichalcum, <GenerationFeatures>, + // <TypeRef>,31_766+966); + // public static Werkstoff Oureclase = new Werkstoff(Materials.Oureclase, <GenerationFeatures>, + // <TypeRef>,31_766+961); + // public static Werkstoff Prometheum = new Werkstoff(Materials.Prometheum, <GenerationFeatures>, + // <TypeRef>,31_766+960); + // public static Werkstoff Quartzite = new Werkstoff(Materials.Quartzite, <GenerationFeatures>, + // <TypeRef>,31_766+523); + // public static Werkstoff Rhyolite = new Werkstoff(Materials.Rhyolite, <GenerationFeatures>, + // <TypeRef>,31_766+875); + // public static Werkstoff Rubracium = new Werkstoff(Materials.Rubracium, <GenerationFeatures>, + // <TypeRef>,31_766+488); + // public static Werkstoff Sanguinite = new Werkstoff(Materials.Sanguinite, <GenerationFeatures>, + // <TypeRef>,31_766+955); + // public static Werkstoff Siltstone = new Werkstoff(Materials.Siltstone, <GenerationFeatures>, + // <TypeRef>,31_766+876); + // public static Werkstoff Tartarite = new Werkstoff(Materials.Tartarite, <GenerationFeatures>, + // <TypeRef>,31_766+956); + // public static Werkstoff UUAmplifier = new Werkstoff(Materials.UUAmplifier, <GenerationFeatures>, + // <TypeRef>,31_766+721); + // public static Werkstoff UUMatter = new Werkstoff(Materials.UUMatter, <GenerationFeatures>, + // <TypeRef>,31_766+703); + // public static Werkstoff Void = new Werkstoff(Materials.Void, <GenerationFeatures>, <TypeRef>,31_766+970); + // public static Werkstoff Vulcanite = new Werkstoff(Materials.Vulcanite, <GenerationFeatures>, + // <TypeRef>,31_766+489); + // public static Werkstoff Vyroxeres = new Werkstoff(Materials.Vyroxeres, <GenerationFeatures>, + // <TypeRef>,31_766+951); + // public static Werkstoff BioFuel = new Werkstoff(Materials.BioFuel, <GenerationFeatures>, + // <TypeRef>,31_766+705); + // public static Werkstoff Biomass = new Werkstoff(Materials.Biomass, <GenerationFeatures>, + // <TypeRef>,31_766+704); + // public static CharcoalByproducts = new MaterialBuilder -// public static Werkstoff Chili = new Werkstoff(Materials.Chili, <GenerationFeatures>, <TypeRef>,31_766+895); -// public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, <GenerationFeatures>, <TypeRef>,31_766+886); -// public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, <GenerationFeatures>, <TypeRef>,31_766+710); -// public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, <GenerationFeatures>, <TypeRef>,31_766+887); -// public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, <GenerationFeatures>, <TypeRef>,31_766+888); -// public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, <GenerationFeatures>, <TypeRef>,31_766+712); -// public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, <GenerationFeatures>, <TypeRef>,31_766+706); -// public static FermentedBiomass = new MaterialBuilder -// public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, <GenerationFeatures>, <TypeRef>,31_766+708); -// public static Werkstoff Glue = new Werkstoff(Materials.Glue, <GenerationFeatures>, <TypeRef>,31_766+726); -// public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, <GenerationFeatures>, <TypeRef>,31_766+800); -// public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, <GenerationFeatures>, <TypeRef>,31_766+727); -// public static Werkstoff Honey = new Werkstoff(Materials.Honey, <GenerationFeatures>, <TypeRef>,31_766+725); -// public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, <GenerationFeatures>, <TypeRef>,31_766+724); -// public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, <GenerationFeatures>, <TypeRef>,31_766+999); -// public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, <GenerationFeatures>, <TypeRef>,31_766+892); -// public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, <GenerationFeatures>, <TypeRef>,31_766+893); -// public static Werkstoff Milk = new Werkstoff(Materials.Milk, <GenerationFeatures>, <TypeRef>,31_766+885); -// public static Werkstoff Oil = new Werkstoff(Materials.Oil, <GenerationFeatures>, <TypeRef>,31_766+707); -// public static Werkstoff Paper = new Werkstoff(Materials.Paper, <GenerationFeatures>, <TypeRef>,31_766+879); -// public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, <GenerationFeatures>, <TypeRef>,31_766+891); -// public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, <GenerationFeatures>, <TypeRef>,31_766+383); -// public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, <GenerationFeatures>, <TypeRef>,31_766+713); -// public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, <GenerationFeatures>, <TypeRef>,31_766+722); -// public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, <GenerationFeatures>, <TypeRef>,31_766+723); -// public static Werkstoff Stone = new Werkstoff(Materials.Stone, <GenerationFeatures>, <TypeRef>,31_766+299); -// public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, <GenerationFeatures>, <TypeRef>,31_766+396); -// public static Vinegar = new MaterialBuilder -// public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, <GenerationFeatures>, <TypeRef>,31_766+881); -// public static WoodGas = new MaterialBuilder -// public static WoodTar = new MaterialBuilder -// public static WoodVinegar = new MaterialBuilder + // public static Werkstoff Chili = new Werkstoff(Materials.Chili, <GenerationFeatures>, <TypeRef>,31_766+895); + // public static Werkstoff Chocolate = new Werkstoff(Materials.Chocolate, <GenerationFeatures>, + // <TypeRef>,31_766+886); + // public static Werkstoff CoalFuel = new Werkstoff(Materials.CoalFuel, <GenerationFeatures>, + // <TypeRef>,31_766+710); + // public static Werkstoff Cocoa = new Werkstoff(Materials.Cocoa, <GenerationFeatures>, <TypeRef>,31_766+887); + // public static Werkstoff Coffee = new Werkstoff(Materials.Coffee, <GenerationFeatures>, <TypeRef>,31_766+888); + // public static Werkstoff Creosote = new Werkstoff(Materials.Creosote, <GenerationFeatures>, + // <TypeRef>,31_766+712); + // public static Werkstoff Ethanol = new Werkstoff(Materials.Ethanol, <GenerationFeatures>, + // <TypeRef>,31_766+706); + // public static FermentedBiomass = new MaterialBuilder + // public static Werkstoff Fuel = new Werkstoff(Materials.Fuel, <GenerationFeatures>, <TypeRef>,31_766+708); + // public static Werkstoff Glue = new Werkstoff(Materials.Glue, <GenerationFeatures>, <TypeRef>,31_766+726); + // public static Werkstoff Gunpowder = new Werkstoff(Materials.Gunpowder, <GenerationFeatures>, + // <TypeRef>,31_766+800); + // public static Werkstoff FryingOilHot = new Werkstoff(Materials.FryingOilHot, <GenerationFeatures>, + // <TypeRef>,31_766+727); + // public static Werkstoff Honey = new Werkstoff(Materials.Honey, <GenerationFeatures>, <TypeRef>,31_766+725); + // public static Werkstoff Lubricant = new Werkstoff(Materials.Lubricant, <GenerationFeatures>, + // <TypeRef>,31_766+724); + // public static Werkstoff McGuffium239 = new Werkstoff(Materials.McGuffium239, <GenerationFeatures>, + // <TypeRef>,31_766+999); + // public static Werkstoff MeatRaw = new Werkstoff(Materials.MeatRaw, <GenerationFeatures>, + // <TypeRef>,31_766+892); + // public static Werkstoff MeatCooked = new Werkstoff(Materials.MeatCooked, <GenerationFeatures>, + // <TypeRef>,31_766+893); + // public static Werkstoff Milk = new Werkstoff(Materials.Milk, <GenerationFeatures>, <TypeRef>,31_766+885); + // public static Werkstoff Oil = new Werkstoff(Materials.Oil, <GenerationFeatures>, <TypeRef>,31_766+707); + // public static Werkstoff Paper = new Werkstoff(Materials.Paper, <GenerationFeatures>, <TypeRef>,31_766+879); + // public static Werkstoff RareEarth = new Werkstoff(Materials.RareEarth, <GenerationFeatures>, + // <TypeRef>,31_766+891); + // public static Werkstoff Reinforced = new Werkstoff(Materials.Reinforced, <GenerationFeatures>, + // <TypeRef>,31_766+383); + // public static Werkstoff SeedOil = new Werkstoff(Materials.SeedOil, <GenerationFeatures>, + // <TypeRef>,31_766+713); + // public static Werkstoff SeedOilHemp = new Werkstoff(Materials.SeedOilHemp, <GenerationFeatures>, + // <TypeRef>,31_766+722); + // public static Werkstoff SeedOilLin = new Werkstoff(Materials.SeedOilLin, <GenerationFeatures>, + // <TypeRef>,31_766+723); + // public static Werkstoff Stone = new Werkstoff(Materials.Stone, <GenerationFeatures>, <TypeRef>,31_766+299); + // public static Werkstoff Unstable = new Werkstoff(Materials.Unstable, <GenerationFeatures>, + // <TypeRef>,31_766+396); + // public static Vinegar = new MaterialBuilder + // public static Werkstoff Wheat = new Werkstoff(Materials.Wheat, <GenerationFeatures>, <TypeRef>,31_766+881); + // public static WoodGas = new MaterialBuilder + // public static WoodTar = new MaterialBuilder + // public static WoodVinegar = new MaterialBuilder -// public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, <GenerationFeatures>, <TypeRef>,31_766+318); -// public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, <GenerationFeatures>, <TypeRef>,31_766+808); -// public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, <GenerationFeatures>, <TypeRef>,31_766+807); -// public static Werkstoff Methane = new Werkstoff(Materials.Methane, <GenerationFeatures>, <TypeRef>,31_766+715); -// public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, <GenerationFeatures>, <TypeRef>,31_766+497); -// public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, <GenerationFeatures>, <TypeRef>,31_766+496); -// public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, <GenerationFeatures>, <TypeRef>,31_766+495); -// public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, <GenerationFeatures>, <TypeRef>,31_766+494); -// public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, <GenerationFeatures>, <TypeRef>,31_766+493); -// public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, <GenerationFeatures>, <TypeRef>,31_766+820); -// public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, <GenerationFeatures>, <TypeRef>,31_766+821); + // public static Werkstoff Sunnarium = new Werkstoff(Materials.Sunnarium, <GenerationFeatures>, + // <TypeRef>,31_766+318); + // public static Werkstoff Endstone = new Werkstoff(Materials.Endstone, <GenerationFeatures>, + // <TypeRef>,31_766+808); + // public static Werkstoff Netherrack = new Werkstoff(Materials.Netherrack, <GenerationFeatures>, + // <TypeRef>,31_766+807); + // public static Werkstoff Methane = new Werkstoff(Materials.Methane, <GenerationFeatures>, + // <TypeRef>,31_766+715); + // public static Werkstoff CarbonDioxide = new Werkstoff(Materials.CarbonDioxide, <GenerationFeatures>, + // <TypeRef>,31_766+497); + // public static Werkstoff NobleGases = new Werkstoff(Materials.NobleGases, <GenerationFeatures>, + // <TypeRef>,31_766+496); + // public static Werkstoff LiquidAir = new Werkstoff(Materials.LiquidAir, <GenerationFeatures>, + // <TypeRef>,31_766+495); + // public static Werkstoff LiquidNitrogen = new Werkstoff(Materials.LiquidNitrogen, <GenerationFeatures>, + // <TypeRef>,31_766+494); + // public static Werkstoff LiquidOxygen = new Werkstoff(Materials.LiquidOxygen, <GenerationFeatures>, + // <TypeRef>,31_766+493); + // public static Werkstoff Almandine = new Werkstoff(Materials.Almandine, <GenerationFeatures>, + // <TypeRef>,31_766+820); + // public static Werkstoff Andradite = new Werkstoff(Materials.Andradite, <GenerationFeatures>, + // <TypeRef>,31_766+821); -// public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, <GenerationFeatures>, <TypeRef>,31_766+946); -// public static Werkstoff Ash = new Werkstoff(Materials.Ash, <GenerationFeatures>, <TypeRef>,31_766+815); -// public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, <GenerationFeatures>, <TypeRef>,31_766+917); -// public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, <GenerationFeatures>, <TypeRef>,31_766+315); -// public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, <GenerationFeatures>, <TypeRef>,31_766+513); -// public static Werkstoff Bone = new Werkstoff(Materials.Bone, <GenerationFeatures>, <TypeRef>,31_766+806); + // public static Werkstoff Asbestos = new Werkstoff(Materials.Asbestos, <GenerationFeatures>, + // <TypeRef>,31_766+946); + // public static Werkstoff Ash = new Werkstoff(Materials.Ash, <GenerationFeatures>, <TypeRef>,31_766+815); + // public static Werkstoff BandedIron = new Werkstoff(Materials.BandedIron, <GenerationFeatures>, + // <TypeRef>,31_766+917); + // public static Werkstoff BatteryAlloy = new Werkstoff(Materials.BatteryAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+315); + // public static Werkstoff BlueTopaz = new Werkstoff(Materials.BlueTopaz, <GenerationFeatures>, + // <TypeRef>,31_766+513); + // public static Werkstoff Bone = new Werkstoff(Materials.Bone, <GenerationFeatures>, <TypeRef>,31_766+806); -// public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, <GenerationFeatures>, <TypeRef>,31_766+930); -// public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, <GenerationFeatures>, <TypeRef>,31_766+823); -// public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, <GenerationFeatures>, <TypeRef>,31_766+824); -// public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, <GenerationFeatures>, <TypeRef>,31_766+937); -// public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, <GenerationFeatures>, <TypeRef>,31_766+855); -// public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, <GenerationFeatures>, <TypeRef>,31_766+536); -// public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, <GenerationFeatures>, <TypeRef>,31_766+825); -// public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, <GenerationFeatures>, <TypeRef>,31_766+361); -// public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, <GenerationFeatures>, <TypeRef>,31_766+826); -// public static Werkstoff Water = new Werkstoff(Materials.Water, <GenerationFeatures>, <TypeRef>,31_766+701); -// public static Werkstoff Clay = new Werkstoff(Materials.Clay, <GenerationFeatures>, <TypeRef>,31_766+805); -// public static Werkstoff Coal = new Werkstoff(Materials.Coal, <GenerationFeatures>, <TypeRef>,31_766+535); -// public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, <GenerationFeatures>, <TypeRef>,31_766+827); -// public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, <GenerationFeatures>, <TypeRef>,31_766+828); -// public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, <GenerationFeatures>, <TypeRef>,31_766+310); -// public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, <GenerationFeatures>, <TypeRef>,31_766+816); -// public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, <GenerationFeatures>, <TypeRef>,31_766+829); -// public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, <GenerationFeatures>, <TypeRef>,31_766+500); -// public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, <GenerationFeatures>, <TypeRef>,31_766+303); -// public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, <GenerationFeatures>, <TypeRef>,31_766+501); -// public static Werkstoff Galena = new Werkstoff(Materials.Galena, <GenerationFeatures>, <TypeRef>,31_766+830); -// public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, <GenerationFeatures>, <TypeRef>,31_766+906); -// public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, <GenerationFeatures>, <TypeRef>,31_766+714); -// public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, <GenerationFeatures>, <TypeRef>,31_766+504); -// public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, <GenerationFeatures>, <TypeRef>,31_766+831); -// public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, <GenerationFeatures>, <TypeRef>,31_766+729); -// public static Werkstoff Ice = new Werkstoff(Materials.Ice, <GenerationFeatures>, <TypeRef>,31_766+702); -// public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, <GenerationFeatures>, <TypeRef>,31_766+918); -// public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, <GenerationFeatures>, <TypeRef>,31_766+375); -// public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, <GenerationFeatures>, <TypeRef>,31_766+822); -// public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, <GenerationFeatures>, <TypeRef>,31_766+376); -// public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, <GenerationFeatures>, <TypeRef>,31_766+377); -// public static Werkstoff Invar = new Werkstoff(Materials.Invar, <GenerationFeatures>, <TypeRef>,31_766+302); -// public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, <GenerationFeatures>, <TypeRef>,31_766+312); -// public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, <GenerationFeatures>, <TypeRef>,31_766+524); -// public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, <GenerationFeatures>, <TypeRef>,31_766+313); -// public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, <GenerationFeatures>, <TypeRef>,31_766+908); -// public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, <GenerationFeatures>, <TypeRef>,31_766+870); -// public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, <GenerationFeatures>, <TypeRef>,31_766+942); -// public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, <GenerationFeatures>, <TypeRef>,31_766+311); -// public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, <GenerationFeatures>, <TypeRef>,31_766+359); -// public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, <GenerationFeatures>, <TypeRef>,31_766+360); -// public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, <GenerationFeatures>, <TypeRef>,31_766+716); -// public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, <GenerationFeatures>, <TypeRef>,31_766+717); -// public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, <GenerationFeatures>, <TypeRef>,31_766+804); -// public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, <GenerationFeatures>, <TypeRef>,31_766+833); -// public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, <GenerationFeatures>, <TypeRef>,31_766+307); + // public static Werkstoff BrownLimonite = new Werkstoff(Materials.BrownLimonite, <GenerationFeatures>, + // <TypeRef>,31_766+930); + // public static Werkstoff Calcite = new Werkstoff(Materials.Calcite, <GenerationFeatures>, + // <TypeRef>,31_766+823); + // public static Werkstoff Cassiterite = new Werkstoff(Materials.Cassiterite, <GenerationFeatures>, + // <TypeRef>,31_766+824); + // public static Werkstoff CassiteriteSand = new Werkstoff(Materials.CassiteriteSand, <GenerationFeatures>, + // <TypeRef>,31_766+937); + // public static Werkstoff Chalcopyrite = new Werkstoff(Materials.Chalcopyrite, <GenerationFeatures>, + // <TypeRef>,31_766+855); + // public static Werkstoff Charcoal = new Werkstoff(Materials.Charcoal, <GenerationFeatures>, + // <TypeRef>,31_766+536); + // public static Werkstoff Chromite = new Werkstoff(Materials.Chromite, <GenerationFeatures>, + // <TypeRef>,31_766+825); + // public static Werkstoff ChromiumDioxide = new Werkstoff(Materials.ChromiumDioxide, <GenerationFeatures>, + // <TypeRef>,31_766+361); + // public static Werkstoff Cinnabar = new Werkstoff(Materials.Cinnabar, <GenerationFeatures>, + // <TypeRef>,31_766+826); + // public static Werkstoff Water = new Werkstoff(Materials.Water, <GenerationFeatures>, <TypeRef>,31_766+701); + // public static Werkstoff Clay = new Werkstoff(Materials.Clay, <GenerationFeatures>, <TypeRef>,31_766+805); + // public static Werkstoff Coal = new Werkstoff(Materials.Coal, <GenerationFeatures>, <TypeRef>,31_766+535); + // public static Werkstoff Cobaltite = new Werkstoff(Materials.Cobaltite, <GenerationFeatures>, + // <TypeRef>,31_766+827); + // public static Werkstoff Cooperite = new Werkstoff(Materials.Cooperite, <GenerationFeatures>, + // <TypeRef>,31_766+828); + // public static Werkstoff Cupronickel = new Werkstoff(Materials.Cupronickel, <GenerationFeatures>, + // <TypeRef>,31_766+310); + // public static Werkstoff DarkAsh = new Werkstoff(Materials.DarkAsh, <GenerationFeatures>, + // <TypeRef>,31_766+816); + // public static Werkstoff DeepIron = new Werkstoff(Materials.DeepIron, <GenerationFeatures>, + // <TypeRef>,31_766+829); + // public static Werkstoff Diamond = new Werkstoff(Materials.Diamond, <GenerationFeatures>, + // <TypeRef>,31_766+500); + // public static Werkstoff Electrum = new Werkstoff(Materials.Electrum, <GenerationFeatures>, + // <TypeRef>,31_766+303); + // public static Werkstoff Emerald = new Werkstoff(Materials.Emerald, <GenerationFeatures>, + // <TypeRef>,31_766+501); + // public static Werkstoff Galena = new Werkstoff(Materials.Galena, <GenerationFeatures>, <TypeRef>,31_766+830); + // public static Werkstoff Garnierite = new Werkstoff(Materials.Garnierite, <GenerationFeatures>, + // <TypeRef>,31_766+906); + // public static Werkstoff Glyceryl = new Werkstoff(Materials.Glyceryl, <GenerationFeatures>, + // <TypeRef>,31_766+714); + // public static Werkstoff GreenSapphire = new Werkstoff(Materials.GreenSapphire, <GenerationFeatures>, + // <TypeRef>,31_766+504); + // public static Werkstoff Grossular = new Werkstoff(Materials.Grossular, <GenerationFeatures>, + // <TypeRef>,31_766+831); + // public static Werkstoff HolyWater = new Werkstoff(Materials.HolyWater, <GenerationFeatures>, + // <TypeRef>,31_766+729); + // public static Werkstoff Ice = new Werkstoff(Materials.Ice, <GenerationFeatures>, <TypeRef>,31_766+702); + // public static Werkstoff Ilmenite = new Werkstoff(Materials.Ilmenite, <GenerationFeatures>, + // <TypeRef>,31_766+918); + // public static Werkstoff Rutile = new Werkstoff(Materials.Rutile, <GenerationFeatures>, <TypeRef>,31_766+375); + // public static Werkstoff Bauxite = new Werkstoff(Materials.Bauxite, <GenerationFeatures>, + // <TypeRef>,31_766+822); + // public static Werkstoff Titaniumtetrachloride = new Werkstoff(Materials.Titaniumtetrachloride, + // <GenerationFeatures>, <TypeRef>,31_766+376); + // public static Werkstoff Magnesiumchloride = new Werkstoff(Materials.Magnesiumchloride, <GenerationFeatures>, + // <TypeRef>,31_766+377); + // public static Werkstoff Invar = new Werkstoff(Materials.Invar, <GenerationFeatures>, <TypeRef>,31_766+302); + // public static Werkstoff Kanthal = new Werkstoff(Materials.Kanthal, <GenerationFeatures>, + // <TypeRef>,31_766+312); + // public static Werkstoff Lazurite = new Werkstoff(Materials.Lazurite, <GenerationFeatures>, + // <TypeRef>,31_766+524); + // public static Werkstoff Magnalium = new Werkstoff(Materials.Magnalium, <GenerationFeatures>, + // <TypeRef>,31_766+313); + // public static Werkstoff Magnesite = new Werkstoff(Materials.Magnesite, <GenerationFeatures>, + // <TypeRef>,31_766+908); + // public static Werkstoff Magnetite = new Werkstoff(Materials.Magnetite, <GenerationFeatures>, + // <TypeRef>,31_766+870); + // public static Werkstoff Molybdenite = new Werkstoff(Materials.Molybdenite, <GenerationFeatures>, + // <TypeRef>,31_766+942); + // public static Werkstoff Nichrome = new Werkstoff(Materials.Nichrome, <GenerationFeatures>, + // <TypeRef>,31_766+311); + // public static Werkstoff NiobiumNitride = new Werkstoff(Materials.NiobiumNitride, <GenerationFeatures>, + // <TypeRef>,31_766+359); + // public static Werkstoff NiobiumTitanium = new Werkstoff(Materials.NiobiumTitanium, <GenerationFeatures>, + // <TypeRef>,31_766+360); + // public static Werkstoff NitroCarbon = new Werkstoff(Materials.NitroCarbon, <GenerationFeatures>, + // <TypeRef>,31_766+716); + // public static Werkstoff NitrogenDioxide = new Werkstoff(Materials.NitrogenDioxide, <GenerationFeatures>, + // <TypeRef>,31_766+717); + // public static Werkstoff Obsidian = new Werkstoff(Materials.Obsidian, <GenerationFeatures>, + // <TypeRef>,31_766+804); + // public static Werkstoff Phosphate = new Werkstoff(Materials.Phosphate, <GenerationFeatures>, + // <TypeRef>,31_766+833); + // public static Werkstoff PigIron = new Werkstoff(Materials.PigIron, <GenerationFeatures>, + // <TypeRef>,31_766+307); -// public static Polydimethylsiloxane = new MaterialBuilder -// public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, <GenerationFeatures>, <TypeRef>,31_766+471); -// public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, <GenerationFeatures>, <TypeRef>,31_766+472); + // public static Polydimethylsiloxane = new MaterialBuilder + // public static Werkstoff Silicone = new Werkstoff(Materials.Silicone, <GenerationFeatures>, + // <TypeRef>,31_766+471); + // public static Werkstoff Polycaprolactam = new Werkstoff(Materials.Polycaprolactam, <GenerationFeatures>, + // <TypeRef>,31_766+472); -// public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, <GenerationFeatures>, <TypeRef>,31_766+883); -// public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, <GenerationFeatures>, <TypeRef>,31_766+926); -// public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, <GenerationFeatures>, <TypeRef>,31_766+834); -// public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, <GenerationFeatures>, <TypeRef>,31_766+943); -// public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, <GenerationFeatures>, <TypeRef>,31_766+835); -// public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, <GenerationFeatures>, <TypeRef>,31_766+944); -// public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, <GenerationFeatures>, <TypeRef>,31_766+880); -// public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, <GenerationFeatures>, <TypeRef>,31_766+896); -// public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, <GenerationFeatures>, <TypeRef>,31_766+502); -// public static Werkstoff Salt = new Werkstoff(Materials.Salt, <GenerationFeatures>, <TypeRef>,31_766+817); -// public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, <GenerationFeatures>, <TypeRef>,31_766+836); -// public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, <GenerationFeatures>, <TypeRef>,31_766+503); -// public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, <GenerationFeatures>, <TypeRef>,31_766+910); -// public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, <GenerationFeatures>, <TypeRef>,31_766+837); -// public static Werkstoff Snow = new Werkstoff(Materials.Snow, <GenerationFeatures>, <TypeRef>,31_766+728); -// public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, <GenerationFeatures>, <TypeRef>,31_766+525); -// public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, <GenerationFeatures>, <TypeRef>,31_766+718); -// public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, <GenerationFeatures>, <TypeRef>,31_766+719); -// public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, <GenerationFeatures>, <TypeRef>,31_766+460); -// public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, <GenerationFeatures>, <TypeRef>,31_766+730); -// public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, <GenerationFeatures>, <TypeRef>,31_766+731); -// public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, <GenerationFeatures>, <TypeRef>,31_766+732); -// public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, <GenerationFeatures>, <TypeRef>,31_766+733); -// public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, <GenerationFeatures>, <TypeRef>,31_766+734); -// public static Werkstoff Gas = new Werkstoff(Materials.Gas, <GenerationFeatures>, <TypeRef>,31_766+735); -// public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, <GenerationFeatures>, <TypeRef>,31_766+736); -// public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, <GenerationFeatures>, <TypeRef>,31_766+737); -// public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, <GenerationFeatures>, <TypeRef>,31_766+738); -// public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, <GenerationFeatures>, <TypeRef>,31_766+739); -// public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, <GenerationFeatures>, <TypeRef>,31_766+740); -// public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, <GenerationFeatures>, <TypeRef>,31_766+741); -// public static Werkstoff LPG = new Werkstoff(Materials.LPG, <GenerationFeatures>, <TypeRef>,31_766+742); -// public static FluidNaquadahFuel = new MaterialBuilder -// public static EnrichedNaquadria = new MaterialBuilder -// public static ReinforceGlass = new MaterialBuilder -// public static BioMediumRaw = new MaterialBuilder -// public static BioMediumSterilized = new MaterialBuilder -// public static Chlorobenzene = new MaterialBuild -// public static DilutedHydrochloricAcid = new MaterialBuild -// public static Pyrochlore = new MaterialBuild -// public static GrowthMediumRaw = new MaterialBuild -// public static GrowthMediumSterilized = new MaterialBuild -// public static FerriteMixture = new MaterialBuild -// public static NickelZincFerrite = new MaterialBuild -// public static Massicot = new MaterialBuild -// public static ArsenicTrioxide = new MaterialBuild -// public static CobaltOxide = new MaterialBuild -// public static Zincite = new MaterialBuild -// public static AntimonyTrioxide = new MaterialBuild -// public static CupricOxide = new MaterialBuild -// public static Ferrosilite = new MaterialBuild -// public static Magnesia = new MaterialBuild -// public static Quicklime = new MaterialBuild -// public static Potash = new MaterialBuild -// public static SodaAsh = new MaterialBuild -// public static Brick = new MaterialBuild -// public static Fireclay = new MaterialBuild -// public static BioDiesel = new MaterialBuild -// public static NitrationMixture = new MaterialBuild -// public static Glycerol = new MaterialBuild -// public static SodiumBisulfate = new MaterialBuild -// public static PolyphenyleneSulfide = new MaterialBuild -// public static Dichlorobenzene = new MaterialBuild -// public static Polystyrene = new MaterialBuild -// public static Styrene = new MaterialBuild -// public static Isoprene = new MaterialBuild -// public static Tetranitromethane = new MaterialBuild -// public static Ethenone = new MaterialBuild -// public static Ethane = new MaterialBuild -// public static Propane = new MaterialBuild -// public static Butane = new MaterialBuild -// public static Butene = new MaterialBuild -// public static Butadiene = new MaterialBuild -// public static RawStyreneButadieneRubber = new MaterialBuild -// public static StyreneButadieneRubber = new MaterialBuild -// public static Toluene = new MaterialBuild -// public static Epichlorohydrin = new MaterialBuild -// public static PolyvinylChloride = new MaterialBuild -// public static VinylChloride = new MaterialBuild -// public static SulfurDioxide = new MaterialBuild -// public static SulfurTrioxide = new MaterialBuild -// public static NitricAcid = new MaterialBuild -// public static Dimethylhydrazine = new MaterialBuild -// public static Chloramine = new MaterialBuild -// public static Dimethylamine = new MaterialBuild -// public static DinitrogenTetroxide = new MaterialBuild -// public static NitricOxide = new MaterialBuild -// public static Ammonia = new MaterialBuild -// public static Dimethyldichlorosilane = new MaterialBuild -// public static Chloromethane = new MaterialBuild -// public static PhosphorousPentoxide = new MaterialBuild -// public static Tetrafluoroethylene = new MaterialBuild -// public static HydrofluoricAcid = new MaterialBuild -// public static Chloroform = new MaterialBuild -// public static BisphenolA = new MaterialBuild -// public static AceticAcid = new MaterialBuild -// public static CalciumAcetateSolution = new MaterialBuild -// public static Acetone = new MaterialBuild -// public static Methanol = new MaterialBuild -// public static CarbonMonoxide = new MaterialBuild -// public static MetalMixture = new MaterialBuild -// public static Ethylene = new MaterialBuild -// public static Propene = new MaterialBuild -// public static VinylAcetate = new MaterialBuild -// public static PolyvinylAcetate = new MaterialBuild -// public static MethylAcetate = new MaterialBuild -// public static AllylChloride = new MaterialBuild -// public static HydrochloricAcid = new MaterialBuild -// public static HypochlorousAcid = new MaterialBuild -// public static SodiumHydroxide = new MaterialBuild -// public static Benzene = new MaterialBuild -// public static Phenol = new MaterialBuild -// public static Cumene = new MaterialBuild -// public static PhosphoricAcid = new MaterialBuild -// public static SaltWater = new MaterialBuild -// public static IronIIIChloride = new MaterialBuild -// public static LifeEssence = new MaterialBuild -// public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, <GenerationFeatures>, <TypeRef>,31_766+314); -// public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, <GenerationFeatures>, <TypeRef>,31_766+980); -// public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, <GenerationFeatures>, <TypeRef>,31_766+981); -// public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, <GenerationFeatures>, <TypeRef>,31_766+838); -// public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, <GenerationFeatures>, <TypeRef>,31_766+839); + // public static Werkstoff Powellite = new Werkstoff(Materials.Powellite, <GenerationFeatures>, + // <TypeRef>,31_766+883); + // public static Werkstoff Pumice = new Werkstoff(Materials.Pumice, <GenerationFeatures>, <TypeRef>,31_766+926); + // public static Werkstoff Pyrite = new Werkstoff(Materials.Pyrite, <GenerationFeatures>, <TypeRef>,31_766+834); + // public static Werkstoff Pyrolusite = new Werkstoff(Materials.Pyrolusite, <GenerationFeatures>, + // <TypeRef>,31_766+943); + // public static Werkstoff Pyrope = new Werkstoff(Materials.Pyrope, <GenerationFeatures>, <TypeRef>,31_766+835); + // public static Werkstoff RockSalt = new Werkstoff(Materials.RockSalt, <GenerationFeatures>, + // <TypeRef>,31_766+944); + // public static Werkstoff Rubber = new Werkstoff(Materials.Rubber, <GenerationFeatures>, <TypeRef>,31_766+880); + // public static Werkstoff RawRubber = new Werkstoff(Materials.RawRubber, <GenerationFeatures>, + // <TypeRef>,31_766+896); + // public static Werkstoff Ruby = new Werkstoff(Materials.Ruby, <GenerationFeatures>, <TypeRef>,31_766+502); + // public static Werkstoff Salt = new Werkstoff(Materials.Salt, <GenerationFeatures>, <TypeRef>,31_766+817); + // public static Werkstoff Saltpeter = new Werkstoff(Materials.Saltpeter, <GenerationFeatures>, + // <TypeRef>,31_766+836); + // public static Werkstoff Sapphire = new Werkstoff(Materials.Sapphire, <GenerationFeatures>, + // <TypeRef>,31_766+503); + // public static Werkstoff Scheelite = new Werkstoff(Materials.Scheelite, <GenerationFeatures>, + // <TypeRef>,31_766+910); + // public static Werkstoff SiliconDioxide = new Werkstoff(Materials.SiliconDioxide, <GenerationFeatures>, + // <TypeRef>,31_766+837); + // public static Werkstoff Snow = new Werkstoff(Materials.Snow, <GenerationFeatures>, <TypeRef>,31_766+728); + // public static Werkstoff Sodalite = new Werkstoff(Materials.Sodalite, <GenerationFeatures>, + // <TypeRef>,31_766+525); + // public static Werkstoff SodiumPersulfate = new Werkstoff(Materials.SodiumPersulfate, <GenerationFeatures>, + // <TypeRef>,31_766+718); + // public static Werkstoff SodiumSulfide = new Werkstoff(Materials.SodiumSulfide, <GenerationFeatures>, + // <TypeRef>,31_766+719); + // public static Werkstoff HydricSulfide = new Werkstoff(Materials.HydricSulfide, <GenerationFeatures>, + // <TypeRef>,31_766+460); + // public static Werkstoff OilHeavy = new Werkstoff(Materials.OilHeavy, <GenerationFeatures>, + // <TypeRef>,31_766+730); + // public static Werkstoff OilMedium = new Werkstoff(Materials.OilMedium, <GenerationFeatures>, + // <TypeRef>,31_766+731); + // public static Werkstoff OilLight = new Werkstoff(Materials.OilLight, <GenerationFeatures>, + // <TypeRef>,31_766+732); + // public static Werkstoff NatruralGas = new Werkstoff(Materials.NatruralGas, <GenerationFeatures>, + // <TypeRef>,31_766+733); + // public static Werkstoff SulfuricGas = new Werkstoff(Materials.SulfuricGas, <GenerationFeatures>, + // <TypeRef>,31_766+734); + // public static Werkstoff Gas = new Werkstoff(Materials.Gas, <GenerationFeatures>, <TypeRef>,31_766+735); + // public static Werkstoff SulfuricNaphtha = new Werkstoff(Materials.SulfuricNaphtha, <GenerationFeatures>, + // <TypeRef>,31_766+736); + // public static Werkstoff SulfuricLightFuel = new Werkstoff(Materials.SulfuricLightFuel, <GenerationFeatures>, + // <TypeRef>,31_766+737); + // public static Werkstoff SulfuricHeavyFuel = new Werkstoff(Materials.SulfuricHeavyFuel, <GenerationFeatures>, + // <TypeRef>,31_766+738); + // public static Werkstoff Naphtha = new Werkstoff(Materials.Naphtha, <GenerationFeatures>, + // <TypeRef>,31_766+739); + // public static Werkstoff LightFuel = new Werkstoff(Materials.LightFuel, <GenerationFeatures>, + // <TypeRef>,31_766+740); + // public static Werkstoff HeavyFuel = new Werkstoff(Materials.HeavyFuel, <GenerationFeatures>, + // <TypeRef>,31_766+741); + // public static Werkstoff LPG = new Werkstoff(Materials.LPG, <GenerationFeatures>, <TypeRef>,31_766+742); + // public static FluidNaquadahFuel = new MaterialBuilder + // public static EnrichedNaquadria = new MaterialBuilder + // public static ReinforceGlass = new MaterialBuilder + // public static BioMediumRaw = new MaterialBuilder + // public static BioMediumSterilized = new MaterialBuilder + // public static Chlorobenzene = new MaterialBuild + // public static DilutedHydrochloricAcid = new MaterialBuild + // public static Pyrochlore = new MaterialBuild + // public static GrowthMediumRaw = new MaterialBuild + // public static GrowthMediumSterilized = new MaterialBuild + // public static FerriteMixture = new MaterialBuild + // public static NickelZincFerrite = new MaterialBuild + // public static Massicot = new MaterialBuild + // public static ArsenicTrioxide = new MaterialBuild + // public static CobaltOxide = new MaterialBuild + // public static Zincite = new MaterialBuild + // public static AntimonyTrioxide = new MaterialBuild + // public static CupricOxide = new MaterialBuild + // public static Ferrosilite = new MaterialBuild + // public static Magnesia = new MaterialBuild + // public static Quicklime = new MaterialBuild + // public static Potash = new MaterialBuild + // public static SodaAsh = new MaterialBuild + // public static Brick = new MaterialBuild + // public static Fireclay = new MaterialBuild + // public static BioDiesel = new MaterialBuild + // public static NitrationMixture = new MaterialBuild + // public static Glycerol = new MaterialBuild + // public static SodiumBisulfate = new MaterialBuild + // public static PolyphenyleneSulfide = new MaterialBuild + // public static Dichlorobenzene = new MaterialBuild + // public static Polystyrene = new MaterialBuild + // public static Styrene = new MaterialBuild + // public static Isoprene = new MaterialBuild + // public static Tetranitromethane = new MaterialBuild + // public static Ethenone = new MaterialBuild + // public static Ethane = new MaterialBuild + // public static Propane = new MaterialBuild + // public static Butane = new MaterialBuild + // public static Butene = new MaterialBuild + // public static Butadiene = new MaterialBuild + // public static RawStyreneButadieneRubber = new MaterialBuild + // public static StyreneButadieneRubber = new MaterialBuild + // public static Toluene = new MaterialBuild + // public static Epichlorohydrin = new MaterialBuild + // public static PolyvinylChloride = new MaterialBuild + // public static VinylChloride = new MaterialBuild + // public static SulfurDioxide = new MaterialBuild + // public static SulfurTrioxide = new MaterialBuild + // public static NitricAcid = new MaterialBuild + // public static Dimethylhydrazine = new MaterialBuild + // public static Chloramine = new MaterialBuild + // public static Dimethylamine = new MaterialBuild + // public static DinitrogenTetroxide = new MaterialBuild + // public static NitricOxide = new MaterialBuild + // public static Ammonia = new MaterialBuild + // public static Dimethyldichlorosilane = new MaterialBuild + // public static Chloromethane = new MaterialBuild + // public static PhosphorousPentoxide = new MaterialBuild + // public static Tetrafluoroethylene = new MaterialBuild + // public static HydrofluoricAcid = new MaterialBuild + // public static Chloroform = new MaterialBuild + // public static BisphenolA = new MaterialBuild + // public static AceticAcid = new MaterialBuild + // public static CalciumAcetateSolution = new MaterialBuild + // public static Acetone = new MaterialBuild + // public static Methanol = new MaterialBuild + // public static CarbonMonoxide = new MaterialBuild + // public static MetalMixture = new MaterialBuild + // public static Ethylene = new MaterialBuild + // public static Propene = new MaterialBuild + // public static VinylAcetate = new MaterialBuild + // public static PolyvinylAcetate = new MaterialBuild + // public static MethylAcetate = new MaterialBuild + // public static AllylChloride = new MaterialBuild + // public static HydrochloricAcid = new MaterialBuild + // public static HypochlorousAcid = new MaterialBuild + // public static SodiumHydroxide = new MaterialBuild + // public static Benzene = new MaterialBuild + // public static Phenol = new MaterialBuild + // public static Cumene = new MaterialBuild + // public static PhosphoricAcid = new MaterialBuild + // public static SaltWater = new MaterialBuild + // public static IronIIIChloride = new MaterialBuild + // public static LifeEssence = new MaterialBuild + // public static Werkstoff SolderingAlloy = new Werkstoff(Materials.SolderingAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+314); + // public static Werkstoff GalliumArsenide = new Werkstoff(Materials.GalliumArsenide, <GenerationFeatures>, + // <TypeRef>,31_766+980); + // public static Werkstoff IndiumGalliumPhosphide = new Werkstoff(Materials.IndiumGalliumPhosphide, + // <GenerationFeatures>, <TypeRef>,31_766+981); + // public static Werkstoff Spessartine = new Werkstoff(Materials.Spessartine, <GenerationFeatures>, + // <TypeRef>,31_766+838); + // public static Werkstoff Sphalerite = new Werkstoff(Materials.Sphalerite, <GenerationFeatures>, + // <TypeRef>,31_766+839); -// public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, <GenerationFeatures>, <TypeRef>,31_766+945); -// public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, <GenerationFeatures>, <TypeRef>,31_766+720); -// public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, <GenerationFeatures>, <TypeRef>,31_766+508); -// public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, <GenerationFeatures>, <TypeRef>,31_766+840); -// public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, <GenerationFeatures>, <TypeRef>,31_766+363); -// public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, <GenerationFeatures>, <TypeRef>,31_766+507); -// public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, <GenerationFeatures>, <TypeRef>,31_766+841); + // public static Werkstoff Stibnite = new Werkstoff(Materials.Stibnite, <GenerationFeatures>, + // <TypeRef>,31_766+945); + // public static Werkstoff SulfuricAcid = new Werkstoff(Materials.SulfuricAcid, <GenerationFeatures>, + // <TypeRef>,31_766+720); + // public static Werkstoff Tanzanite = new Werkstoff(Materials.Tanzanite, <GenerationFeatures>, + // <TypeRef>,31_766+508); + // public static Werkstoff Tetrahedrite = new Werkstoff(Materials.Tetrahedrite, <GenerationFeatures>, + // <TypeRef>,31_766+840); + // public static Werkstoff TinAlloy = new Werkstoff(Materials.TinAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+363); + // public static Werkstoff Topaz = new Werkstoff(Materials.Topaz, <GenerationFeatures>, <TypeRef>,31_766+507); + // public static Werkstoff Tungstate = new Werkstoff(Materials.Tungstate, <GenerationFeatures>, + // <TypeRef>,31_766+841); -// public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, <GenerationFeatures>, <TypeRef>,31_766+922); -// public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, <GenerationFeatures>, <TypeRef>,31_766+842); -// public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, <GenerationFeatures>, <TypeRef>,31_766+357); + // public static Werkstoff Uraninite = new Werkstoff(Materials.Uraninite, <GenerationFeatures>, + // <TypeRef>,31_766+922); + // public static Werkstoff Uvarovite = new Werkstoff(Materials.Uvarovite, <GenerationFeatures>, + // <TypeRef>,31_766+842); + // public static Werkstoff VanadiumGallium = new Werkstoff(Materials.VanadiumGallium, <GenerationFeatures>, + // <TypeRef>,31_766+357); -// public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, <GenerationFeatures>, <TypeRef>,31_766+882); -// public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, <GenerationFeatures>, <TypeRef>,31_766+931); -// public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, <GenerationFeatures>, <TypeRef>,31_766+358); + // public static Werkstoff Wulfenite = new Werkstoff(Materials.Wulfenite, <GenerationFeatures>, + // <TypeRef>,31_766+882); + // public static Werkstoff YellowLimonite = new Werkstoff(Materials.YellowLimonite, <GenerationFeatures>, + // <TypeRef>,31_766+931); + // public static Werkstoff YttriumBariumCuprate = new Werkstoff(Materials.YttriumBariumCuprate, + // <GenerationFeatures>, <TypeRef>,31_766+358); -// public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, <GenerationFeatures>, <TypeRef>,31_766+832); -// public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, <GenerationFeatures>, <TypeRef>,31_766+338); -// public static Werkstoff Glass = new Werkstoff(Materials.Glass, <GenerationFeatures>, <TypeRef>,31_766+890); -// public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); -// public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, <GenerationFeatures>, <TypeRef>,31_766+925); -// public static Werkstoff Borax = new Werkstoff(Materials.Borax, <GenerationFeatures>, <TypeRef>,31_766+941); -// public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, <GenerationFeatures>, <TypeRef>,31_766+538); -// public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, <GenerationFeatures>, <TypeRef>,31_766+505); -// public static Werkstoff Opal = new Werkstoff(Materials.Opal, <GenerationFeatures>, <TypeRef>,31_766+510); -// public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, <GenerationFeatures>, <TypeRef>,31_766+509); -// public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, <GenerationFeatures>, <TypeRef>,31_766+810); -// public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, <GenerationFeatures>, <TypeRef>,31_766+526); -// public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, <GenerationFeatures>, <TypeRef>,31_766+801); -// public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, <GenerationFeatures>, <TypeRef>,31_766+532); -// public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, <GenerationFeatures>, <TypeRef>,31_766+533); -// public static Werkstoff Flint = new Werkstoff(Materials.Flint, <GenerationFeatures>, <TypeRef>,31_766+802); -// public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, <GenerationFeatures>, <TypeRef>,31_766+948); -// public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, <GenerationFeatures>, <TypeRef>,31_766+940); -// public static Werkstoff Niter = new Werkstoff(Materials.Niter, <GenerationFeatures>, <TypeRef>,31_766+531); -// public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, <GenerationFeatures>, <TypeRef>,31_766+843); -// public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, <GenerationFeatures>, <TypeRef>,31_766+898); -// public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, <GenerationFeatures>, <TypeRef>,31_766+818); -// public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, <GenerationFeatures>, <TypeRef>,31_766+530); -// public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, <GenerationFeatures>, <TypeRef>,31_766+400); -// public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, <GenerationFeatures>, <TypeRef>,31_766+386); -// public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, <GenerationFeatures>, <TypeRef>,31_766+339); -// public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, <GenerationFeatures>, <TypeRef>,31_766+362); + // public static Werkstoff LiveRoot = new Werkstoff(Materials.LiveRoot, <GenerationFeatures>, + // <TypeRef>,31_766+832); + // public static Werkstoff IronWood = new Werkstoff(Materials.IronWood, <GenerationFeatures>, + // <TypeRef>,31_766+338); + // public static Werkstoff Glass = new Werkstoff(Materials.Glass, <GenerationFeatures>, <TypeRef>,31_766+890); + // public static Werkstoff BorosilicateGlass = new Werkstoff(Materials.BorosilicateGlass, + // Werkstoff.GenerationFeatures.DISABLED, Werkstoff.Types.COMPOUND, 31_766+611); + // public static Werkstoff Perlite = new Werkstoff(Materials.Perlite, <GenerationFeatures>, + // <TypeRef>,31_766+925); + // public static Werkstoff Borax = new Werkstoff(Materials.Borax, <GenerationFeatures>, <TypeRef>,31_766+941); + // public static Werkstoff Lignite = new Werkstoff(Materials.Lignite, <GenerationFeatures>, + // <TypeRef>,31_766+538); + // public static Werkstoff Olivine = new Werkstoff(Materials.Olivine, <GenerationFeatures>, + // <TypeRef>,31_766+505); + // public static Werkstoff Opal = new Werkstoff(Materials.Opal, <GenerationFeatures>, <TypeRef>,31_766+510); + // public static Werkstoff Amethyst = new Werkstoff(Materials.Amethyst, <GenerationFeatures>, + // <TypeRef>,31_766+509); + // public static Werkstoff Redstone = new Werkstoff(Materials.Redstone, <GenerationFeatures>, + // <TypeRef>,31_766+810); + // public static Werkstoff Lapis = new Werkstoff(Materials.Lapis, <GenerationFeatures>, <TypeRef>,31_766+526); + // public static Werkstoff Blaze = new Werkstoff(Materials.Blaze, <GenerationFeatures>, <TypeRef>,31_766+801); + // public static Werkstoff EnderPearl = new Werkstoff(Materials.EnderPearl, <GenerationFeatures>, + // <TypeRef>,31_766+532); + // public static Werkstoff EnderEye = new Werkstoff(Materials.EnderEye, <GenerationFeatures>, + // <TypeRef>,31_766+533); + // public static Werkstoff Flint = new Werkstoff(Materials.Flint, <GenerationFeatures>, <TypeRef>,31_766+802); + // public static Werkstoff Diatomite = new Werkstoff(Materials.Diatomite, <GenerationFeatures>, + // <TypeRef>,31_766+948); + // public static Werkstoff VolcanicAsh = new Werkstoff(Materials.VolcanicAsh, <GenerationFeatures>, + // <TypeRef>,31_766+940); + // public static Werkstoff Niter = new Werkstoff(Materials.Niter, <GenerationFeatures>, <TypeRef>,31_766+531); + // public static Werkstoff Pyrotheum = new Werkstoff(Materials.Pyrotheum, <GenerationFeatures>, + // <TypeRef>,31_766+843); + // public static Werkstoff Cryotheum = new Werkstoff(Materials.Cryotheum, <GenerationFeatures>, + // <TypeRef>,31_766+898); + // public static Werkstoff HydratedCoal = new Werkstoff(Materials.HydratedCoal, <GenerationFeatures>, + // <TypeRef>,31_766+818); + // public static Werkstoff Apatite = new Werkstoff(Materials.Apatite, <GenerationFeatures>, + // <TypeRef>,31_766+530); + // public static Werkstoff Alumite = new Werkstoff(Materials.Alumite, <GenerationFeatures>, + // <TypeRef>,31_766+400); + // public static Werkstoff Manyullyn = new Werkstoff(Materials.Manyullyn, <GenerationFeatures>, + // <TypeRef>,31_766+386); + // public static Werkstoff Steeleaf = new Werkstoff(Materials.Steeleaf, <GenerationFeatures>, + // <TypeRef>,31_766+339); + // public static Werkstoff Knightmetal = new Werkstoff(Materials.Knightmetal, <GenerationFeatures>, + // <TypeRef>,31_766+362); -// public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, <GenerationFeatures>, <TypeRef>,31_766+709); -// public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, <GenerationFeatures>, <TypeRef>,31_766+308); -// public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, <GenerationFeatures>, <TypeRef>,31_766+343); -// public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, <GenerationFeatures>, <TypeRef>,31_766+534); -// public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, <GenerationFeatures>, <TypeRef>,31_766+844); -// public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, <GenerationFeatures>, <TypeRef>,31_766+527); -// public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, <GenerationFeatures>, <TypeRef>,31_766+528); -// public static Werkstoff Marble = new Werkstoff(Materials.Marble, <GenerationFeatures>, <TypeRef>,31_766+845); -// public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, <GenerationFeatures>, <TypeRef>,31_766+803); -// public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, <GenerationFeatures>, <TypeRef>,31_766+330); -// public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, <GenerationFeatures>, <TypeRef>,31_766+529); -// public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, <GenerationFeatures>, <TypeRef>,31_766+846); -// public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, <GenerationFeatures>, <TypeRef>,31_766+847); -// public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, <GenerationFeatures>, <TypeRef>,31_766+848); -// public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, <GenerationFeatures>, <TypeRef>,31_766+849); -// public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, <GenerationFeatures>, <TypeRef>,31_766+850); -// public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, <GenerationFeatures>, <TypeRef>,31_766+912); -// public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, <GenerationFeatures>, <TypeRef>,31_766+913); -// public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, <GenerationFeatures>, <TypeRef>,31_766+923); -// public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, <GenerationFeatures>, <TypeRef>,31_766+935); -// public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, <GenerationFeatures>, <TypeRef>,31_766+936); -// public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, <GenerationFeatures>, <TypeRef>,31_766+938); -// public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, <GenerationFeatures>, <TypeRef>,31_766+939); -// public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, <GenerationFeatures>, <TypeRef>,31_766+905); -// public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, <GenerationFeatures>, <TypeRef>,31_766+909); -// public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, <GenerationFeatures>, <TypeRef>,31_766+920); -// public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, <GenerationFeatures>, <TypeRef>,31_766+919); -// public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, <GenerationFeatures>, <TypeRef>,31_766+921); -// public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, <GenerationFeatures>, <TypeRef>,31_766+907); -// public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, <GenerationFeatures>, <TypeRef>,31_766+933); -// public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, <GenerationFeatures>, <TypeRef>,31_766+949); -// public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, <GenerationFeatures>, <TypeRef>,31_766+932); -// public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, <GenerationFeatures>, <TypeRef>,31_766+927); -// public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, <GenerationFeatures>, <TypeRef>,31_766+928); -// public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, <GenerationFeatures>, <TypeRef>,31_766+873); -// public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, <GenerationFeatures>, <TypeRef>,31_766+520); -// public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, <GenerationFeatures>, <TypeRef>,31_766+871); -// public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, <GenerationFeatures>, <TypeRef>,31_766+900); -// public static Werkstoff Mica = new Werkstoff(Materials.Mica, <GenerationFeatures>, <TypeRef>,31_766+901); -// public static Werkstoff Trona = new Werkstoff(Materials.Trona, <GenerationFeatures>, <TypeRef>,31_766+903); -// public static Werkstoff Barite = new Werkstoff(Materials.Barite, <GenerationFeatures>, <TypeRef>,31_766+904); -// public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, <GenerationFeatures>, <TypeRef>,31_766+934); -// public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, <GenerationFeatures>, <TypeRef>,31_766+911); -// public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, <GenerationFeatures>, <TypeRef>,31_766+914); -// public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, <GenerationFeatures>, <TypeRef>,31_766+915); -// public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, <GenerationFeatures>, <TypeRef>,31_766+916); -// public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, <GenerationFeatures>, <TypeRef>,31_766+924); -// public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, <GenerationFeatures>, <TypeRef>,31_766+929); -// public static Werkstoff Talc = new Werkstoff(Materials.Talc, <GenerationFeatures>, <TypeRef>,31_766+902); -// public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, <GenerationFeatures>, <TypeRef>,31_766+877); -// public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, <GenerationFeatures>, <TypeRef>,31_766+947); -// public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, <GenerationFeatures>, <TypeRef>,31_766+354); -// public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, <GenerationFeatures>, <TypeRef>,31_766+355); -// public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, <GenerationFeatures>, <TypeRef>,31_766+356); -// public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, <GenerationFeatures>, <TypeRef>,31_766+399); + // public static Werkstoff NitroFuel = new Werkstoff(Materials.NitroFuel, <GenerationFeatures>, + // <TypeRef>,31_766+709); + // public static Werkstoff RedAlloy = new Werkstoff(Materials.RedAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+308); + // public static Werkstoff CobaltBrass = new Werkstoff(Materials.CobaltBrass, <GenerationFeatures>, + // <TypeRef>,31_766+343); + // public static Werkstoff TricalciumPhosphate = new Werkstoff(Materials.TricalciumPhosphate, + // <GenerationFeatures>, <TypeRef>,31_766+534); + // public static Werkstoff Basalt = new Werkstoff(Materials.Basalt, <GenerationFeatures>, <TypeRef>,31_766+844); + // public static Werkstoff GarnetRed = new Werkstoff(Materials.GarnetRed, <GenerationFeatures>, + // <TypeRef>,31_766+527); + // public static Werkstoff GarnetYellow = new Werkstoff(Materials.GarnetYellow, <GenerationFeatures>, + // <TypeRef>,31_766+528); + // public static Werkstoff Marble = new Werkstoff(Materials.Marble, <GenerationFeatures>, <TypeRef>,31_766+845); + // public static Werkstoff Sugar = new Werkstoff(Materials.Sugar, <GenerationFeatures>, <TypeRef>,31_766+803); + // public static Werkstoff Thaumium = new Werkstoff(Materials.Thaumium, <GenerationFeatures>, + // <TypeRef>,31_766+330); + // public static Werkstoff Vinteum = new Werkstoff(Materials.Vinteum, <GenerationFeatures>, + // <TypeRef>,31_766+529); + // public static Werkstoff Redrock = new Werkstoff(Materials.Redrock, <GenerationFeatures>, + // <TypeRef>,31_766+846); + // public static Werkstoff PotassiumFeldspar = new Werkstoff(Materials.PotassiumFeldspar, <GenerationFeatures>, + // <TypeRef>,31_766+847); + // public static Werkstoff Biotite = new Werkstoff(Materials.Biotite, <GenerationFeatures>, + // <TypeRef>,31_766+848); + // public static Werkstoff GraniteBlack = new Werkstoff(Materials.GraniteBlack, <GenerationFeatures>, + // <TypeRef>,31_766+849); + // public static Werkstoff GraniteRed = new Werkstoff(Materials.GraniteRed, <GenerationFeatures>, + // <TypeRef>,31_766+850); + // public static Werkstoff Chrysotile = new Werkstoff(Materials.Chrysotile, <GenerationFeatures>, + // <TypeRef>,31_766+912); + // public static Werkstoff Realgar = new Werkstoff(Materials.Realgar, <GenerationFeatures>, + // <TypeRef>,31_766+913); + // public static Werkstoff VanadiumMagnetite = new Werkstoff(Materials.VanadiumMagnetite, <GenerationFeatures>, + // <TypeRef>,31_766+923); + // public static Werkstoff BasalticMineralSand = new Werkstoff(Materials.BasalticMineralSand, + // <GenerationFeatures>, <TypeRef>,31_766+935); + // public static Werkstoff GraniticMineralSand = new Werkstoff(Materials.GraniticMineralSand, + // <GenerationFeatures>, <TypeRef>,31_766+936); + // public static Werkstoff GarnetSand = new Werkstoff(Materials.GarnetSand, <GenerationFeatures>, + // <TypeRef>,31_766+938); + // public static Werkstoff QuartzSand = new Werkstoff(Materials.QuartzSand, <GenerationFeatures>, + // <TypeRef>,31_766+939); + // public static Werkstoff Bastnasite = new Werkstoff(Materials.Bastnasite, <GenerationFeatures>, + // <TypeRef>,31_766+905); + // public static Werkstoff Pentlandite = new Werkstoff(Materials.Pentlandite, <GenerationFeatures>, + // <TypeRef>,31_766+909); + // public static Werkstoff Spodumene = new Werkstoff(Materials.Spodumene, <GenerationFeatures>, + // <TypeRef>,31_766+920); + // public static Werkstoff Pollucite = new Werkstoff(Materials.Pollucite, <GenerationFeatures>, + // <TypeRef>,31_766+919); + // public static Werkstoff Tantalite = new Werkstoff(Materials.Tantalite, <GenerationFeatures>, + // <TypeRef>,31_766+921); + // public static Werkstoff Lepidolite = new Werkstoff(Materials.Lepidolite, <GenerationFeatures>, + // <TypeRef>,31_766+907); + // public static Werkstoff Glauconite = new Werkstoff(Materials.Glauconite, <GenerationFeatures>, + // <TypeRef>,31_766+933); + // public static Werkstoff GlauconiteSand = new Werkstoff(Materials.GlauconiteSand, <GenerationFeatures>, + // <TypeRef>,31_766+949); + // public static Werkstoff Vermiculite = new Werkstoff(Materials.Vermiculite, <GenerationFeatures>, + // <TypeRef>,31_766+932); + // public static Werkstoff Bentonite = new Werkstoff(Materials.Bentonite, <GenerationFeatures>, + // <TypeRef>,31_766+927); + // public static Werkstoff FullersEarth = new Werkstoff(Materials.FullersEarth, <GenerationFeatures>, + // <TypeRef>,31_766+928); + // public static Werkstoff Pitchblende = new Werkstoff(Materials.Pitchblende, <GenerationFeatures>, + // <TypeRef>,31_766+873); + // public static Werkstoff Monazite = new Werkstoff(Materials.Monazite, <GenerationFeatures>, + // <TypeRef>,31_766+520); + // public static Werkstoff Malachite = new Werkstoff(Materials.Malachite, <GenerationFeatures>, + // <TypeRef>,31_766+871); + // public static Werkstoff Mirabilite = new Werkstoff(Materials.Mirabilite, <GenerationFeatures>, + // <TypeRef>,31_766+900); + // public static Werkstoff Mica = new Werkstoff(Materials.Mica, <GenerationFeatures>, <TypeRef>,31_766+901); + // public static Werkstoff Trona = new Werkstoff(Materials.Trona, <GenerationFeatures>, <TypeRef>,31_766+903); + // public static Werkstoff Barite = new Werkstoff(Materials.Barite, <GenerationFeatures>, <TypeRef>,31_766+904); + // public static Werkstoff Gypsum = new Werkstoff(Materials.Gypsum, <GenerationFeatures>, <TypeRef>,31_766+934); + // public static Werkstoff Alunite = new Werkstoff(Materials.Alunite, <GenerationFeatures>, + // <TypeRef>,31_766+911); + // public static Werkstoff Dolomite = new Werkstoff(Materials.Dolomite, <GenerationFeatures>, + // <TypeRef>,31_766+914); + // public static Werkstoff Wollastonite = new Werkstoff(Materials.Wollastonite, <GenerationFeatures>, + // <TypeRef>,31_766+915); + // public static Werkstoff Zeolite = new Werkstoff(Materials.Zeolite, <GenerationFeatures>, + // <TypeRef>,31_766+916); + // public static Werkstoff Kyanite = new Werkstoff(Materials.Kyanite, <GenerationFeatures>, + // <TypeRef>,31_766+924); + // public static Werkstoff Kaolinite = new Werkstoff(Materials.Kaolinite, <GenerationFeatures>, + // <TypeRef>,31_766+929); + // public static Werkstoff Talc = new Werkstoff(Materials.Talc, <GenerationFeatures>, <TypeRef>,31_766+902); + // public static Werkstoff Soapstone = new Werkstoff(Materials.Soapstone, <GenerationFeatures>, + // <TypeRef>,31_766+877); + // public static Werkstoff Concrete = new Werkstoff(Materials.Concrete, <GenerationFeatures>, + // <TypeRef>,31_766+947); + // public static Werkstoff IronMagnetic = new Werkstoff(Materials.IronMagnetic, <GenerationFeatures>, + // <TypeRef>,31_766+354); + // public static Werkstoff SteelMagnetic = new Werkstoff(Materials.SteelMagnetic, <GenerationFeatures>, + // <TypeRef>,31_766+355); + // public static Werkstoff NeodymiumMagnetic = new Werkstoff(Materials.NeodymiumMagnetic, <GenerationFeatures>, + // <TypeRef>,31_766+356); + // public static Werkstoff SamariumMagnetic = new Werkstoff(Materials.SamariumMagnetic, <GenerationFeatures>, + // <TypeRef>,31_766+399); -// public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) -// public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, <GenerationFeatures>, <TypeRef>,31_766+610); -// public static PotassiumNitrade = new MaterialBuilder(59 -// public static ChromiumTrioxide = new MaterialBuilder(31_766+591) -// public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) -// public static Dimethylbenzene = new MaterialBuilder(31_766+593) -// public static Potassiumdichromate = new MaterialBuilder(594 -// public static PhthalicAcid = new MaterialBuilder(31_766+595) -// public static Dichlorobenzidine = new MaterialBuilder(31_766+596) -// public static Diaminobenzidin = new MaterialBuilder(31_766+597) -// public static Diphenylisophthalate = new MaterialBuilder(59 -// public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, <GenerationFeatures>, <TypeRef>, 31_766+599); -// public static NitrousOxide = new MaterialBuilder(31_766+993) -// public static AntiKnock = new MaterialBuilder(31_766+994) -// public static Octane = new MaterialBuilder(31_766+995) -// public static GasolineRaw = new MaterialBuilder(31_766+996) -// public static GasolineRegular = new MaterialBuilder(31_766+997) -// public static GasolinePremium = new MaterialBuilder(31_766+998) -// public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, <GenerationFeatures>, <TypeRef>,31_766+812); -// public static Galgadorian = new Werkstoff(Materials.Galgadorian, <GenerationFeatures>, <TypeRef>,31_766+384); -// public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, <GenerationFeatures>, <TypeRef>,31_766+385); -// public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, <GenerationFeatures>, <TypeRef>,31_766+977); -// public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, <GenerationFeatures>, <TypeRef>,31_766+368); -// public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, <GenerationFeatures>, <TypeRef>,31_766+390); -// public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, <GenerationFeatures>, <TypeRef>,31_766+391); -// public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, <GenerationFeatures>, <TypeRef>,31_766+387); -// public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, <GenerationFeatures>, <TypeRef>,31_766+388); -// public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, <GenerationFeatures>, <TypeRef>,31_766+389); -// public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, <GenerationFeatures>, <TypeRef>,31_766+392); -// public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, <GenerationFeatures>, <TypeRef>,31_766+393); -// public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, <GenerationFeatures>, <TypeRef>,31_766+398); -// public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, <GenerationFeatures>, <TypeRef>,31_766+381); -// public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, <GenerationFeatures>, <TypeRef>,31_766+379); -// public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, <GenerationFeatures>, <TypeRef>,31_766+369); -// public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, <GenerationFeatures>, <TypeRef>,31_766+365); -// public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, <GenerationFeatures>, <TypeRef>,31_766+366); -// public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, <GenerationFeatures>, <TypeRef>,31_766+367); -// public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, <GenerationFeatures>, <TypeRef>,31_766+378); -// public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, <GenerationFeatures>, <TypeRef>,31_766+364); -// public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, <GenerationFeatures>, <TypeRef>,31_766+401); -// public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, <GenerationFeatures>, <TypeRef>,31_766+402); -// public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, <GenerationFeatures>, <TypeRef>,31_766+403); -// public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, <GenerationFeatures>, <TypeRef>,31_766+404); -// public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, <GenerationFeatures>, <TypeRef>,31_766+405); -// public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, <GenerationFeatures>, <TypeRef>,31_766+406); -// public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, <GenerationFeatures>, <TypeRef>,31_766+407); -// public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, <GenerationFeatures>, <TypeRef>,31_766+408); -// public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, <GenerationFeatures>, <TypeRef>,31_766+321); -// public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, <GenerationFeatures>, <TypeRef>,31_766+331); -// public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, <GenerationFeatures>, <TypeRef>,31_766+309); -// public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, <GenerationFeatures>, <TypeRef>,31_766+336); -// public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, <GenerationFeatures>, <TypeRef>,31_766+337); -// public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, <GenerationFeatures>, <TypeRef>,31_766+333); -// public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, <GenerationFeatures>, <TypeRef>, 31_766 + 394); -// public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, <GenerationFeatures>, <TypeRef>, 31_766 + 397); -// public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, <GenerationFeatures>, <TypeRef>, 31_766 + 395); -// public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, <GenerationFeatures>, <TypeRef>, 31_766 + 868); -// public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, <GenerationFeatures>, <TypeRef>, 31_766 + 978); -// public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, <GenerationFeatures>, <TypeRef>, 31_766 + 982); -// public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, <GenerationFeatures>, <TypeRef>, 31_766 + 987); -// public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, <GenerationFeatures>, <TypeRef>, 31_766 + 988); -// public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, <GenerationFeatures>, <TypeRef>, 31_766 + 989); -// public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, <GenerationFeatures>, <TypeRef>, 31_766 + 990); -// public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, <GenerationFeatures>, <TypeRef>, 31_766 + 991); -// public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, <GenerationFeatures>, <TypeRef>, 31_766 + 992); -// public static Werkstoff Longasssuperconductornameforuvwire = new Werkstoff(Materials.Longasssuperconductornameforuvwire, <GenerationFeatures>, <TypeRef>, 31_766 + 986); -// public static Werkstoff Longasssuperconductornameforuhvwire = new Werkstoff(Materials.Longasssuperconductornameforuhvwire, <GenerationFeatures>, <TypeRef>, 31_766 + 985); + // public static DilutedSulfuricAcid = new MaterialBuilder(31_766+640) + // public static Werkstoff EpoxidFiberReinforced = new Werkstoff(Materials.EpoxidFiberReinforced, + // <GenerationFeatures>, <TypeRef>,31_766+610); + // public static PotassiumNitrade = new MaterialBuilder(59 + // public static ChromiumTrioxide = new MaterialBuilder(31_766+591) + // public static Nitrochlorobenzene = new MaterialBuilder(31_766+592) + // public static Dimethylbenzene = new MaterialBuilder(31_766+593) + // public static Potassiumdichromate = new MaterialBuilder(594 + // public static PhthalicAcid = new MaterialBuilder(31_766+595) + // public static Dichlorobenzidine = new MaterialBuilder(31_766+596) + // public static Diaminobenzidin = new MaterialBuilder(31_766+597) + // public static Diphenylisophthalate = new MaterialBuilder(59 + // public static Werkstoff Polybenzimidazole = new Werkstoff(Materials.Polybenzimidazole, <GenerationFeatures>, + // <TypeRef>, 31_766+599); + // public static NitrousOxide = new MaterialBuilder(31_766+993) + // public static AntiKnock = new MaterialBuilder(31_766+994) + // public static Octane = new MaterialBuilder(31_766+995) + // public static GasolineRaw = new MaterialBuilder(31_766+996) + // public static GasolineRegular = new MaterialBuilder(31_766+997) + // public static GasolinePremium = new MaterialBuilder(31_766+998) + // public static Werkstoff Electrotine = new Werkstoff(Materials.Electrotine, <GenerationFeatures>, + // <TypeRef>,31_766+812); + // public static Galgadorian = new Werkstoff(Materials.Galgadorian, <GenerationFeatures>, <TypeRef>,31_766+384); + // public static Werkstoff EnhancedGalgadorian = new Werkstoff(Materials.EnhancedGalgadorian, + // <GenerationFeatures>, <TypeRef>,31_766+385); + // public static Werkstoff BloodInfusedIron = new Werkstoff(Materials.BloodInfusedIron, <GenerationFeatures>, + // <TypeRef>,31_766+977); + // public static Werkstoff Shadow = new Werkstoff(Materials.Shadow, <GenerationFeatures>, <TypeRef>,31_766+368); + // public static Werkstoff Ledox = new Werkstoff(Materials.Ledox, <GenerationFeatures>, <TypeRef>,31_766+390); + // public static Werkstoff Quantium = new Werkstoff(Materials.Quantium, <GenerationFeatures>, + // <TypeRef>,31_766+391); + // public static Werkstoff Mytryl = new Werkstoff(Materials.Mytryl, <GenerationFeatures>, <TypeRef>,31_766+387); + // public static Werkstoff BlackPlutonium = new Werkstoff(Materials.BlackPlutonium, <GenerationFeatures>, + // <TypeRef>,31_766+388); + // public static Werkstoff CallistoIce = new Werkstoff(Materials.CallistoIce, <GenerationFeatures>, + // <TypeRef>,31_766+389); + // public static Werkstoff Duralumin = new Werkstoff(Materials.Duralumin, <GenerationFeatures>, + // <TypeRef>,31_766+392); + // public static Werkstoff Oriharukon = new Werkstoff(Materials.Oriharukon, <GenerationFeatures>, + // <TypeRef>,31_766+393); + // public static Werkstoff MysteriousCrystal = new Werkstoff(Materials.MysteriousCrystal, <GenerationFeatures>, + // <TypeRef>,31_766+398); + // public static Werkstoff RedstoneAlloy = new Werkstoff(Materials.RedstoneAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+381); + // public static Werkstoff Soularium = new Werkstoff(Materials.Soularium, <GenerationFeatures>, + // <TypeRef>,31_766+379); + // public static Werkstoff ConductiveIron = new Werkstoff(Materials.ConductiveIron, <GenerationFeatures>, + // <TypeRef>,31_766+369); + // public static Werkstoff ElectricalSteel = new Werkstoff(Materials.ElectricalSteel, <GenerationFeatures>, + // <TypeRef>,31_766+365); + // public static Werkstoff EnergeticAlloy = new Werkstoff(Materials.EnergeticAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+366); + // public static Werkstoff VibrantAlloy = new Werkstoff(Materials.VibrantAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+367); + // public static Werkstoff PulsatingIron = new Werkstoff(Materials.PulsatingIron, <GenerationFeatures>, + // <TypeRef>,31_766+378); + // public static Werkstoff DarkSteel = new Werkstoff(Materials.DarkSteel, <GenerationFeatures>, + // <TypeRef>,31_766+364); + // public static Werkstoff EndSteel = new Werkstoff(Materials.EndSteel, <GenerationFeatures>, + // <TypeRef>,31_766+401); + // public static Werkstoff CrudeSteel = new Werkstoff(Materials.CrudeSteel, <GenerationFeatures>, + // <TypeRef>,31_766+402); + // public static Werkstoff CrystallineAlloy = new Werkstoff(Materials.CrystallineAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+403); + // public static Werkstoff MelodicAlloy = new Werkstoff(Materials.MelodicAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+404); + // public static Werkstoff StellarAlloy = new Werkstoff(Materials.StellarAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+405); + // public static Werkstoff CrystallinePinkSlime = new Werkstoff(Materials.CrystallinePinkSlime, + // <GenerationFeatures>, <TypeRef>,31_766+406); + // public static Werkstoff EnergeticSilver = new Werkstoff(Materials.EnergeticSilver, <GenerationFeatures>, + // <TypeRef>,31_766+407); + // public static Werkstoff VividAlloy = new Werkstoff(Materials.VividAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+408); + // public static Werkstoff Enderium = new Werkstoff(Materials.Enderium, <GenerationFeatures>, + // <TypeRef>,31_766+321); + // public static Werkstoff Mithril = new Werkstoff(Materials.Mithril, <GenerationFeatures>, + // <TypeRef>,31_766+331); + // public static Werkstoff BlueAlloy = new Werkstoff(Materials.BlueAlloy, <GenerationFeatures>, + // <TypeRef>,31_766+309); + // public static Werkstoff ShadowIron = new Werkstoff(Materials.ShadowIron, <GenerationFeatures>, + // <TypeRef>,31_766+336); + // public static Werkstoff ShadowSteel = new Werkstoff(Materials.ShadowSteel, <GenerationFeatures>, + // <TypeRef>,31_766+337); + // public static Werkstoff AstralSilver = new Werkstoff(Materials.AstralSilver, <GenerationFeatures>, + // <TypeRef>,31_766+333); + // public static Werkstoff InfinityCatalyst = new Werkstoff(Materials.InfinityCatalyst, <GenerationFeatures>, + // <TypeRef>, 31_766 + 394); + // public static Werkstoff Infinity = new Werkstoff(Materials.Infinity, <GenerationFeatures>, <TypeRef>, 31_766 + + // 397); + // public static Werkstoff Bedrockium = new Werkstoff(Materials.Bedrockium, <GenerationFeatures>, <TypeRef>, + // 31_766 + 395); + // public static Werkstoff Trinium = new Werkstoff(Materials.Trinium, <GenerationFeatures>, <TypeRef>, 31_766 + + // 868); + // public static Werkstoff Ichorium = new Werkstoff(Materials.Ichorium, <GenerationFeatures>, <TypeRef>, 31_766 + + // 978); + // public static Werkstoff CosmicNeutronium = new Werkstoff(Materials.CosmicNeutronium, <GenerationFeatures>, + // <TypeRef>, 31_766 + 982); + // public static Werkstoff Pentacadmiummagnesiumhexaoxid = new Werkstoff(Materials.Pentacadmiummagnesiumhexaoxid, + // <GenerationFeatures>, <TypeRef>, 31_766 + 987); + // public static Werkstoff Titaniumonabariumdecacoppereikosaoxid = new + // Werkstoff(Materials.Titaniumonabariumdecacoppereikosaoxid, <GenerationFeatures>, <TypeRef>, 31_766 + 988); + // public static Werkstoff Uraniumtriplatinid = new Werkstoff(Materials.Uraniumtriplatinid, <GenerationFeatures>, + // <TypeRef>, 31_766 + 989); + // public static Werkstoff Vanadiumtriindinid = new Werkstoff(Materials.Vanadiumtriindinid, <GenerationFeatures>, + // <TypeRef>, 31_766 + 990); + // public static Werkstoff Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid = new + // Werkstoff(Materials.Tetraindiumditindibariumtitaniumheptacoppertetrakaidekaoxid, <GenerationFeatures>, <TypeRef>, + // 31_766 + 991); + // public static Werkstoff Tetranaquadahdiindiumhexaplatiumosminid = new + // Werkstoff(Materials.Tetranaquadahdiindiumhexaplatiumosminid, <GenerationFeatures>, <TypeRef>, 31_766 + 992); + // public static Werkstoff Longasssuperconductornameforuvwire = new + // Werkstoff(Materials.Longasssuperconductornameforuvwire, <GenerationFeatures>, <TypeRef>, 31_766 + 986); + // public static Werkstoff Longasssuperconductornameforuhvwire = new + // Werkstoff(Materials.Longasssuperconductornameforuhvwire, <GenerationFeatures>, <TypeRef>, 31_766 + 985); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java index 630d45c467..d0c177e8f3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlock_Item.java @@ -22,29 +22,38 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; + import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import java.util.ArrayList; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; - public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { public BW_MetaGeneratedBlock_Item(Block par1) { super(par1); } - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { + public boolean onItemUseFirst( + ItemStack stack, + EntityPlayer player, + World world, + int x, + int y, + int z, + int side, + float hitX, + float hitY, + float hitZ) { return false; } @@ -59,10 +68,11 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { int aMetaData = aStack.getItemDamage(); Werkstoff werkstoff = werkstoffHashMap.get((short) aMetaData); if (werkstoff == null) werkstoff = Werkstoff.default_null_Werkstoff; - return ((BW_MetaGenerated_Blocks) block).blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); + return ((BW_MetaGenerated_Blocks) block) + .blockTypeLocalizedName.replace("%material", werkstoff.getLocalizedName()); } } - return GT_LanguageManager.getTranslation( getUnlocalizedName(aStack) + ".name"); + return GT_LanguageManager.getTranslation(getUnlocalizedName(aStack) + ".name"); } @Override @@ -76,7 +86,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { aList = new ArrayList<String>(); } Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get((short) aStack.getItemDamage()); - if(werkstoff != null) { + if (werkstoff != null) { String tooltip = werkstoff.getLocalizedToolTip(); if (!tooltip.isEmpty()) { aList.add(tooltip); @@ -93,7 +103,18 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } } - public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) { + public boolean placeBlockAt( + ItemStack aStack, + EntityPlayer aPlayer, + World aWorld, + int aX, + int aY, + int aZ, + int side, + float hitX, + float hitY, + float hitZ, + int aMeta) { short tDamage = (short) this.getDamage(aStack); if (tDamage > 0) { if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { @@ -101,8 +122,7 @@ public class BW_MetaGeneratedBlock_Item extends BW_ItemBlocks { } BW_MetaGenerated_Block_TE tTileEntity = (BW_MetaGenerated_Block_TE) aWorld.getTileEntity(aX, aY, aZ); tTileEntity.mMetaData = tDamage; - } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) - return false; + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, 0, 3)) return false; if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); 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 abc49d8a53..6893bb3ae5 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 @@ -26,6 +26,8 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; +import java.util.List; +import java.util.Optional; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -36,13 +38,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.List; -import java.util.Optional; - -public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting -{ +public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks + implements com.gtnewhorizon.structurelib.structure.ICustomBlockSetting { - public BW_MetaGeneratedBlocks_Casing(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName, OrePrefixes prefixes) { + public BW_MetaGeneratedBlocks_Casing( + Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName, OrePrefixes prefixes) { super(p_i45386_1_, tileEntity, blockName, prefixes); } @@ -79,7 +79,7 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { - super.onBlockAdded(aWorld,aX,aY,aZ); + super.onBlockAdded(aWorld, aX, aY, aZ); GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } @@ -90,10 +90,8 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple @Override public String getUnlocalizedName() { - if (_prefixes == WerkstoffLoader.blockCasing) - return "bw.werkstoffblockscasing.01"; - else if (_prefixes == WerkstoffLoader.blockCasingAdvanced) - return "bw.werkstoffblockscasingadvanced.01"; + if (_prefixes == WerkstoffLoader.blockCasing) return "bw.werkstoffblockscasing.01"; + else if (_prefixes == WerkstoffLoader.blockCasingAdvanced) return "bw.werkstoffblockscasingadvanced.01"; return ""; } @@ -102,16 +100,13 @@ 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.getType().equals(Werkstoff.Types.BIOLOGICAL) + .filter(pMaterial -> pMaterial.getType().equals(Werkstoff.Types.BIOLOGICAL) && pMaterial.hasGenerationFeature(WerkstoffLoader.blockCasing) - || - pMaterial.doesOreDictedItemExists(OrePrefixes.plate) + || pMaterial.doesOreDictedItemExists(OrePrefixes.plate) && pMaterial.doesOreDictedItemExists(OrePrefixes.screw) && pMaterial.doesOreDictedItemExists(OrePrefixes.plateDouble) && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGt) - && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall) - ) + && pMaterial.doesOreDictedItemExists(OrePrefixes.gearGtSmall)) .map(pMaterial -> new ItemStack(aItem, 1, pMaterial.getmID())) .forEach(aList::add); } @@ -120,12 +115,13 @@ public class BW_MetaGeneratedBlocks_Casing extends BW_MetaGenerated_Blocks imple * ICustomBlockSetting setBlock override */ public void setBlock(World world, int x, int y, int z, int meta) { - world.setBlock(x, y, z,this, meta,2); + world.setBlock(x, y, z, this, meta, 2); try { Thread.sleep(1); - //Fucking Minecraft TE settings. - } catch (InterruptedException ignored) {} - Optional.ofNullable(world.getTileEntity(x,y,z)) + // Fucking Minecraft TE settings. + } catch (InterruptedException ignored) { + } + Optional.ofNullable(world.getTileEntity(x, y, z)) .filter(te -> te instanceof BW_MetaGenerated_Block_TE) .map(te -> (BW_MetaGenerated_Block_TE) te) .ifPresent(te -> te.mMetaData = (short) meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java index 9d0fd5811b..4a1e088679 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_CasingAdvanced_TE.java @@ -48,11 +48,13 @@ public class BW_MetaGeneratedBlocks_CasingAdvanced_TE extends BW_MetaGenerated_B PrefixTextureLinker.texMapBlocks .get(WerkstoffLoader.blockCasingAdvanced) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), - aMaterial.getRGBA() - ); - return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; + aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java index 4d81419f2a..9c06ed7f25 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedBlocks_Casing_TE.java @@ -48,11 +48,13 @@ public class BW_MetaGeneratedBlocks_Casing_TE extends BW_MetaGenerated_Block_TE PrefixTextureLinker.texMapBlocks .get(WerkstoffLoader.blockCasing) .getOrDefault(set, TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]), - aMaterial.getRGBA() - ); - return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; + aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index af5706a80b..789a802d20 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static gregtech.api.enums.GT_Values.RA; + import gregtech.api.enums.Dyes; import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; @@ -36,8 +38,6 @@ import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import static gregtech.api.enums.GT_Values.RA; - public class BW_MetaGeneratedFrames extends MetaPipeEntity { public final Werkstoff mMaterial; @@ -47,8 +47,16 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { mMaterial = aMaterial; GT_OreDictUnificator.registerOre(OrePrefixes.frameGt, aMaterial, getStackForm(1)); - GT_ModHandler.addCraftingRecipe(getStackForm(2), RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); - RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), ItemList.Circuit_Integrated.getWithDamage(0, 4), getStackForm(1), 64, 8); + GT_ModHandler.addCraftingRecipe( + getStackForm(2), + RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"SSS", "SwS", "SSS", 'S', mMaterial.get(OrePrefixes.stick)}); + RA.addAssemblerRecipe( + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.getVarName(), 4), + ItemList.Circuit_Integrated.getWithDamage(0, 4), + getStackForm(1), + 64, + 8); } private BW_MetaGeneratedFrames(String aName, Werkstoff aMaterial) { @@ -67,13 +75,23 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{TextureFactory.of(this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA()))}; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aConnections, + byte aColorIndex, + boolean aConnected, + boolean aRedstone) { + return new ITexture[] { + TextureFactory.of( + this.mMaterial.getTexSet().mTextures[OrePrefixes.frameGt.mTextureIndex], + Dyes.getModulation(aColorIndex, this.mMaterial.getRGBA())) + }; } @Override public String[] getDescription() { - return new String[]{"Just something you can put a Cover or CFoam on."}; + return new String[] {"Just something you can put a Cover or CFoam on."}; } @Override @@ -102,18 +120,24 @@ public class BW_MetaGeneratedFrames extends MetaPipeEntity { } @Override - public final void saveNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + public final void saveNBTData(NBTTagCompound aNBT) { + /*Do nothing*/ + } @Override - public final void loadNBTData(NBTTagCompound aNBT) {/*Do nothing*/} + public final void loadNBTData(NBTTagCompound aNBT) { + /*Do nothing*/ + } @Override - public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPutStack( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } @Override - public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPullStack( + IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return false; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index 63245b588a..a32db89a1c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -34,10 +34,14 @@ public class BW_MetaGeneratedOreTE extends BW_MetaGenerated_Block_TE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - ITexture aIconSet = TextureFactory.of(aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{TextureFactory.of(Blocks.stone), aIconSet}; + ITexture aIconSet = TextureFactory.of( + aMaterial.getTexSet().mTextures[OrePrefixes.ore.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.stone), aIconSet}; } - return new ITexture[]{TextureFactory.of(Blocks.stone), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.stone), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.ore.mTextureIndex]) + }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index cbf6b9482b..fd73fde587 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -29,13 +29,12 @@ import gregtech.api.objects.XSTR; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.ArrayList; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import java.util.ArrayList; -import java.util.Random; - public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { public ArrayList<ItemStack> getDrops(int aFortune) { @@ -46,13 +45,15 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { Random tRandom = new XSTR(this.xCoord ^ this.yCoord ^ this.zCoord); ArrayList<ItemStack> tSelector = new ArrayList<>(); - ItemStack tStack = GT_OreDictUnificator.get(OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + ItemStack tStack = GT_OreDictUnificator.get( + OrePrefixes.gemExquisite, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 1; i++) { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemFlawless, aMaterial, GT_OreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 2; i++) { tSelector.add(tStack); @@ -64,7 +65,8 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemFlawed, aMaterial, GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial, 1L), 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -76,7 +78,11 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { tSelector.add(tStack); } } - tStack = GT_OreDictUnificator.get(OrePrefixes.gemChipped, aMaterial, GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), 1L); + tStack = GT_OreDictUnificator.get( + OrePrefixes.gemChipped, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.dustImpure, aMaterial, 1L), + 1L); if (tStack != null) { for (int i = 0; i < 5; i++) { tSelector.add(tStack); @@ -91,13 +97,13 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { if (tSelector.size() > 0) { int i = 0; - for(int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { + for (int j = Math.max(1, (aFortune > 0 ? tRandom.nextInt(1 + aFortune) : 0)); i < j; ++i) { rList.add(GT_Utility.copyAmount(1L, tSelector.get(tRandom.nextInt(tSelector.size())))); } - } if (tRandom.nextInt(3 + aFortune) > 1) { - rList.add(GT_OreDictUnificator.get(tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); + rList.add(GT_OreDictUnificator.get( + tRandom.nextInt(3) > 0 ? OrePrefixes.dustImpure : OrePrefixes.dust, Materials.Stone, 1L)); } } return rList; @@ -107,10 +113,14 @@ public class BW_MetaGeneratedSmallOreTE extends BW_MetaGeneratedOreTE { public ITexture[] getTexture(Block aBlock, byte aSide) { Werkstoff aMaterial = Werkstoff.werkstoffHashMap.get(this.mMetaData); if ((aMaterial != null)) { - ITexture aIconSet = TextureFactory.of(aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); - return new ITexture[]{TextureFactory.of(Blocks.stone), aIconSet}; + ITexture aIconSet = TextureFactory.of( + aMaterial.getTexSet().mTextures[OrePrefixes.oreSmall.mTextureIndex], aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.stone), aIconSet}; } - return new ITexture[]{TextureFactory.of(Blocks.stone), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.stone), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.oreSmall.mTextureIndex]) + }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java index 9ad31b32cd..d3ba33be2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Block_TE.java @@ -22,8 +22,11 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; + import com.github.bartimaeusnek.bartworks.common.net.MetaBlockPacket; import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -31,10 +34,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.MainMod.BW_Network_instance; - public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements ITexturedTileEntity { public short mMetaData; @@ -56,7 +55,11 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT @Override public Packet getDescriptionPacket() { if (!this.worldObj.isRemote) - BW_Network_instance.sendPacketToAllPlayersInRange(this.worldObj, new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), this.xCoord, this.zCoord); + BW_Network_instance.sendPacketToAllPlayersInRange( + this.worldObj, + new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData), + this.xCoord, + this.zCoord); return null; } @@ -71,5 +74,4 @@ public abstract class BW_MetaGenerated_Block_TE extends TileEntity implements IT rList.add(new ItemStack(GetProperBlock(), 1, this.mMetaData)); return rList; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java index ad6e1f24ee..0defff39f6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Blocks.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; + import com.github.bartimaeusnek.bartworks.client.renderer.BW_Renderer_Block_Ores; import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; import com.github.bartimaeusnek.bartworks.util.BW_Util; @@ -29,6 +31,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; +import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -36,10 +39,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.ArrayList; - -import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items.metaTab; - public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { public static ThreadLocal<BW_MetaGenerated_Block_TE> mTemporaryTileEntity = new ThreadLocal<>(); @@ -50,7 +49,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this(p_i45386_1_, tileEntity, blockName, null); } - public BW_MetaGenerated_Blocks(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName, OrePrefixes types) { + public BW_MetaGenerated_Blocks( + Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName, OrePrefixes types) { super(p_i45386_1_, tileEntity, blockName); this.setHardness(5.0F); this.setResistance(5.0F); @@ -58,7 +58,9 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { this.setCreativeTab(metaTab); _prefixes = types; if (_prefixes != null) { - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + _prefixes, _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + _prefixes, + _prefixes.mLocalizedMaterialPre + "%material" + _prefixes.mLocalizedMaterialPost); } Werkstoff.werkstoffHashSet.forEach(this::doRegistrationStuff); } @@ -66,14 +68,14 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @Override public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { super.onBlockAdded(aWorld, aX, aY, aZ); - //Waste some time to allow the TE to be set, do not use thread sleep here, it doesnt allow for nanoseconds. - //This will just waste a few cpu cycles to allow the TE to be set + // Waste some time to allow the TE to be set, do not use thread sleep here, it doesnt allow for nanoseconds. + // This will just waste a few cpu cycles to allow the TE to be set BW_Util.shortSleep(0); } @SideOnly(Side.CLIENT) public final BW_MetaGenerated_Block_TE getProperTileEntityForRendering() { - return (BW_MetaGenerated_Block_TE) createNewTileEntity(null,0); + return (BW_MetaGenerated_Block_TE) createNewTileEntity(null, 0); } protected abstract void doRegistrationStuff(Werkstoff w); @@ -88,8 +90,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { } public int getRenderType() { - if (BW_Renderer_Block_Ores.INSTANCE == null) - return super.getRenderType(); + if (BW_Renderer_Block_Ores.INSTANCE == null) return super.getRenderType(); return BW_Renderer_Block_Ores.INSTANCE.mRenderID; } @@ -103,7 +104,7 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { @Override public TileEntity createTileEntity(World world, int metadata) { - return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + return ((ITileEntityProvider) this).createNewTileEntity(world, metadata); } @Override @@ -124,7 +125,8 @@ public abstract class BW_MetaGenerated_Blocks extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGenerated_Block_TE)) { return ((BW_MetaGenerated_Block_TE) tTileEntity).getDrops(aFortune); } - return mTemporaryTileEntity.get() == null ? new ArrayList<>() : mTemporaryTileEntity.get().getDrops(aFortune); + return mTemporaryTileEntity.get() == null + ? new ArrayList<>() + : mTemporaryTileEntity.get().getDrops(aFortune); } - } 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 98afa14cee..b75edf88a0 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 @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; +import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; + import com.github.bartimaeusnek.bartworks.API.IRadMaterial; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -36,6 +39,7 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import ic2.core.IC2Potion; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -51,11 +55,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; -import java.util.List; - -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashMap; -import static com.github.bartimaeusnek.bartworks.system.material.Werkstoff.werkstoffHashSet; - public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRadMaterial { public static final CreativeTabs metaTab = new CreativeTabs("bartworksMetaMaterials") { @@ -64,33 +63,37 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa public Item getTabIconItem() { return new ItemStack(Blocks.iron_ore).getItem(); } - }; protected final OrePrefixes orePrefixes; protected final String itemTypeLocalizedName; - public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused){ + public BW_MetaGenerated_Items(OrePrefixes orePrefixes, Object unused) { super("bwMetaGeneratedGTEnhancement" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; - this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.itemtype." + orePrefixes, orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); + this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.itemtype." + orePrefixes, + orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); } public BW_MetaGenerated_Items(OrePrefixes orePrefixes) { super("bwMetaGenerated" + orePrefixes.name(), (short) 32766, (short) 0); this.orePrefixes = orePrefixes; - this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.itemtype." + orePrefixes, orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); + this.itemTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.itemtype." + orePrefixes, + orePrefixes.mLocalizedMaterialPre + "%material" + orePrefixes.mLocalizedMaterialPost); this.setCreativeTab(BW_MetaGenerated_Items.metaTab); for (Werkstoff w : werkstoffHashSet) { ItemStack tStack = new ItemStack(this, 1, w.getmID()); - if (!w.hasItemType(this.orePrefixes)) - continue; + if (!w.hasItemType(this.orePrefixes)) continue; GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.getVarName(), tStack); } } public boolean onEntityItemUpdate(EntityItem aItemEntity) { - if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { + if (this.orePrefixes == OrePrefixes.dustImpure + || this.orePrefixes == OrePrefixes.dustPure + || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); if ((aDamage >= 0) && (!aItemEntity.worldObj.isRemote)) { Werkstoff aMaterial = werkstoffHashMap.get((short) aDamage); @@ -102,13 +105,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } } else { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { - aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); + aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack( + OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } @@ -122,16 +127,18 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { -// String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); -// if (!tooltip.isEmpty()) -// aList.add(tooltip); + // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); + // if (!tooltip.isEmpty()) + // aList.add(tooltip); if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) { aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify")); } if (this.orePrefixes == OrePrefixes.crushed) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.purify.2")); - if (aStack != null && aStack.getItem() instanceof BW_MetaGenerated_Items && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) + if (aStack != null + && aStack.getItem() instanceof BW_MetaGenerated_Items + && aStack.getItemDamage() == WerkstoffLoader.Tiberium.getmID()) aList.add(GT_LanguageManager.getTranslation("metaitem.01.tooltip.nqgen")); Werkstoff werkstoff = werkstoffHashMap.get((short) this.getDamage(aStack)); @@ -162,16 +169,16 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public IIconContainer getIconContainer(int aMetaData) { - if (werkstoffHashMap.get((short) aMetaData) == null) - return null; - if (this.orePrefixes.mTextureIndex == -1) - return getIconContainerBartWorks(aMetaData); + if (werkstoffHashMap.get((short) aMetaData) == null) return null; + if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); return werkstoffHashMap.get((short) aMetaData).getTexSet().mTextures[this.orePrefixes.mTextureIndex]; } protected IIconContainer getIconContainerBartWorks(int aMetaData) { if (SideReference.Side.Client) - return PrefixTextureLinker.texMap.get(this.orePrefixes).get(werkstoffHashMap.get((short) aMetaData).getTexSet()); + return PrefixTextureLinker.texMap + .get(this.orePrefixes) + .get(werkstoffHashMap.get((short) aMetaData).getTexSet()); return null; } @@ -185,7 +192,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa aList.add(tStack); } } - //super.getSubItems(var1, aCreativeTab, aList); + // super.getSubItems(var1, aCreativeTab, aList); } @Override @@ -197,34 +204,28 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { super.onUpdate(aStack, aWorld, aPlayer, aTimer, aIsInHand); - if (aStack == null || aStack.getItem() == null || !(aPlayer instanceof EntityLivingBase)) - return; + if (aStack == null || aStack.getItem() == null || !(aPlayer instanceof EntityLivingBase)) return; EntityLivingBase bPlayer = (EntityPlayer) aPlayer; - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); - if (w == null || w.getStats() == null) - return; + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); + if (w == null || w.getStats() == null) return; - if (w.getStats().isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)){ - bPlayer.addPotionEffect(new PotionEffect(Potion.poison.getId(),80,4)); + if (w.getStats().isToxic() && !GT_Utility.isWearingFullBioHazmat(bPlayer)) { + bPlayer.addPotionEffect(new PotionEffect(Potion.poison.getId(), 80, 4)); } - if (w.getStats().isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)){ - bPlayer.addPotionEffect(new PotionEffect(IC2Potion.radiation.id,80,4)); + if (w.getStats().isRadioactive() && !GT_Utility.isWearingFullRadioHazmat(bPlayer)) { + bPlayer.addPotionEffect(new PotionEffect(IC2Potion.radiation.id, 80, 4)); } - } @Override public final IIcon getIconFromDamage(int aMetaData) { - if (aMetaData < 0) - return null; + if (aMetaData < 0) return null; Werkstoff tMaterial = werkstoffHashMap.get((short) aMetaData); - if (tMaterial == null) - return null; + if (tMaterial == null) return null; IIconContainer tIcon = this.getIconContainer(aMetaData); - if (tIcon != null) - return tIcon.getIcon(); + if (tIcon != null) return tIcon.getIcon(); return null; } @@ -235,7 +236,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public int getRadiationLevel(ItemStack aStack) { - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); return w.getStats().isRadioactive() ? (int) w.getStats().getProtons() : 0; } @@ -246,23 +247,33 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override public short[] getColorForGUI(ItemStack aStack) { - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); return w.getRGBA(); } @Override public String getNameForGUI(ItemStack aStack) { - Werkstoff w = werkstoffHashMap.get((short)aStack.getItemDamage()); + Werkstoff w = werkstoffHashMap.get((short) aStack.getItemDamage()); return w.getDefaultName(); } @Override public int getCapacity(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.capsule || this.orePrefixes == OrePrefixes.cell || this.orePrefixes == OrePrefixes.cellPlasma ? 1000 : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten ? 144 : 0; + return this.orePrefixes == OrePrefixes.capsule + || this.orePrefixes == OrePrefixes.cell + || this.orePrefixes == OrePrefixes.cellPlasma + ? 1000 + : this.orePrefixes == WerkstoffLoader.cellMolten || this.orePrefixes == WerkstoffLoader.capsuleMolten + ? 144 + : 0; } @Override public ItemStack getContainerItem(ItemStack aStack) { - return this.orePrefixes == OrePrefixes.cell ||this.orePrefixes == OrePrefixes.cellPlasma || this.orePrefixes == WerkstoffLoader.cellMolten ? Materials.Empty.getCells(1) : null; + return this.orePrefixes == OrePrefixes.cell + || this.orePrefixes == OrePrefixes.cellPlasma + || this.orePrefixes == WerkstoffLoader.cellMolten + ? Materials.Empty.getCells(1) + : null; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index 6e0ad77b8c..51107af501 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -26,6 +26,8 @@ import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; +import java.util.Arrays; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -37,27 +39,26 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.Arrays; -import java.util.List; - public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { public BW_MetaGenerated_Ores(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.ore, OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + OrePrefixes.ore, + OrePrefixes.ore.mLocalizedMaterialPre + "%material" + OrePrefixes.ore.mLocalizedMaterialPost); } protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) - return; + if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); } } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + public static boolean setOreBlock( + World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { - aY = MathUtils.clamp(aY,1, aWorld.getActualHeight()); + aY = MathUtils.clamp(aY, 1, aWorld.getActualHeight()); } Block tBlock = aWorld.getBlock(aX, aY, aZ); @@ -107,7 +108,9 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { - if ((tMaterial != null) && tMaterial.hasItemType(OrePrefixes.ore) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { + if ((tMaterial != null) + && tMaterial.hasItemType(OrePrefixes.ore) + && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { aList.add(new ItemStack(aItem, 1, tMaterial.getmID())); } } @@ -118,10 +121,8 @@ public class BW_MetaGenerated_Ores extends BW_MetaGenerated_Blocks { for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { - if (x == 0 && y == 0 && z == 0) - continue; - if (aWorld.getBlock(aX+x,aY+y,aZ+z).isAir(aWorld,aX+x,aY+y,aZ+z)) - return true; + if (x == 0 && y == 0 && z == 0) continue; + if (aWorld.getBlock(aX + x, aY + y, aZ + z).isAir(aWorld, aX + x, aY + y, aZ + z)) return true; } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index d95de69f0a..98507565a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -25,25 +25,25 @@ package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; +import java.util.Arrays; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import java.util.Arrays; - public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { public BW_MetaGenerated_SmallOres(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.oreSmall, OrePrefixes.oreSmall.mLocalizedMaterialPre+"%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + OrePrefixes.oreSmall, + OrePrefixes.oreSmall.mLocalizedMaterialPre + "%material" + OrePrefixes.oreSmall.mLocalizedMaterialPost); } @Override protected void doRegistrationStuff(Werkstoff w) { if (w != null) { - if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) - return; + if (!w.hasItemType(OrePrefixes.ore) || ((w.getGenerationFeatures().blacklist & 0b1000) != 0)) return; GT_ModHandler.addValuableOre(this, w.getmID(), 1); } } @@ -53,7 +53,8 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { return "bw.blockores.02"; } - public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { + public static boolean setOreBlock( + World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block, int[] aBlockMeta) { if (!air) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); } @@ -81,5 +82,4 @@ public class BW_MetaGenerated_SmallOres extends BW_MetaGenerated_Ores { return true; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java index 4dd28d9af7..d2ce3fe266 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlock_TE.java @@ -40,12 +40,16 @@ public class BW_MetaGenerated_WerkstoffBlock_TE extends BW_MetaGenerated_Block_T if ((aMaterial != null)) { TextureSet set = aMaterial.getTexSet(); ITexture aIconSet = TextureFactory.of( - set.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], aMaterial.getRGBA() - ); - return new ITexture[]{TextureFactory.of(Blocks.iron_block), aIconSet}; + set.mTextures[ + PrefixTextureLinker.blockTexMap.getOrDefault(set, OrePrefixes.block.mTextureIndex)], + aMaterial.getRGBA()); + return new ITexture[] {TextureFactory.of(Blocks.iron_block), aIconSet}; } } - return new ITexture[]{TextureFactory.of(Blocks.iron_block), TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex])}; + return new ITexture[] { + TextureFactory.of(Blocks.iron_block), + TextureFactory.of(gregtech.api.enums.TextureSet.SET_NONE.mTextures[OrePrefixes.block.mTextureIndex]) + }; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java index d27d50941e..44f3a90f2b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_WerkstoffBlocks.java @@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_LanguageManager; +import java.util.List; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; @@ -33,13 +34,14 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import java.util.List; - public class BW_MetaGenerated_WerkstoffBlocks extends BW_MetaGenerated_Blocks { - public BW_MetaGenerated_WerkstoffBlocks(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { + public BW_MetaGenerated_WerkstoffBlocks( + Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); - this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization("bw.blocktype." + OrePrefixes.block, OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); + this.blockTypeLocalizedName = GT_LanguageManager.addStringLocalization( + "bw.blocktype." + OrePrefixes.block, + OrePrefixes.block.mLocalizedMaterialPre + "%material" + OrePrefixes.block.mLocalizedMaterialPost); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index fd3a74b470..5c64a2075d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static gregtech.api.enums.GT_Values.W; + import gregtech.api.interfaces.IItemContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -30,12 +32,15 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.GT_Values.W; - public enum BW_NonMeta_MaterialItems implements IItemContainer { - Depleted_Tiberium_1,Depleted_Tiberium_2,Depleted_Tiberium_4, - TiberiumCell_1,TiberiumCell_2,TiberiumCell_4, - TheCoreCell,Depleted_TheCoreCell; + Depleted_Tiberium_1, + Depleted_Tiberium_2, + Depleted_Tiberium_4, + TiberiumCell_1, + TiberiumCell_2, + TiberiumCell_4, + TheCoreCell, + Depleted_TheCoreCell; private ItemStack mStack; private boolean mHasNotBeenSet = true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 98fcfb7878..8f34416122 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -26,8 +26,7 @@ public class BW_CircuitsLoader { private static final BW_Meta_Items NEW_CIRCUITS = new BW_Meta_Items(); - private BW_CircuitsLoader() { - } + private BW_CircuitsLoader() {} public static BW_Meta_Items getNewCircuits() { return BW_CircuitsLoader.NEW_CIRCUITS; @@ -44,6 +43,6 @@ public class BW_CircuitsLoader { BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(7, 11, "Ultimate Magneto Resonatic Circuit"); BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(8, 12, "Superconductor Magneto Resonatic Circuit"); BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(9, 13, "Infinite Magneto Resonatic Circuit"); - BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10,14, "Bio Magneto Resonatic Circuit"); + BW_CircuitsLoader.NEW_CIRCUITS.addNewCircuit(10, 14, "Bio Magneto Resonatic Circuit"); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index 1747471adf..caaa55b252 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 @@ -37,6 +37,7 @@ import gregtech.api.interfaces.IItemContainer; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.objects.ItemData; import gregtech.api.util.*; +import java.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -46,9 +47,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidStack; -import java.util.*; - - public class BW_Meta_Items { public static BW_Meta_Items.BW_GT_MetaGenCircuits getNEWCIRCUITS() { @@ -57,66 +55,117 @@ public class BW_Meta_Items { private static final BW_Meta_Items.BW_GT_MetaGenCircuits NEWCIRCUITS = new BW_Meta_Items.BW_GT_MetaGenCircuits(); - static{ - BW_Meta_Items.NEWCIRCUITS.addItem(0,"Circuit Imprint","",SubTag.NO_UNIFICATION,SubTag.NO_RECYCLING); - BW_Meta_Items.NEWCIRCUITS.addItem(1,"Sliced Circuit","",SubTag.NO_UNIFICATION,SubTag.NO_RECYCLING); - BW_Meta_Items.NEWCIRCUITS.addItem(2,"Raw Imprint supporting Board","A Raw Board needed for Circuit Imprints"); - BW_Meta_Items.NEWCIRCUITS.addItem(3,"Imprint supporting Board","A Board needed for Circuit Imprints"); - GT_Values.RA.addFormingPressRecipe(WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust,1),WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust,4),BW_Meta_Items.NEWCIRCUITS.getStack(2),300,480); - GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300, BW_Util.getMachineVoltageFromTier(4), BW_Util.CLEANROOM)); + static { + BW_Meta_Items.NEWCIRCUITS.addItem(0, "Circuit Imprint", "", SubTag.NO_UNIFICATION, SubTag.NO_RECYCLING); + BW_Meta_Items.NEWCIRCUITS.addItem(1, "Sliced Circuit", "", SubTag.NO_UNIFICATION, SubTag.NO_RECYCLING); + BW_Meta_Items.NEWCIRCUITS.addItem(2, "Raw Imprint supporting Board", "A Raw Board needed for Circuit Imprints"); + BW_Meta_Items.NEWCIRCUITS.addItem(3, "Imprint supporting Board", "A Board needed for Circuit Imprints"); + GT_Values.RA.addFormingPressRecipe( + WerkstoffLoader.MagnetoResonaticDust.get(OrePrefixes.dust, 1), + WerkstoffLoader.ArInGaPhoBiBoTe.get(OrePrefixes.dust, 4), + BW_Meta_Items.NEWCIRCUITS.getStack(2), + 300, + 480); + GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {BW_Meta_Items.NEWCIRCUITS.getStack(2)}, + new ItemStack[] {BW_Meta_Items.NEWCIRCUITS.getStack(3)}, + null, + new int[] {7500}, + new FluidStack[] {Materials.SolderingAlloy.getMolten(576)}, + null, + 300, + BW_Util.getMachineVoltageFromTier(4), + BW_Util.CLEANROOM)); } @SuppressWarnings("deprecation") - public void addNewCircuit(int aTier, int aID, String aName){ + public void addNewCircuit(int aTier, int aID, String aName) { String additionalOreDictData = ""; String tooltip = ""; String aOreDictPrefix = OrePrefixes.circuit.toString(); - switch (aTier){ - case 0: additionalOreDictData = Materials.Primitive.toString(); tooltip = Materials.Primitive.getToolTip(); break; - case 1: additionalOreDictData = Materials.Basic.toString(); tooltip = Materials.Basic.getToolTip(); break; - case 2: additionalOreDictData = Materials.Good.toString(); tooltip = Materials.Good.getToolTip(); break; - case 3: additionalOreDictData = Materials.Advanced.toString(); tooltip = Materials.Advanced.getToolTip(); break; - case 4: additionalOreDictData = Materials.Data.toString(); tooltip = Materials.Data.getToolTip(); break; - case 5: additionalOreDictData = Materials.Elite.toString(); tooltip = Materials.Elite.getToolTip(); break; - case 6: additionalOreDictData = Materials.Master.toString(); tooltip = Materials.Master.getToolTip(); break; - case 7: additionalOreDictData = Materials.Ultimate.toString(); tooltip = Materials.Ultimate.getToolTip(); break; - case 8: additionalOreDictData = Materials.Superconductor.toString(); tooltip = Materials.Superconductor.getToolTip(); break; - case 9: additionalOreDictData = "Infinite"; tooltip = "An Infinite Circuit"; break; - case 10: additionalOreDictData = "Bio"; tooltip = "A Bio Circuit"; break; + switch (aTier) { + case 0: + additionalOreDictData = Materials.Primitive.toString(); + tooltip = Materials.Primitive.getToolTip(); + break; + case 1: + additionalOreDictData = Materials.Basic.toString(); + tooltip = Materials.Basic.getToolTip(); + break; + case 2: + additionalOreDictData = Materials.Good.toString(); + tooltip = Materials.Good.getToolTip(); + break; + case 3: + additionalOreDictData = Materials.Advanced.toString(); + tooltip = Materials.Advanced.getToolTip(); + break; + case 4: + additionalOreDictData = Materials.Data.toString(); + tooltip = Materials.Data.getToolTip(); + break; + case 5: + additionalOreDictData = Materials.Elite.toString(); + tooltip = Materials.Elite.getToolTip(); + break; + case 6: + additionalOreDictData = Materials.Master.toString(); + tooltip = Materials.Master.getToolTip(); + break; + case 7: + additionalOreDictData = Materials.Ultimate.toString(); + tooltip = Materials.Ultimate.getToolTip(); + break; + case 8: + additionalOreDictData = Materials.Superconductor.toString(); + tooltip = Materials.Superconductor.getToolTip(); + break; + case 9: + additionalOreDictData = "Infinite"; + tooltip = "An Infinite Circuit"; + break; + case 10: + additionalOreDictData = "Bio"; + tooltip = "A Bio Circuit"; + break; } - ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID,aName,tooltip,aTier); + ItemStack tStack = BW_Meta_Items.NEWCIRCUITS.addCircuit(aID, aName, tooltip, aTier); - GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre((aOreDictPrefix + additionalOreDictData).replaceAll(" ", ""), tStack); } - public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook{ - + public static class BW_GT_MetaGenCircuits extends BW_Meta_Items.BW_GT_MetaGen_Item_Hook { public BW_GT_MetaGenCircuits() { super("bwMetaGeneratedItem0"); } - public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier){ - 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); + public final ItemStack addCircuit(int aID, String aEnglish, String aToolTip, int tier) { + 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); } - public final ItemStack getStack(int... meta_amount){ + public final ItemStack getStack(int... meta_amount) { ItemStack ret = new ItemStack(this); - if (meta_amount.length <= 0 || meta_amount.length > 2) - return ret; + if (meta_amount.length <= 0 || meta_amount.length > 2) return ret; if (meta_amount.length == 1) { ret.setItemDamage(meta_amount[0]); return ret; } ret.setItemDamage(meta_amount[0]); - ret.stackSize=meta_amount[1]; + ret.stackSize = meta_amount[1]; return ret; } - public final ItemStack getStackWithNBT(NBTTagCompound tag, int... meta_amount){ + public final ItemStack getStackWithNBT(NBTTagCompound tag, int... meta_amount) { ItemStack ret = this.getStack(meta_amount); ret.setTagCompound(tag); return ret; @@ -126,8 +175,8 @@ public class BW_Meta_Items { @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { if (aCreativeTab == this.getCreativeTab()) - for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ - ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS,1,0); + for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()) { + ItemStack stack = new ItemStack(BW_Meta_Items.NEWCIRCUITS, 1, 0); stack.setTagCompound(tag); aList.add(stack); } @@ -137,35 +186,53 @@ public class BW_Meta_Items { @SideOnly(Side.CLIENT) public final void registerIcons(IIconRegister aIconRegister) { - for(short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { + for (short i = 0; i < CircuitImprintLoader.reverseIDs; ++i) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)),this.mIconList); + BW_Util.set2DCoordTo1DArray( + i, + 0, + 2, + aIconRegister.registerIcon( + "gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)), + this.mIconList); } } for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2, Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(),this.mIconList); - BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); - //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); + BW_Util.set2DCoordTo1DArray( + i, + 0, + 2, + Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)) + .get(1) + .getIconIndex(), + this.mIconList); + BW_Util.set2DCoordTo1DArray( + i, 1, 2, aIconRegister.registerIcon(MainMod.MOD_ID + ":WrapOverlay"), this.mIconList); + // aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + + // "/" + i)); } } - } @Override @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - if (aStack.getItemDamage() == 0 ) - if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) - aList.add("An Imprint for: "+GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); - else - aList.add("An Imprint for a Circuit"); - else if (aStack.getItemDamage() == 1 ) - if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) - aList.add("A Sliced "+GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); - else - aList.add("A Sliced Circuit"); + if (aStack.getItemDamage() == 0) + if (aStack.getTagCompound() != null + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add("An Imprint for: " + + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else aList.add("An Imprint for a Circuit"); + else if (aStack.getItemDamage() == 1) + if (aStack.getTagCompound() != null + && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) + aList.add("A Sliced " + + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName( + CircuitImprintLoader.getStackFromTag(aStack.getTagCompound())))); + else aList.add("A Sliced Circuit"); super.addAdditionalToolTips(aList, aStack, aPlayer); } } @@ -174,8 +241,9 @@ public class BW_Meta_Items { public static final HashSet<BW_Meta_Items.BW_GT_MetaGen_Item_Hook> sInstances = new HashSet<>(); public final IIcon[] mIconList; public final BitSet mEnabledItems; + { - this.mIconList = new IIcon[Short.MAX_VALUE*2]; + this.mIconList = new IIcon[Short.MAX_VALUE * 2]; this.mEnabledItems = new BitSet(Short.MAX_VALUE); } @@ -203,70 +271,69 @@ public class BW_Meta_Items { return null; } - @SuppressWarnings({"unchecked","rawtypes"}) + @SuppressWarnings({"unchecked", "rawtypes"}) public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { if (aToolTip == null) { aToolTip = ""; } - ItemStack rStack = new ItemStack(this, 1, aID); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip); - List<TC_Aspects.TC_AspectStack> tAspects = new ArrayList<>(); - this.mEnabledItems.set(aID); - Object[] var7 = aRandomData; - int var8 = aRandomData.length; - - int var9; - Object tRandomData; - for(var9 = 0; var9 < var8; ++var9) { - tRandomData = var7[var9]; - if (tRandomData instanceof SubTag) { - if (tRandomData == SubTag.NO_UNIFICATION) { - GT_OreDictUnificator.addToBlacklist(rStack); - } + ItemStack rStack = new ItemStack(this, 1, aID); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".name", aEnglish); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName(rStack) + ".tooltip", aToolTip); + List<TC_Aspects.TC_AspectStack> tAspects = new ArrayList<>(); + this.mEnabledItems.set(aID); + Object[] var7 = aRandomData; + int var8 = aRandomData.length; + + int var9; + Object tRandomData; + for (var9 = 0; var9 < var8; ++var9) { + tRandomData = var7[var9]; + if (tRandomData instanceof SubTag) { + if (tRandomData == SubTag.NO_UNIFICATION) { + GT_OreDictUnificator.addToBlacklist(rStack); } } + } - var7 = aRandomData; - var8 = aRandomData.length; + var7 = aRandomData; + var8 = aRandomData.length; - for(var9 = 0; var9 < var8; ++var9) { - tRandomData = var7[var9]; - if (tRandomData != null) { - boolean tUseOreDict = true; + for (var9 = 0; var9 < var8; ++var9) { + tRandomData = var7[var9]; + if (tRandomData != null) { + boolean tUseOreDict = true; - if (tRandomData instanceof IItemBehaviour) { - this.addItemBehavior(aID, - (IItemBehaviour) tRandomData); - tUseOreDict = false; - } + if (tRandomData instanceof IItemBehaviour) { + this.addItemBehavior(aID, (IItemBehaviour) tRandomData); + tUseOreDict = false; + } - if (tRandomData instanceof IItemContainer) { - ((IItemContainer)tRandomData).set(rStack); - tUseOreDict = false; - } + if (tRandomData instanceof IItemContainer) { + ((IItemContainer) tRandomData).set(rStack); + tUseOreDict = false; + } - if (!(tRandomData instanceof SubTag)) { - if (tRandomData instanceof TC_Aspects.TC_AspectStack) { - ((TC_Aspects.TC_AspectStack)tRandomData).addToAspectList(tAspects); - } else if (tRandomData instanceof ItemData) { - if (GT_Utility.isStringValid(tRandomData)) { - GT_OreDictUnificator.registerOre(tRandomData, rStack); - } else { - GT_OreDictUnificator.addItemData(rStack, (ItemData)tRandomData); - } - } else if (tUseOreDict) { + if (!(tRandomData instanceof SubTag)) { + if (tRandomData instanceof TC_Aspects.TC_AspectStack) { + ((TC_Aspects.TC_AspectStack) tRandomData).addToAspectList(tAspects); + } else if (tRandomData instanceof ItemData) { + if (GT_Utility.isStringValid(tRandomData)) { GT_OreDictUnificator.registerOre(tRandomData, rStack); + } else { + GT_OreDictUnificator.addItemData(rStack, (ItemData) tRandomData); } + } else if (tUseOreDict) { + GT_OreDictUnificator.registerOre(tRandomData, rStack); } } } + } - if (GregTech_API.sThaumcraftCompat != null) { - GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); - } + if (GregTech_API.sThaumcraftCompat != null) { + GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false); + } - return rStack; + return rStack; } @SideOnly(Side.CLIENT) @@ -274,14 +341,13 @@ public class BW_Meta_Items { public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { int j = this.mEnabledItems.length(); - for(int i = 0; i < j; ++i) { + for (int i = 0; i < j; ++i) { if (this.mEnabledItems.get(i)) { ItemStack tStack = new ItemStack(this, 1, i); this.isItemStackUsable(tStack); aList.add(tStack); } } - } @Override @@ -298,13 +364,13 @@ public class BW_Meta_Items { @Override public IIcon getIconFromDamage(int i) { - if (this.mEnabledItems.get(i)) - return (IIcon) BW_Util.get2DCoordFrom1DArray(i,0,2,this.mIconList); + if (this.mEnabledItems.get(i)) return (IIcon) BW_Util.get2DCoordFrom1DArray(i, 0, 2, this.mIconList); return null; } @Override - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + public IIcon getIcon( + ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { return this.getIconFromDamage(stack.getItemDamage()); } @@ -313,4 +379,4 @@ public class BW_Meta_Items { return this.getIconFromDamage(stack.getItemDamage()); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 33658ef8e9..19bf5bb662 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; import com.github.bartimaeusnek.bartworks.util.MurmurHash3; - import java.nio.ByteBuffer; public class CircuitData { @@ -50,7 +49,15 @@ public class CircuitData { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).put(this.aTier).putInt(this.aSpecial).putLong(this.aVoltage).array(),0,13,31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(13) + .put(this.aTier) + .putInt(this.aSpecial) + .putLong(this.aVoltage) + .array(), + 0, + 13, + 31); } public long getaVoltage() { 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 f3fc7ea816..1176712cc7 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 @@ -38,6 +38,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import java.util.HashSet; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -48,65 +49,70 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; -import java.util.HashSet; - public class CircuitImprintLoader { - public static short reverseIDs = Short.MAX_VALUE-1; + public static short reverseIDs = Short.MAX_VALUE - 1; - public static final ArrayListMultimap<NBTTagCompound,GT_Recipe> recipeTagMap = ArrayListMultimap.create(); + public static final ArrayListMultimap<NBTTagCompound, GT_Recipe> recipeTagMap = ArrayListMultimap.create(); public static final HashBiMap<Short, ItemList> circuitIIconRefs = HashBiMap.create(20); public static final HashSet<ItemStack> blacklistSet = new HashSet<>(); - static final HashBiMap<CircuitData,ItemStack> bwCircuitTagMap = HashBiMap.create(20); + static final HashBiMap<CircuitData, ItemStack> bwCircuitTagMap = HashBiMap.create(20); private static final HashSet<IRecipe> recipeWorldCache = new HashSet<>(); private static final HashSet<GT_Recipe> gtrecipeWorldCache = new HashSet<>(); private static final HashSet<GT_Recipe> ORIGINAL_CAL_RECIPES = new HashSet<>(); private static final HashSet<GT_Recipe> MODIFIED_CAL_RECIPES = new HashSet<>(); - @SuppressWarnings({"unused","RedundantSuppression"}) + @SuppressWarnings({"unused", "RedundantSuppression"}) public static void run() { HashSet<GT_Recipe> toRem = new HashSet<>(); HashSet<GT_Recipe> toAdd = new HashSet<>(); deleteCALRecipesAndTags(); - rebuildCircuitAssemblerMap(toRem,toAdd); - exchangeRecipesInList(toRem,toAdd); + rebuildCircuitAssemblerMap(toRem, toAdd); + exchangeRecipesInList(toRem, toAdd); makeCircuitImprintRecipes(); toRem = null; toAdd = null; } - private static void reAddOriginalRecipes(){ + private static void reAddOriginalRecipes() { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.removeAll(MODIFIED_CAL_RECIPES); GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.addAll(ORIGINAL_CAL_RECIPES); ORIGINAL_CAL_RECIPES.clear(); MODIFIED_CAL_RECIPES.clear(); } - private static void rebuildCircuitAssemblerMap(HashSet<GT_Recipe> toRem,HashSet<GT_Recipe> toAdd) { + private static void rebuildCircuitAssemblerMap(HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd) { reAddOriginalRecipes(); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach(e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList.forEach( + e -> CircuitImprintLoader.handleCircuitRecipeRebuilding(e, toRem, toAdd)); } - private static void handleCircuitRecipeRebuilding(GT_Recipe circuitRecipe, HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd) { + private static void handleCircuitRecipeRebuilding( + GT_Recipe circuitRecipe, HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd) { ItemStack[] outputs = circuitRecipe.mOutputs; boolean isOrePass = isCircuitOreDict(outputs[0]); String unlocalizedName = outputs[0].getUnlocalizedName(); if (isOrePass || unlocalizedName.contains("Circuit") || unlocalizedName.contains("circuit")) { - CircuitImprintLoader.recipeTagMap.put(CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); + CircuitImprintLoader.recipeTagMap.put( + CircuitImprintLoader.getTagFromStack(outputs[0]), circuitRecipe.copy()); - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); - if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0))||circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0))) { + if (circuitRecipe.mFluidInputs[0].isFluidEqual(Materials.SolderingAlloy.getMolten(0)) + || circuitRecipe.mFluidInputs[0].isFluidEqual(new FluidStack(solderIndalloy, 0))) { GT_Recipe newRecipe = CircuitImprintLoader.reBuildRecipe(circuitRecipe); if (newRecipe != null) - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).addRecipe(newRecipe); - addCutoffRecipeToSets(toRem,toAdd,circuitRecipe); + BWRecipes.instance + .getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE) + .addRecipe(newRecipe); + addCutoffRecipeToSets(toRem, toAdd, circuitRecipe); } else { - if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) - toRem.add(circuitRecipe); + if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) toRem.add(circuitRecipe); } } } @@ -115,15 +121,14 @@ public class CircuitImprintLoader { private static String getTypeFromOreDict(ItemStack[] outputs) { int[] oreIDS = OreDictionary.getOreIDs(outputs[0]); - if (oreIDS.length < 1) - return ""; + if (oreIDS.length < 1) return ""; return OreDictionary.getOreName(oreIDS[0]); } private static boolean isCircuitOreDict(ItemStack item) { return BW_Util.isTieredCircuit(item) - || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray")); + || BW_Util.getOreNames(item).stream().anyMatch(s -> s.equals("circuitPrimitiveArray")); } private static void exchangeRecipesInList(HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd) { @@ -133,7 +138,8 @@ public class CircuitImprintLoader { MODIFIED_CAL_RECIPES.addAll(toAdd); } - private static void addCutoffRecipeToSets(HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd, GT_Recipe circuitRecipe) { + private static void addCutoffRecipeToSets( + HashSet<GT_Recipe> toRem, HashSet<GT_Recipe> toAdd, GT_Recipe circuitRecipe) { if (circuitRecipe.mEUt > BW_Util.getTierVoltage(ConfigHandler.cutoffTier)) { toRem.add(circuitRecipe); toAdd.add(CircuitImprintLoader.makeMoreExpensive(circuitRecipe)); @@ -143,7 +149,7 @@ public class CircuitImprintLoader { @SuppressWarnings("deprecation") public static GT_Recipe makeMoreExpensive(GT_Recipe original) { GT_Recipe newRecipe = original.copy(); - for (ItemStack is : newRecipe.mInputs){ + for (ItemStack is : newRecipe.mInputs) { if (!BW_Util.isTieredCircuit(is)) { is.stackSize = Math.min(is.stackSize * 6, 64); if (is.stackSize > is.getItem().getItemStackLimit() || is.stackSize > is.getMaxStackSize()) @@ -161,8 +167,8 @@ public class CircuitImprintLoader { for (int i = 0; i < 6; i++) { try { - replaceCircuits(inversed,original,in,i); - replaceComponents(in,original,i); + replaceCircuits(inversed, original, in, i); + replaceComponents(in, original, i); } catch (ArrayIndexOutOfBoundsException e) { break; } catch (NullPointerException e) { @@ -174,40 +180,66 @@ public class CircuitImprintLoader { return null; } - return new BWRecipes.DynamicGTRecipe(false, in, new ItemStack[]{getOutputMultiplied(original)}, BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), null, original.mFluidInputs, null, original.mDuration * 12, original.mEUt, 0); + return new BWRecipes.DynamicGTRecipe( + false, + in, + new ItemStack[] {getOutputMultiplied(original)}, + BW_Meta_Items.getNEWCIRCUITS() + .getStackWithNBT(CircuitImprintLoader.getTagFromStack(original.mOutputs[0]), 0, 0), + null, + original.mFluidInputs, + null, + original.mDuration * 12, + original.mEUt, + 0); } - private static ItemStack getOutputMultiplied(GT_Recipe original){ + private static ItemStack getOutputMultiplied(GT_Recipe original) { ItemStack out = original.copy().getOutput(0); out.stackSize *= 16; return out; } - private static void replaceCircuits(BiMap<ItemList, Short> inversed, GT_Recipe original, ItemStack[] in, int index){ + private static void replaceCircuits( + BiMap<ItemList, Short> inversed, GT_Recipe original, ItemStack[] in, int index) { for (ItemList il : inversed.keySet()) { if (GT_Utility.areStacksEqual(il.get(1), original.mInputs[index])) { - in[index] = BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); + in[index] = + BW_Meta_Items.getNEWCIRCUITS().getStack(inversed.get(il), original.mInputs[index].stackSize); } } } @SuppressWarnings("deprecation") - private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) throws ArrayIndexOutOfBoundsException { + private static void replaceComponents(ItemStack[] in, GT_Recipe original, int index) + throws ArrayIndexOutOfBoundsException { if (original.mInputs[index] != null && in[index] == null) { - //big wires - if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { - in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt16, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); - //fine wires - } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { - in[index] = GT_OreDictUnificator.get(OrePrefixes.wireGt04, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize); + // big wires + if (BW_Util.checkStackAndPrefix(original.mInputs[index]) + && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireGt01) { + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireGt16, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); + // fine wires + } else if (BW_Util.checkStackAndPrefix(original.mInputs[index]) + && GT_OreDictUnificator.getAssociation(original.mInputs[index]).mPrefix == OrePrefixes.wireFine) { + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireGt04, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize); if (in[index] == null) { - in[index] = GT_OreDictUnificator.get(OrePrefixes.wireFine, GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, original.mInputs[index].stackSize * 16); + in[index] = GT_OreDictUnificator.get( + OrePrefixes.wireFine, + GT_OreDictUnificator.getAssociation(original.mInputs[index]).mMaterial.mMaterial, + original.mInputs[index].stackSize * 16); } - //other components + // other components } else { in[index] = original.mInputs[index].copy(); in[index].stackSize *= 16; - if (in[index].stackSize > in[index].getItem().getItemStackLimit() || in[index].stackSize > in[index].getMaxStackSize()) + if (in[index].stackSize > in[index].getItem().getItemStackLimit() + || in[index].stackSize > in[index].getMaxStackSize()) in[index].stackSize = in[index].getMaxStackSize(); } } @@ -222,10 +254,9 @@ public class CircuitImprintLoader { } private static boolean checkForBlacklistedComponents(ItemStack[] itemStacks) { - for (ItemStack is: itemStacks){ - for (ItemStack is2 : CircuitImprintLoader.blacklistSet){ - if (GT_Utility.areStacksEqual(is,is2)) - return true; + for (ItemStack is : itemStacks) { + for (ItemStack is2 : CircuitImprintLoader.blacklistSet) { + if (GT_Utility.areStacksEqual(is, is2)) return true; } } return false; @@ -235,15 +266,13 @@ public class CircuitImprintLoader { recipeWorldCache.forEach(CraftingManager.getInstance().getRecipeList()::remove); BWCoreStaticReplacementMethodes.clearRecentlyUsedRecipes(); gtrecipeWorldCache.forEach(GT_Recipe.GT_Recipe_Map.sSlicerRecipes.mRecipeList::remove); - recipeWorldCache.forEach( r -> - { - try { - BW_Util.getGTBufferedRecipeList().remove(r); - } catch (Exception e) { - e.printStackTrace(); - } - } - ); + recipeWorldCache.forEach(r -> { + try { + BW_Util.getGTBufferedRecipeList().remove(r); + } catch (Exception e) { + e.printStackTrace(); + } + }); recipeWorldCache.clear(); gtrecipeWorldCache.clear(); } @@ -256,37 +285,60 @@ public class CircuitImprintLoader { eut = Math.min(eut, recipe.mEUt); } - eut = Math.min(eut, BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName((OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0) ? OreDictionary.getOreIDs(stack)[0] : -1)))); - 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,eut, BW_Util.CLEANROOM); + eut = Math.min( + eut, + BW_Util.getMachineVoltageFromTier(BW_Util.getCircuitTierFromOreDictName(OreDictionary.getOreName( + (OreDictionary.getOreIDs(stack) != null && OreDictionary.getOreIDs(stack).length > 0) + ? OreDictionary.getOreIDs(stack)[0] + : -1)))); + 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, + eut, + BW_Util.CLEANROOM); gtrecipeWorldCache.add(slicingRecipe); GT_Recipe.GT_Recipe_Map.sSlicerRecipes.add(slicingRecipe); } private static void makeAndAddCraftingRecipes(NBTTagCompound tag) { - ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag,0,1); + ItemStack circuit = BW_Meta_Items.getNEWCIRCUITS().getStackWithNBT(tag, 0, 1); Object[] imprintRecipe = { - " 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) + " 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) }; - IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit,imprintRecipe); - ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe(circuit, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.KEEPNBT | GT_ModHandler.RecipeBits.BUFFERED, imprintRecipe); + IRecipe bwrecipe = new BWRecipes.BWNBTDependantCraftingRecipe(circuit, imprintRecipe); + ShapedOreRecipe gtrecipe = BW_Util.createGTCraftingRecipe( + circuit, + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.KEEPNBT + | GT_ModHandler.RecipeBits.BUFFERED, + imprintRecipe); - //Adds the actual recipe + // Adds the actual recipe recipeWorldCache.add(bwrecipe); GameRegistry.addRecipe(bwrecipe); - //Adds the NEI visual recipe + // Adds the NEI visual recipe recipeWorldCache.add(gtrecipe); GameRegistry.addRecipe(gtrecipe); } public static NBTTagCompound getTagFromStack(ItemStack stack) { if (GT_Utility.isStackValid(stack)) - return BW_Util.setStackSize(stack.copy(),1).writeToNBT(new NBTTagCompound()); + return BW_Util.setStackSize(stack.copy(), 1).writeToNBT(new NBTTagCompound()); return new NBTTagCompound(); } @@ -295,8 +347,10 @@ public class CircuitImprintLoader { } private static void deleteCALRecipesAndTags() { - BWRecipes.instance.getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE).mRecipeList.clear(); - recipeTagMap.clear(); + BWRecipes.instance + .getMappingsFor(BWRecipes.CIRCUITASSEMBLYLINE) + .mRecipeList + .clear(); + recipeTagMap.clear(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index c0613200df..fbec204c80 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration; +import static gregtech.api.enums.ItemList.*; + import com.github.bartimaeusnek.bartworks.client.renderer.BW_GT_ItemRenderer; import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.GT_Values; @@ -29,68 +31,65 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; - -import static gregtech.api.enums.ItemList.*; +import net.minecraft.item.ItemStack; public class CircuitPartLoader implements Runnable { @Override public void run() { CircuitPartLoader.makeCircuitParts(); - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) - new BW_GT_ItemRenderer(); + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) new BW_GT_ItemRenderer(); } public static void makeCircuitParts() { ItemList[] itemLists = values(); for (ItemList single : itemLists) { - if (!single.hasBeenSet()) - continue; - if ( - single.toString().contains("Wafer") || - single.toString().contains("Circuit_Silicon_Ingot") || - single.toString().contains("Raw") || - single.toString().contains("raw") || - single.toString().contains("Glass_Tube") || - single == Circuit_Parts_GlassFiber || - single == Circuit_Parts_Advanced || - single == Circuit_Parts_Wiring_Advanced || - single == Circuit_Parts_Wiring_Elite || - single == Circuit_Parts_Wiring_Basic || - single == Circuit_Integrated || - single == Circuit_Parts_PetriDish || - single == Circuit_Parts_Vacuum_Tube || - single == Circuit_Integrated_Good || - single == Circuit_Parts_Capacitor || - single == Circuit_Parts_Diode || - single == Circuit_Parts_Resistor || - single == Circuit_Parts_Transistor + if (!single.hasBeenSet()) continue; + if (single.toString().contains("Wafer") + || single.toString().contains("Circuit_Silicon_Ingot") + || single.toString().contains("Raw") + || single.toString().contains("raw") + || single.toString().contains("Glass_Tube") + || single == Circuit_Parts_GlassFiber + || single == Circuit_Parts_Advanced + || single == Circuit_Parts_Wiring_Advanced + || single == Circuit_Parts_Wiring_Elite + || single == Circuit_Parts_Wiring_Basic + || single == Circuit_Integrated + || single == Circuit_Parts_PetriDish + || single == Circuit_Parts_Vacuum_Tube + || single == Circuit_Integrated_Good + || single == Circuit_Parts_Capacitor + || single == Circuit_Parts_Diode + || single == Circuit_Parts_Resistor + || single == Circuit_Parts_Transistor) { - ){ CircuitImprintLoader.blacklistSet.add(single.get(1)); } } for (ItemList single : CIRCUIT_PARTS) { - if (!single.hasBeenSet()) - continue; + if (!single.hasBeenSet()) continue; ItemStack itemStack = single.get(1); - if (!GT_Utility.isStackValid(itemStack)) - continue; + if (!GT_Utility.isStackValid(itemStack)) continue; ArrayList<String> toolTip = new ArrayList<>(); if (FMLCommonHandler.instance().getEffectiveSide().isClient()) single.getItem().addInformation(single.get(1).copy(), null, toolTip, true); String tt = (toolTip.size() > 0 ? toolTip.get(0) : ""); // tt += "Internal Name = "+single; - String localised = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised+"s", tt); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, Materials.Plastic.getMolten(72),BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs),600,30); - CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs,single); + String localised = + GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); + BW_Meta_Items.getNEWCIRCUITS().addItem(CircuitImprintLoader.reverseIDs, "Wrap of " + localised + "s", tt); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] {single.get(16).copy(), GT_Utility.getIntegratedCircuit(16)}, + Materials.Plastic.getMolten(72), + BW_Meta_Items.getNEWCIRCUITS().getStack(CircuitImprintLoader.reverseIDs), + 600, + 30); + CircuitImprintLoader.circuitIIconRefs.put(CircuitImprintLoader.reverseIDs, single); CircuitImprintLoader.reverseIDs--; } } @@ -100,64 +99,63 @@ public class CircuitPartLoader implements Runnable { * New entries MUST be placed at the END of this list, to prevent id shift. */ private static final List<ItemList> CIRCUIT_PARTS = Collections.unmodifiableList(Arrays.asList( - Circuit_Board_Basic, - Circuit_Board_Advanced, - Circuit_Board_Elite, - Circuit_Parts_Crystal_Chip_Elite, - Circuit_Parts_Crystal_Chip_Master, - Circuit_Board_Coated, - Circuit_Board_Coated_Basic, - Circuit_Board_Phenolic, - Circuit_Board_Phenolic_Good, - Circuit_Board_Epoxy, - Circuit_Board_Epoxy_Advanced, - Circuit_Board_Fiberglass, - Circuit_Board_Fiberglass_Advanced, - Circuit_Board_Multifiberglass_Elite, - Circuit_Board_Multifiberglass, - Circuit_Board_Wetware, - Circuit_Board_Wetware_Extreme, - Circuit_Board_Plastic, - Circuit_Board_Plastic_Advanced, - Circuit_Board_Bio, - Circuit_Board_Bio_Ultra, - Circuit_Parts_ResistorSMD, - Circuit_Parts_Coil, - Circuit_Parts_DiodeSMD, - Circuit_Parts_TransistorSMD, - Circuit_Parts_CapacitorSMD, - Circuit_Parts_ResistorASMD, - Circuit_Parts_DiodeASMD, - Circuit_Parts_TransistorASMD, - Circuit_Parts_CapacitorASMD, - Circuit_Chip_ILC, - Circuit_Chip_Ram, - Circuit_Chip_NAND, - Circuit_Chip_NOR, - Circuit_Chip_CPU, - Circuit_Chip_SoC, - Circuit_Chip_SoC2, - Circuit_Chip_PIC, - Circuit_Chip_Simple_SoC, - Circuit_Chip_HPIC, - Circuit_Chip_UHPIC, - Circuit_Chip_ULPIC, - Circuit_Chip_LPIC, - Circuit_Chip_NPIC, - Circuit_Chip_PPIC, - Circuit_Chip_QPIC, - Circuit_Chip_NanoCPU, - Circuit_Chip_QuantumCPU, - Circuit_Chip_CrystalCPU, - Circuit_Chip_CrystalSoC, - Circuit_Chip_CrystalSoC2, - Circuit_Chip_NeuroCPU, - Circuit_Chip_BioCPU, - Circuit_Chip_Stemcell, - Circuit_Chip_Biocell, - Circuit_Parts_ResistorXSMD, - Circuit_Parts_DiodeXSMD, - Circuit_Parts_TransistorXSMD, - Circuit_Parts_CapacitorXSMD - )); + Circuit_Board_Basic, + Circuit_Board_Advanced, + Circuit_Board_Elite, + Circuit_Parts_Crystal_Chip_Elite, + Circuit_Parts_Crystal_Chip_Master, + Circuit_Board_Coated, + Circuit_Board_Coated_Basic, + Circuit_Board_Phenolic, + Circuit_Board_Phenolic_Good, + Circuit_Board_Epoxy, + Circuit_Board_Epoxy_Advanced, + Circuit_Board_Fiberglass, + Circuit_Board_Fiberglass_Advanced, + Circuit_Board_Multifiberglass_Elite, + Circuit_Board_Multifiberglass, + Circuit_Board_Wetware, + Circuit_Board_Wetware_Extreme, + Circuit_Board_Plastic, + Circuit_Board_Plastic_Advanced, + Circuit_Board_Bio, + Circuit_Board_Bio_Ultra, + Circuit_Parts_ResistorSMD, + Circuit_Parts_Coil, + Circuit_Parts_DiodeSMD, + Circuit_Parts_TransistorSMD, + Circuit_Parts_CapacitorSMD, + Circuit_Parts_ResistorASMD, + Circuit_Parts_DiodeASMD, + Circuit_Parts_TransistorASMD, + Circuit_Parts_CapacitorASMD, + Circuit_Chip_ILC, + Circuit_Chip_Ram, + Circuit_Chip_NAND, + Circuit_Chip_NOR, + Circuit_Chip_CPU, + Circuit_Chip_SoC, + Circuit_Chip_SoC2, + Circuit_Chip_PIC, + Circuit_Chip_Simple_SoC, + Circuit_Chip_HPIC, + Circuit_Chip_UHPIC, + Circuit_Chip_ULPIC, + Circuit_Chip_LPIC, + Circuit_Chip_NPIC, + Circuit_Chip_PPIC, + Circuit_Chip_QPIC, + Circuit_Chip_NanoCPU, + Circuit_Chip_QuantumCPU, + Circuit_Chip_CrystalCPU, + Circuit_Chip_CrystalSoC, + Circuit_Chip_CrystalSoC2, + Circuit_Chip_NeuroCPU, + Circuit_Chip_BioCPU, + Circuit_Chip_Stemcell, + Circuit_Chip_Biocell, + Circuit_Parts_ResistorXSMD, + Circuit_Parts_DiodeXSMD, + Circuit_Parts_TransistorXSMD, + Circuit_Parts_CapacitorXSMD)); } 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 500fda4653..69b43684ce 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 @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement.GTMetaItemEnhancer.NoMetaValue; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; @@ -36,6 +38,10 @@ import gregtech.api.enums.TextureSet; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.util.GT_OreDictUnificator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -45,65 +51,61 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import java.util.HashMap; -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); - //materialloop: + super(orePrefixes, null); + // materialloop: for (int i = 0; i < Materials.values().length; i++) { ItemStack tStack = new ItemStack(this, 1, i); Materials material = Materials.values()[i]; - if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((material.getFluid(1) == null && material.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) - continue; - //for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + if (((material.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((material.getFluid(1) == null && material.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; + // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) // if (material.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) // continue materialloop; - if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""))){ + if (OreDictionary.doesOreNameExist( + this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; } - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre( + this.orePrefixes.name() + material.mDefaultLocalName.replaceAll(" ", ""), tStack); } if (noSubIDMaterials != null) { hasList = true; - //materialloop: + // materialloop: for (int i = 0; i < noSubIDMaterials.size(); i++) { - ItemStack tStack = new ItemStack(this, 1, i+1001); + ItemStack tStack = new ItemStack(this, 1, i + 1001); Materials w = noSubIDMaterials.get(i); - if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) + if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) + || ((w.getFluid(1) == null && w.getGas(1) == null) + && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; - //for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) + // for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) // if (w.mDefaultLocalName.equalsIgnoreCase(werkstoff.getDefaultName())) // continue materialloop; - if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""))){ + if (OreDictionary.doesOreNameExist(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""))) { hiddenThings.add(i); continue; } - GT_OreDictUnificator.registerOre(this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ",""), tStack); + GT_OreDictUnificator.registerOre( + this.orePrefixes.name() + w.mDefaultLocalName.replaceAll(" ", ""), tStack); } } } private Materials getMaterial(ItemStack is) { - if (is == null || is.getItem() != this) - return null; + if (is == null || is.getItem() != this) return null; final int meta = is.getItemDamage(); Materials material; - if (meta > 1000 && hasList) - material = NoMetaValue.get(meta - 1001); - else - material = Materials.values()[meta]; + if (meta > 1000 && hasList) material = NoMetaValue.get(meta - 1001); + else material = Materials.values()[meta]; return material; } @@ -127,12 +129,11 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } - @Override + @Override public IIconContainer getIconContainer(int aMetaData) { - if (this.orePrefixes.mTextureIndex == -1) - return getIconContainerBartWorks(aMetaData); + if (this.orePrefixes.mTextureIndex == -1) return getIconContainerBartWorks(aMetaData); if (aMetaData > 1000 && hasList) - return NoMetaValue.get(aMetaData-1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; + return NoMetaValue.get(aMetaData - 1001).mIconSet.mTextures[this.orePrefixes.mTextureIndex]; if (aMetaData < 0 || aMetaData > Materials.values().length || Materials.values()[(short) aMetaData] == null) return null; return Materials.values()[(short) aMetaData].mIconSet.mTextures[this.orePrefixes.mTextureIndex]; @@ -140,23 +141,18 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override protected IIconContainer getIconContainerBartWorks(int aMetaData) { - if (SideReference.Side.Server || PrefixTextureLinker.texMap == null) - return null; + if (SideReference.Side.Server || PrefixTextureLinker.texMap == null) return null; HashMap<TextureSet, Textures.ItemIcons.CustomIcon> iconLink = PrefixTextureLinker.texMap.get(this.orePrefixes); - if (iconLink == null) - return null; + if (iconLink == null) return null; Materials material; - if (aMetaData > 1000 && hasList) - material = NoMetaValue.get(aMetaData-1001); - else - material = Materials.values()[aMetaData]; + if (aMetaData > 1000 && hasList) material = NoMetaValue.get(aMetaData - 1001); + else material = Materials.values()[aMetaData]; - if (material == null || material.mIconSet == null) - return null; + if (material == null || material.mIconSet == null) return null; return iconLink.get(material.mIconSet); } @@ -167,50 +163,49 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) - 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; + if ((w == null) + || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) 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) for (int i = 0; i < NoMetaValue.size(); i++) { Materials w = NoMetaValue.get(i); - if ((w == null) || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) - 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)) + if ((w == null) + || (w.mTypes & Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes)) == 0 + && Werkstoff.GenerationFeatures.getPrefixDataRaw(this.orePrefixes) != 0) 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)); } } @Override public short[] getColorForGUI(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + if (aStack.getItemDamage() > 1000 && hasList) return NoMetaValue.get(aStack.getItemDamage() - 1001).mRGBa; return Materials.values()[aStack.getItemDamage()].mRGBa; } @Override public String getNameForGUI(ItemStack aStack) { if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage()-1001).mDefaultLocalName; + return NoMetaValue.get(aStack.getItemDamage() - 1001).mDefaultLocalName; return Materials.values()[aStack.getItemDamage()].mDefaultLocalName; } @Override - public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) { - - } + public void onUpdate(ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {} @Override public short[] getRGBa(ItemStack aStack) { - if (aStack.getItemDamage() > 1000 && hasList) - return NoMetaValue.get(aStack.getItemDamage()-1001).mRGBa; + if (aStack.getItemDamage() > 1000 && hasList) return NoMetaValue.get(aStack.getItemDamage() - 1001).mRGBa; return Materials.values()[aStack.getItemDamage()].mRGBa; } 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 75a2846172..5f0730b1a3 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 @@ -30,6 +30,8 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import java.util.List; +import java.util.stream.Collectors; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -37,14 +39,10 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.List; -import java.util.stream.Collectors; - public class GTMetaItemEnhancer { - static List<Materials> NoMetaValue; + static List<Materials> NoMetaValue; - private GTMetaItemEnhancer() { - } + private GTMetaItemEnhancer() {} public static void init() { if (!WerkstoffLoader.gtnhGT) { @@ -52,64 +50,86 @@ 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) - continue; - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(m.getMolten(144), new ItemStack(moltenCell, 1, i), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L)); + 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)); + 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) { return; } - NoMetaValue = Materials.getMaterialsMap().values().stream().filter(m -> m.mMetaItemSubID == -1).collect(Collectors.toList()); + 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); + // 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)); + 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)); + 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; + 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; + 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); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + new FluidStack(f, amount), new ItemStack(filled, 1, it), container); FluidContainerRegistry.registerFluidContainer(emptyData); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(new ItemStack(filled, 1, it), empty ? GT_Values.NI : container, GT_Values.NF, new FluidStack(f, amount)); + GT_Values.RA.addFluidCannerRecipe( + container, new ItemStack(filled, 1, it), new FluidStack(f, amount), GT_Values.NF); + 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; + public static void addAdditionalOreDictToForestry() { + if (!LoaderReference.Forestry) return; OreDictionary.registerOre("capsuleWater", getForestryItem("waxCapsuleWater")); OreDictionary.registerOre("capsuleIce", getForestryItem("waxCapsuleIce")); OreDictionary.registerOre("capsuleHoney", getForestryItem("waxCapsuleHoney")); @@ -124,7 +144,7 @@ public class GTMetaItemEnhancer { OreDictionary.registerOre("capsuleLava", getForestryItem("refractoryLava")); } - private static ItemStack getForestryItem(String itemName){ + 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/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index 7ce3eeb5c3..47989db5cc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -35,6 +38,11 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -43,15 +51,6 @@ import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.lang3.reflect.MethodUtils; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; - -import static com.github.bartimaeusnek.bartworks.MainMod.MOD_ID; -import static gregtech.api.enums.OrePrefixes.*; - @SuppressWarnings("ALL") public class LuVTierEnhancer implements Runnable { @@ -66,7 +65,9 @@ public class LuVTierEnhancer implements Runnable { List<IRecipe> bufferedRecipeList = null; try { - bufferedRecipeList = (List<IRecipe>) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null); + bufferedRecipeList = + (List<IRecipe>) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) + .get(null); } catch (IllegalAccessException e) { e.printStackTrace(); } @@ -77,25 +78,21 @@ public class LuVTierEnhancer implements Runnable { Arrays.stream(ItemList.values()) .filter(item -> item.toString().contains("LuV") && item.hasBeenSet()) - .forEach(item -> LuVMachines.add(item.get(1))); + .forEach(item -> LuVMachines.add(item.get(1))); if (LoaderReference.dreamcraft) { addDreamcraftItemListItems(LuVMachines); } - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), - GT_ModHandler.RecipeBits.BUFFERED | - GT_ModHandler.RecipeBits.REVERSIBLE | - GT_ModHandler.RecipeBits.NOT_REMOVABLE | - GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, - new Object[]{ - "PPP", - "PwP", - "PPP", - 'P', WerkstoffLoader.LuVTierMaterial.get(plate) - }); + GT_ModHandler.addCraftingRecipe( + ItemList.Casing_LuV.get(1), + GT_ModHandler.RecipeBits.BUFFERED + | GT_ModHandler.RecipeBits.REVERSIBLE + | GT_ModHandler.RecipeBits.NOT_REMOVABLE + | GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES, + new Object[] {"PPP", "PwP", "PPP", 'P', WerkstoffLoader.LuVTierMaterial.get(plate)}); - replaceAllRecipes(LuVMachines,LuVMaterialsGenerated,bufferedRecipeList); + replaceAllRecipes(LuVMachines, LuVMaterialsGenerated, bufferedRecipeList); AfterLuVTierEnhacement.run(); } @@ -104,7 +101,8 @@ public class LuVTierEnhancer implements Runnable { blackListForOsmiridium.add(stack); } - private static void replaceAllRecipes(Collection<ItemStack> LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List<IRecipe> bufferedRecipeList){ + private static void replaceAllRecipes( + Collection<ItemStack> LuVMachines, OrePrefixes[] LuVMaterialsGenerated, List<IRecipe> bufferedRecipeList) { LuVTierEnhancer.replaceOsmiridiumInLuVRecipes(); for (GT_Recipe_AssemblyLine sAssemblylineRecipe : GT_Recipe_AssemblyLine.sAssemblylineRecipes) { @@ -122,17 +120,19 @@ public class LuVTierEnhancer implements Runnable { } for (ItemStack stack : LuVMachines) { - Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); + Predicate recipeFilter = obj -> obj instanceof GT_Shaped_Recipe + && GT_Utility.areStacksEqual(((GT_Shaped_Recipe) obj).getRecipeOutput(), stack, true); rewriteCraftingRecipes(bufferedRecipeList, LuVMaterialsGenerated, recipeFilter); } } - private static void addDreamcraftItemListItems(Collection LuVMachines){ + private static void addDreamcraftItemListItems(Collection LuVMachines) { try { Class customItemListClass = Class.forName("com.dreammaster.gthandler.CustomItemList"); Method hasnotBeenSet = MethodUtils.getAccessibleMethod(customItemListClass, "hasBeenSet"); Method get = MethodUtils.getAccessibleMethod(customItemListClass, "get", long.class, Object[].class); - for (Enum customItemList : (Enum[]) FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { + for (Enum customItemList : (Enum[]) + FieldUtils.getField(customItemListClass, "$VALUES", true).get(null)) { if (customItemList.toString().contains("LuV") && (boolean) hasnotBeenSet.invoke(customItemList)) LuVMachines.add((ItemStack) get.invoke(customItemList, 1, new Object[0])); } @@ -141,14 +141,20 @@ public class LuVTierEnhancer implements Runnable { } } - private static void rewriteCraftingRecipes(List<IRecipe> bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter){ + private static void rewriteCraftingRecipes( + List<IRecipe> bufferedRecipeList, OrePrefixes[] LuVMaterialsGenerated, Predicate recipeFilter) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace(null, ((GT_Shaped_Recipe) obj).getInput(), - GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, + Consumer recipeAction = obj -> LuVTierEnhancer.doStacksContainAndReplace( + null, + ((GT_Shaped_Recipe) obj).getInput(), + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - CraftingManager.getInstance().getRecipeList().stream().filter(recipeFilter).forEach(recipeAction); + CraftingManager.getInstance().getRecipeList().stream() + .filter(recipeFilter) + .forEach(recipeAction); bufferedRecipeList.stream().filter(recipeFilter).forEach(recipeAction); } } @@ -156,72 +162,132 @@ public class LuVTierEnhancer implements Runnable { private static void rewriteMachineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe recipe) { if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mOutputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidOutputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, stack, false)) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mOutputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mOutputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidOutputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidOutputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } } - private static void rewriteAsslineRecipes(ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe){ + + private static void rewriteAsslineRecipes( + ItemStack stack, OrePrefixes[] LuVMaterialsGenerated, GT_Recipe.GT_Recipe_AssemblyLine recipe) { for (OrePrefixes prefixes : LuVMaterialsGenerated) { if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + new Object[] {recipe.mOutput}, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); - LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), true, WerkstoffLoader.LuVTierMaterial.get(prefixes)); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] {recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mInputs, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + new Object[] {recipe.mOutput}, + GT_OreDictUnificator.get(prefixes, Materials.Chrome, 1), + true, + WerkstoffLoader.LuVTierMaterial.get(prefixes)); } } if (LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mInputs, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } - if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[]{recipe.mOutput}, stack, false)) { - LuVTierEnhancer.doStacksContainAndReplace(recipe, recipe.mFluidInputs, Materials.Chrome.getMolten(1), true, WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); + if (LuVTierEnhancer.doStacksContainAndReplace(recipe, new Object[] {recipe.mOutput}, stack, false)) { + LuVTierEnhancer.doStacksContainAndReplace( + recipe, + recipe.mFluidInputs, + Materials.Chrome.getMolten(1), + true, + WerkstoffLoader.LuVTierMaterial.getMolten(1).getFluid()); } } private static void replaceOsmiridiumInLuVRecipes() { - Consumer<GT_Recipe> replace = gt_recipe -> - gt_recipe.mInputs = replaceArrayWith( - gt_recipe.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - gt_recipe - ); + Consumer<GT_Recipe> replace = gt_recipe -> gt_recipe.mInputs = + replaceArrayWith(gt_recipe.mInputs, Materials.Osmiridium, WerkstoffLoader.Ruridit, gt_recipe); GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() .filter(recipe_assemblyLine -> recipe_assemblyLine.mEUt <= 6000) - .forEach(recipe_assemblyLine -> - recipe_assemblyLine.mInputs = replaceArrayWith( - recipe_assemblyLine.mInputs, - Materials.Osmiridium, - WerkstoffLoader.Ruridit, - recipe_assemblyLine - ) - ); + .forEach(recipe_assemblyLine -> recipe_assemblyLine.mInputs = replaceArrayWith( + recipe_assemblyLine.mInputs, + Materials.Osmiridium, + WerkstoffLoader.Ruridit, + recipe_assemblyLine)); GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList.stream() - .filter(gt_recipe -> - gt_recipe.mEUt < BW_Util.getTierVoltage(6) && - !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) && - !isOutputBlackListed(gt_recipe.mOutputs[0]) - ) + .filter(gt_recipe -> gt_recipe.mEUt < BW_Util.getTierVoltage(6) + && !BW_Util.checkStackAndPrefix(gt_recipe.mOutputs[0]) + && !isOutputBlackListed(gt_recipe.mOutputs[0])) .forEach(replace); GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream() - .filter(gt_recipe -> gt_recipe.mEUt <= 6000 && - !isOutputBlackListed(gt_recipe.mOutputs[0]) - ) + .filter(gt_recipe -> gt_recipe.mEUt <= 6000 && !isOutputBlackListed(gt_recipe.mOutputs[0])) .forEach(replace); } @@ -230,12 +296,12 @@ public class LuVTierEnhancer implements Runnable { return false; } - private static ItemStack[] replaceArrayWith(ItemStack[] stackArray, Materials source, Werkstoff target, Object recipe) { + private static ItemStack[] replaceArrayWith( + ItemStack[] stackArray, Materials source, Werkstoff target, Object recipe) { boolean replaced = false; for (int i = 0; i < stackArray.length; i++) { ItemStack stack = stackArray[i]; - if (!BW_Util.checkStackAndPrefix(stack)) - continue; + if (!BW_Util.checkStackAndPrefix(stack)) continue; stackArray[i] = replaceStackWith(stack, source, target, recipe); } return stackArray; @@ -249,19 +315,19 @@ public class LuVTierEnhancer implements Runnable { if (recipe instanceof GT_Recipe) { ((GT_Recipe) recipe).setOwner(MOD_ID); } else if (recipe instanceof GT_Recipe_AssemblyLine) { - // todo: update NEI fake recipe + // todo: update NEI fake recipe } } } return stack; } - private static boolean doStacksContainAndReplace(Object recipe, FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { + private static boolean doStacksContainAndReplace( + Object recipe, FluidStack[] stacks, FluidStack stack, boolean replace, Fluid... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (GT_Utility.areFluidsEqual(stack, stacks[i])) - if (!replace) - return true; + if (!replace) return true; else { int amount = stacks[i].amount; stacks[i] = new FluidStack(replacement[0], amount); @@ -278,26 +344,24 @@ public class LuVTierEnhancer implements Runnable { return replaced; } - private static boolean doStacksContainAndReplace(Object recipe, Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { + private static boolean doStacksContainAndReplace( + Object recipe, Object[] stacks, ItemStack stack, boolean replace, ItemStack... replacement) { boolean replaced = false; for (int i = 0; i < stacks.length; i++) { if (!GT_Utility.isStackValid(stacks[i])) { - if (stacks[i] instanceof ArrayList && ((ArrayList)stacks[i]).size() > 0) { - if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList)stacks[i]).get(0), true)) - if (!replace) - return true; + if (stacks[i] instanceof ArrayList && ((ArrayList) stacks[i]).size() > 0) { + if (GT_Utility.areStacksEqual(stack, (ItemStack) ((ArrayList) stacks[i]).get(0), true)) + if (!replace) return true; else { - int amount = ((ItemStack) ((ArrayList)stacks[i]).get(0)).stackSize; + int amount = ((ItemStack) ((ArrayList) stacks[i]).get(0)).stackSize; stacks[i] = new ArrayList<>(); - ((ArrayList)stacks[i]).add(BW_Util.setStackSize(replacement[0], amount)); + ((ArrayList) stacks[i]).add(BW_Util.setStackSize(replacement[0], amount)); replaced = true; } - } else - continue; + } else continue; } else if (GT_Utility.areStacksEqual(stack, (ItemStack) stacks[i], true)) - if (!replace) - return true; + if (!replace) return true; else { int amount = ((ItemStack) stacks[i]).stackSize; stacks[i] = BW_Util.setStackSize(replacement[0], amount); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index b7b4d07894..773c23812b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Items; @@ -44,6 +47,9 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores_Abstract; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.*; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.*; @@ -52,217 +58,654 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static gregtech.api.enums.OrePrefixes.*; - public class PlatinumSludgeOverHaul { private static final Materials[] BLACKLIST = { - Materials.HSSS, - Materials.EnderiumBase, - Materials.Osmiridium, - Materials.get("Uraniumtriplatinid"), - Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), - Materials.get("Longasssuperconductornameforuvwire"), + Materials.HSSS, + Materials.EnderiumBase, + Materials.Osmiridium, + Materials.get("Uraniumtriplatinid"), + Materials.get("Tetranaquadahdiindiumhexaplatiumosminid"), + Materials.get("Longasssuperconductornameforuvwire"), }; private static final OrePrefixes[] OPBLACKLIST = { - crushedCentrifuged,crushed,crushedPurified,dustPure,dustImpure,dustRefined,dust,dustTiny,dustSmall + crushedCentrifuged, crushed, crushedPurified, dustPure, dustImpure, dustRefined, dust, dustTiny, dustSmall }; - private PlatinumSludgeOverHaul() { - } + private PlatinumSludgeOverHaul() {} private static void runHelperrecipes() { - //DilutedSulfuricAcid + // DilutedSulfuricAcid // 2H2SO4 + H2O = 3H2SO4(d) - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(2), Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, Materials.DilutedSulfuricAcid.getCells(3), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.Water.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, Materials.SulfuricAcid.getFluid(2000), Materials.DilutedSulfuricAcid.getFluid(3000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.SulfuricAcid.getCells(2), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Water.getFluid(1000), Materials.DilutedSulfuricAcid.getFluid(3000), Materials.Empty.getCells(2), 30, 30); - //FormicAcid - //CO + NaOH = CHO2Na - GT_Values.RA.addChemicalRecipe(Materials.CarbonMonoxide.getCells(1), Materials.SodiumHydroxide.getDust(3), null, null, Sodiumformate.get(cell), null, 15); - //H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 - GT_Values.RA.addChemicalRecipe(Sodiumformate.get(cell, 2), GT_Utility.getIntegratedCircuit(1), Materials.SulfuricAcid.getFluid(1000), null, FormicAcid.get(cell, 2), Sodiumsulfate.get(dust, 7), 15); - GT_Values.RA.addChemicalRecipe(Materials.SulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Sodiumformate.getFluidOrGas(2000), FormicAcid.getFluidOrGas(2000), Materials.Empty.getCells(1), Sodiumsulfate.get(dust, 7), 15); - //AquaRegia - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), null, null, null, AquaRegia.get(cell, 2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(2), null, null, AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(2), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.NitricAcid.getCells(1), GT_Utility.getIntegratedCircuit(3), null, null, Materials.DilutedSulfuricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - GT_Values.RA.addMixerRecipe(Materials.DilutedSulfuricAcid.getCells(1), GT_Utility.getIntegratedCircuit(4), null, null, Materials.NitricAcid.getFluid(1000), AquaRegia.getFluidOrGas(2000), Materials.Empty.getCells(1), 30, 30); - - //AmmoniumCloride - //NH3 + HCl = NH4Cl - GT_Values.RA.addChemicalRecipe(Materials.Ammonia.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.HydrochloricAcid.getFluid(1000), null, AmmoniumChloride.get(cell, 1), null, 15); - GT_Values.RA.addChemicalRecipe(Materials.HydrochloricAcid.getCells(1), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), AmmoniumChloride.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 15); - - //base sollution + GT_Values.RA.addMixerRecipe( + Materials.SulfuricAcid.getCells(2), + Materials.Water.getCells(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + Materials.DilutedSulfuricAcid.getCells(3), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.Water.getCells(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + Materials.SulfuricAcid.getFluid(2000), + Materials.DilutedSulfuricAcid.getFluid(3000), + Materials.Empty.getCells(1), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.SulfuricAcid.getCells(2), + GT_Utility.getIntegratedCircuit(1), + null, + null, + Materials.Water.getFluid(1000), + Materials.DilutedSulfuricAcid.getFluid(3000), + Materials.Empty.getCells(2), + 30, + 30); + // FormicAcid + // CO + NaOH = CHO2Na + GT_Values.RA.addChemicalRecipe( + Materials.CarbonMonoxide.getCells(1), + Materials.SodiumHydroxide.getDust(3), + null, + null, + Sodiumformate.get(cell), + null, + 15); + // H2SO4 + 2CHO2Na = 2CH2O2 + Na2SO4 + GT_Values.RA.addChemicalRecipe( + Sodiumformate.get(cell, 2), + GT_Utility.getIntegratedCircuit(1), + Materials.SulfuricAcid.getFluid(1000), + null, + FormicAcid.get(cell, 2), + Sodiumsulfate.get(dust, 7), + 15); + GT_Values.RA.addChemicalRecipe( + Materials.SulfuricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1), + Sodiumformate.getFluidOrGas(2000), + FormicAcid.getFluidOrGas(2000), + Materials.Empty.getCells(1), + Sodiumsulfate.get(dust, 7), + 15); + // AquaRegia + GT_Values.RA.addMixerRecipe( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + AquaRegia.get(cell, 2), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.DilutedSulfuricAcid.getCells(1), + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(2), + null, + null, + AquaRegia.getFluidOrGas(2000), + Materials.Empty.getCells(2), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.NitricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(3), + null, + null, + Materials.DilutedSulfuricAcid.getFluid(1000), + AquaRegia.getFluidOrGas(2000), + Materials.Empty.getCells(1), + 30, + 30); + GT_Values.RA.addMixerRecipe( + Materials.DilutedSulfuricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(4), + null, + null, + Materials.NitricAcid.getFluid(1000), + AquaRegia.getFluidOrGas(2000), + Materials.Empty.getCells(1), + 30, + 30); + + // AmmoniumCloride + // NH3 + HCl = NH4Cl + GT_Values.RA.addChemicalRecipe( + Materials.Ammonia.getCells(1), + GT_Utility.getIntegratedCircuit(1), + Materials.HydrochloricAcid.getFluid(1000), + null, + AmmoniumChloride.get(cell, 1), + null, + 15); + GT_Values.RA.addChemicalRecipe( + Materials.HydrochloricAcid.getCells(1), + GT_Utility.getIntegratedCircuit(1), + Materials.Ammonia.getGas(1000), + AmmoniumChloride.getFluidOrGas(1000), + Materials.Empty.getCells(1), + null, + 15); + + // base sollution for (Werkstoff w : Werkstoff.werkstoffHashSet) - if (w.containsStuff(Materials.Sulfur) && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(1350), PTConcentrate.getFluidOrGas(1350), null, 2250); - GT_Values.RA.addChemicalRecipe(w.get(crushedPurified, 9), PTMetallicPowder.get(dust, 9), AquaRegia.getFluidOrGas(10350), PTConcentrate.getFluidOrGas(10350), PTResidue.get(dust), 2250); + if (w.containsStuff(Materials.Sulfur) + && (w.containsStuff(Materials.Copper) || w.containsStuff(Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(150), + PTConcentrate.getFluidOrGas(150), + null, + 250); + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(1350), + PTConcentrate.getFluidOrGas(1350), + null, + 2250); + GT_Values.RA.addChemicalRecipe( + w.get(crushedPurified, 9), + PTMetallicPowder.get(dust, 9), + AquaRegia.getFluidOrGas(10350), + PTConcentrate.getFluidOrGas(10350), + PTResidue.get(dust), + 2250); } for (Materials m : Materials.values()) - if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 1), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(150), PTConcentrate.getFluidOrGas(150), null, 250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(1350), PTConcentrate.getFluidOrGas(1350), null, 2250); - GT_Values.RA.addChemicalRecipe(GT_OreDictUnificator.get(crushedPurified, m, 9), PTMetallicPowder.get(dust, 9), AquaRegia.getFluidOrGas(10350), PTConcentrate.getFluidOrGas(10350), PTResidue.get(dust), 2250); + if (PlatinumSludgeOverHaul.materialsContains(m, Materials.Sulfur) + && (PlatinumSludgeOverHaul.materialsContains(m, Materials.Copper) + || PlatinumSludgeOverHaul.materialsContains(m, Materials.Nickel))) { + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 1), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(150), + PTConcentrate.getFluidOrGas(150), + null, + 250); + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(1350), + PTConcentrate.getFluidOrGas(1350), + null, + 2250); + GT_Values.RA.addChemicalRecipe( + GT_OreDictUnificator.get(crushedPurified, m, 9), + PTMetallicPowder.get(dust, 9), + AquaRegia.getFluidOrGas(10350), + PTConcentrate.getFluidOrGas(10350), + PTResidue.get(dust), + 2250); } - //Pt - GT_Values.RA.addBlastRecipe(PTMetallicPowder.get(dust, 3), GT_Utility.getIntegratedCircuit(1), null, null, Materials.Platinum.getNuggets(2), null, 600, 120, Materials.Platinum.mMeltingPoint); - - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), AquaRegia.getFluidOrGas(1000), PTConcentrate.getFluidOrGas(1000), PTResidue.get(dustTiny), 250); - GT_Values.RA.addChemicalRecipe(PTMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), AquaRegia.getFluidOrGas(9000), PTConcentrate.getFluidOrGas(9000), PTResidue.get(dust), 2250); - GT_Values.RA.addCentrifugeRecipe(PTConcentrate.get(cell,2), null, AmmoniumChloride.getFluidOrGas(400), PDAmmonia.getFluidOrGas(400), PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4), Materials.NitrogenDioxide.getCells(1), Materials.DilutedSulfuricAcid.getCells(1), null, null, null, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400)}, new FluidStack[]{PDAmmonia.getFluidOrGas(400), Materials.NitrogenDioxide.getGas(1000),Materials.DilutedSulfuricAcid.getFluid(1000)}, new ItemStack[]{PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny,4)}, 1200, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(2)}, new FluidStack[]{PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)}, new FluidStack[]{PDAmmonia.getFluidOrGas(3600), Materials.NitrogenDioxide.getGas(9000),Materials.DilutedSulfuricAcid.getFluid(9000)}, new ItemStack[]{PTSaltCrude.get(dust, 16), PTRawPowder.get(dust,4)}, 1400, 240); - GT_Values.RA.addSifterRecipe(PTSaltCrude.get(dust), new ItemStack[]{ - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), - PTSaltRefined.get(dust), + // Pt + GT_Values.RA.addBlastRecipe( + PTMetallicPowder.get(dust, 3), + GT_Utility.getIntegratedCircuit(1), + null, + null, + Materials.Platinum.getNuggets(2), + null, + 600, + 120, + Materials.Platinum.mMeltingPoint); + + GT_Values.RA.addChemicalRecipe( + PTMetallicPowder.get(dust), + GT_Utility.getIntegratedCircuit(1), + AquaRegia.getFluidOrGas(1000), + PTConcentrate.getFluidOrGas(1000), + PTResidue.get(dustTiny), + 250); + GT_Values.RA.addChemicalRecipe( + PTMetallicPowder.get(dust, 9), + GT_Utility.getIntegratedCircuit(9), + AquaRegia.getFluidOrGas(9000), + PTConcentrate.getFluidOrGas(9000), + PTResidue.get(dust), + 2250); + GT_Values.RA.addCentrifugeRecipe( + PTConcentrate.get(cell, 2), + null, + AmmoniumChloride.getFluidOrGas(400), + PDAmmonia.getFluidOrGas(400), + PTSaltCrude.get(dustTiny, 16), + PTRawPowder.get(dustTiny, 4), + Materials.NitrogenDioxide.getCells(1), + Materials.DilutedSulfuricAcid.getCells(1), + null, + null, + null, + 1200, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(1)}, + new FluidStack[] {PTConcentrate.getFluidOrGas(2000), AmmoniumChloride.getFluidOrGas(400)}, + new FluidStack[] { + PDAmmonia.getFluidOrGas(400), + Materials.NitrogenDioxide.getGas(1000), + Materials.DilutedSulfuricAcid.getFluid(1000) + }, + new ItemStack[] {PTSaltCrude.get(dustTiny, 16), PTRawPowder.get(dustTiny, 4)}, + 1200, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(2)}, + new FluidStack[] {PTConcentrate.getFluidOrGas(18000), AmmoniumChloride.getFluidOrGas(3600)}, + new FluidStack[] { + PDAmmonia.getFluidOrGas(3600), + Materials.NitrogenDioxide.getGas(9000), + Materials.DilutedSulfuricAcid.getFluid(9000) + }, + new ItemStack[] {PTSaltCrude.get(dust, 16), PTRawPowder.get(dust, 4)}, + 1400, + 240); + GT_Values.RA.addSifterRecipe( + PTSaltCrude.get(dust), + new ItemStack[] { + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + PTSaltRefined.get(dust), + }, + new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, + 600, + 30); + GT_Values.RA.addBlastRecipe( PTSaltRefined.get(dust), - }, new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addBlastRecipe(PTSaltRefined.get(dust), GT_Utility.getIntegratedCircuit(1), null, Materials.Chlorine.getGas(87), PTMetallicPowder.get(dust), null, 200, 120, 900); - //2PtCl + Ca = 2Pt + CaCl2 - GT_Values.RA.addChemicalRecipe(PTRawPowder.get(dust, 4), Materials.Calcium.getDust(1), null, null, Materials.Platinum.getDust(2), CalciumChloride.get(dust, 3), 30); - //Pd - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), Materials.Ammonia.getGas(1000), PDAmmonia.getFluidOrGas(1000), null, 250); - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust), GT_Utility.getIntegratedCircuit(1), PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dustTiny, 16), PDRawPowder.get(dustTiny, 2), 250); - GT_Values.RA.addChemicalRecipe(PDMetallicPowder.get(dust, 9), GT_Utility.getIntegratedCircuit(9), PDAmmonia.getFluidOrGas(9000), null, PDSalt.get(dust, 16), PDRawPowder.get(dust, 2), 2250); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); - GT_Values.RA.addSifterRecipe(PDSalt.get(dust), new ItemStack[]{ - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + Materials.Chlorine.getGas(87), + PTMetallicPowder.get(dust), + null, + 200, + 120, + 900); + // 2PtCl + Ca = 2Pt + CaCl2 + GT_Values.RA.addChemicalRecipe( + PTRawPowder.get(dust, 4), + Materials.Calcium.getDust(1), + null, + null, + Materials.Platinum.getDust(2), + CalciumChloride.get(dust, 3), + 30); + // Pd + GT_Values.RA.addChemicalRecipe( PDMetallicPowder.get(dust), + GT_Utility.getIntegratedCircuit(1), + Materials.Ammonia.getGas(1000), + PDAmmonia.getFluidOrGas(1000), + null, + 250); + GT_Values.RA.addChemicalRecipe( PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - PDMetallicPowder.get(dust), - }, new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(PDRawPowder.get(dust, 4), Materials.Empty.getCells(1), FormicAcid.getFluidOrGas(4000), Materials.Ammonia.getGas(4000), Materials.Palladium.getDust(2), Materials.Ethylene.getCells(1), 250, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{PDRawPowder.get(dust, 4)}, new FluidStack[]{FormicAcid.getFluidOrGas(4000)}, new FluidStack[]{Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000)}, new ItemStack[]{Materials.Palladium.getDust(2)}, 250, 30); - //Na2SO4 + 2H = 2Na + H2SO4 - GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust, 7), Materials.Hydrogen.getCells(2), null, Materials.SulfuricAcid.getFluid(1000), Materials.Sodium.getDust(2), Materials.Empty.getCells(2), 30); - //K2S2O7 - // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); - //Rh/Os/Ir/Ru - GT_Values.RA.addBlastRecipe(PTResidue.get(dust), GT_Utility.getIntegratedCircuit(11), PotassiumDisulfate.getMolten(360), RHSulfate.getFluidOrGas(360), LeachResidue.get(dust), null, 200, 120, 775); - - //Ru - GT_Values.RA.addBlastRecipe(LeachResidue.get(dust, 10), Materials.Saltpeter.getDust(10), Materials.SaltWater.getFluid(1000), GT_ModHandler.getSteam(1000), SodiumRuthenate.get(dust, 3), IrOsLeachResidue.get(dust, 6), 200, 120, 775); - GT_Values.RA.addChemicalRecipe(SodiumRuthenate.get(dust, 6), Materials.Chlorine.getCells(3), null, RutheniumTetroxideSollution.getFluidOrGas(9000), Materials.Empty.getCells(3), 300); - GT_Values.RA.addFluidHeaterRecipe(GT_Utility.getIntegratedCircuit(1), RutheniumTetroxideSollution.getFluidOrGas(800), HotRutheniumTetroxideSollution.getFluidOrGas(800), 300, 480); - GT_Values.RA.addCrackingRecipe(17, RutheniumTetroxideSollution.getFluidOrGas(1000), GT_ModHandler.getSteam(1000), HotRutheniumTetroxideSollution.getFluidOrGas(2000), 150, 480); - GT_Values.RA.addDistillationTowerRecipe(HotRutheniumTetroxideSollution.getFluidOrGas(9000), new FluidStack[]{ - Materials.Water.getFluid(1800), - RutheniumTetroxide.getFluidOrGas(7200) - }, Materials.Salt.getDust(6), 1500, 480); - GT_Values.RA.addChemicalRecipe(RutheniumTetroxide.get(dust, 1), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Ruthenium.get(dust), Materials.Chlorine.getCells(6), 300); - - //Os - GT_Values.RA.addBlastRecipe(IrOsLeachResidue.get(dust, 4), GT_Utility.getIntegratedCircuit(11), Materials.HydrochloricAcid.getFluid(1000), AcidicOsmiumSolution.getFluidOrGas(2000), IrLeachResidue.get(dust, 2), null, 200, 120, 775); - GT_Values.RA.addDistillationTowerRecipe(AcidicOsmiumSolution.getFluidOrGas(1000), new FluidStack[]{OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, null, 150, BW_Util.getMachineVoltageFromTier(5)); - GT_Values.RA.addChemicalRecipe(OsmiumSolution.get(cell), Materials.HydrochloricAcid.getCells(6), null, Materials.Water.getFluid(2000), Materials.Osmium.getDust(1), Materials.Chlorine.getCells(7), 300); - - //Ir - GT_Values.RA.addBlastRecipe(IrLeachResidue.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, PGSDResidue.get(dust), IridiumDioxide.get(dust), 200, 120, 775); - GT_Values.RA.addChemicalRecipe(IridiumDioxide.get(dust), Materials.HydrochloricAcid.getCells(1), null, AcidicIridiumSolution.getFluidOrGas(1000), Materials.Empty.getCells(1), null, 300); - GT_Values.RA.addChemicalRecipe(AcidicIridiumSolution.get(cell), AmmoniumChloride.get(cell, 3), null, Materials.Ammonia.getGas(3000), Materials.Empty.getCells(4), IridiumChloride.get(dust), 300); - GT_Values.RA.addChemicalRecipe(IridiumChloride.get(dust), Materials.Calcium.getDust(3), null, CalciumChloride.getFluidOrGas(3000), PGSDResidue2.get(dust), Materials.Iridium.getDust(1), 300, 1920); - - //Rh - GT_Values.RA.addChemicalRecipe(RHSulfate.get(cell, 11), GT_Utility.getIntegratedCircuit(1), Materials.Water.getFluid(10000), Materials.Potassium.getMolten(2000), RHSulfateSolution.get(cell, 11), LeachResidue.get(dustTiny, 10), 300, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(3)}, new FluidStack[]{Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600)}, new FluidStack[]{Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600)}, new ItemStack[]{LeachResidue.get(dust, 4)}, 1200, 30); - - GT_Values.RA.addChemicalRecipe(Materials.Zinc.getDust(1), null, RHSulfateSolution.getFluidOrGas(1000), null, ZincSulfate.get(dust,6), CrudeRhMetall.get(dust), 300); - GT_Values.RA.addBlastRecipe(CrudeRhMetall.get(dust), Materials.Salt.getDust(1), Materials.Chlorine.getGas(1000), null, RHSalt.get(dust, 3), null, 300, 120, 600); - GT_Values.RA.addMixerRecipe(RHSalt.get(dust, 10), null, null, null, Materials.Water.getFluid(2000), RHSaltSolution.getFluidOrGas(2000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(SodiumNitrate.get(dust, 5), GT_Utility.getIntegratedCircuit(1), RHSaltSolution.getFluidOrGas(1000), null, RHNitrate.get(dust), Materials.Salt.getDust(2), 300); - //Na + HNO3 = NaNO3 + H - GT_Values.RA.addChemicalRecipe(Materials.Sodium.getDust(1), GT_Values.NI, Materials.NitricAcid.getFluid(1000), Materials.Hydrogen.getGas(1000), SodiumNitrate.get(dust, 5), 8, 60); - GT_Values.RA.addSifterRecipe(RHNitrate.get(dust), new ItemStack[]{ - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), - RhFilterCake.get(dust), + GT_Utility.getIntegratedCircuit(1), + PDAmmonia.getFluidOrGas(1000), + null, + PDSalt.get(dustTiny, 16), + PDRawPowder.get(dustTiny, 2), + 250); + GT_Values.RA.addChemicalRecipe( + PDMetallicPowder.get(dust, 9), + GT_Utility.getIntegratedCircuit(9), + PDAmmonia.getFluidOrGas(9000), + null, + PDSalt.get(dust, 16), + PDRawPowder.get(dust, 2), + 2250); + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(2), null, PDAmmonia.getFluidOrGas(1000), null, PDSalt.get(dust), 250); + GT_Values.RA.addSifterRecipe( + PDSalt.get(dust), + new ItemStack[] { + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + PDMetallicPowder.get(dust), + }, + new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, + 600, + 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly( + PDRawPowder.get(dust, 4), + Materials.Empty.getCells(1), + FormicAcid.getFluidOrGas(4000), + Materials.Ammonia.getGas(4000), + Materials.Palladium.getDust(2), + Materials.Ethylene.getCells(1), + 250, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {PDRawPowder.get(dust, 4)}, + new FluidStack[] {FormicAcid.getFluidOrGas(4000)}, + new FluidStack[] { + Materials.Ammonia.getGas(4000), Materials.Ethylene.getGas(1000), Materials.Water.getFluid(1000) + }, + new ItemStack[] {Materials.Palladium.getDust(2)}, + 250, + 30); + // Na2SO4 + 2H = 2Na + H2SO4 + GT_Values.RA.addChemicalRecipe( + Sodiumsulfate.get(dust, 7), + Materials.Hydrogen.getCells(2), + null, + Materials.SulfuricAcid.getFluid(1000), + Materials.Sodium.getDust(2), + Materials.Empty.getCells(2), + 30); + // K2S2O7 + // GT_Values.RA.addChemicalRecipe(Sodiumsulfate.get(dust), Materials.Potassium.getDust(2), + // Materials.Oxygen.getGas(3000), null, PotassiumDisulfate.get(dust,6), null, 30); + // Rh/Os/Ir/Ru + GT_Values.RA.addBlastRecipe( + PTResidue.get(dust), + GT_Utility.getIntegratedCircuit(11), + PotassiumDisulfate.getMolten(360), + RHSulfate.getFluidOrGas(360), + LeachResidue.get(dust), + null, + 200, + 120, + 775); + + // Ru + GT_Values.RA.addBlastRecipe( + LeachResidue.get(dust, 10), + Materials.Saltpeter.getDust(10), + Materials.SaltWater.getFluid(1000), + GT_ModHandler.getSteam(1000), + SodiumRuthenate.get(dust, 3), + IrOsLeachResidue.get(dust, 6), + 200, + 120, + 775); + GT_Values.RA.addChemicalRecipe( + SodiumRuthenate.get(dust, 6), + Materials.Chlorine.getCells(3), + null, + RutheniumTetroxideSollution.getFluidOrGas(9000), + Materials.Empty.getCells(3), + 300); + GT_Values.RA.addFluidHeaterRecipe( + GT_Utility.getIntegratedCircuit(1), + RutheniumTetroxideSollution.getFluidOrGas(800), + HotRutheniumTetroxideSollution.getFluidOrGas(800), + 300, + 480); + GT_Values.RA.addCrackingRecipe( + 17, + RutheniumTetroxideSollution.getFluidOrGas(1000), + GT_ModHandler.getSteam(1000), + HotRutheniumTetroxideSollution.getFluidOrGas(2000), + 150, + 480); + GT_Values.RA.addDistillationTowerRecipe( + HotRutheniumTetroxideSollution.getFluidOrGas(9000), + new FluidStack[] {Materials.Water.getFluid(1800), RutheniumTetroxide.getFluidOrGas(7200)}, + Materials.Salt.getDust(6), + 1500, + 480); + GT_Values.RA.addChemicalRecipe( + RutheniumTetroxide.get(dust, 1), + Materials.HydrochloricAcid.getCells(6), + null, + Materials.Water.getFluid(2000), + Ruthenium.get(dust), + Materials.Chlorine.getCells(6), + 300); + + // Os + GT_Values.RA.addBlastRecipe( + IrOsLeachResidue.get(dust, 4), + GT_Utility.getIntegratedCircuit(11), + Materials.HydrochloricAcid.getFluid(1000), + AcidicOsmiumSolution.getFluidOrGas(2000), + IrLeachResidue.get(dust, 2), + null, + 200, + 120, + 775); + GT_Values.RA.addDistillationTowerRecipe( + AcidicOsmiumSolution.getFluidOrGas(1000), + new FluidStack[] {OsmiumSolution.getFluidOrGas(100), Materials.Water.getFluid(900)}, + null, + 150, + BW_Util.getMachineVoltageFromTier(5)); + GT_Values.RA.addChemicalRecipe( + OsmiumSolution.get(cell), + Materials.HydrochloricAcid.getCells(6), + null, + Materials.Water.getFluid(2000), + Materials.Osmium.getDust(1), + Materials.Chlorine.getCells(7), + 300); + + // Ir + GT_Values.RA.addBlastRecipe( + IrLeachResidue.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + null, + PGSDResidue.get(dust), + IridiumDioxide.get(dust), + 200, + 120, + 775); + GT_Values.RA.addChemicalRecipe( + IridiumDioxide.get(dust), + Materials.HydrochloricAcid.getCells(1), + null, + AcidicIridiumSolution.getFluidOrGas(1000), + Materials.Empty.getCells(1), + null, + 300); + GT_Values.RA.addChemicalRecipe( + AcidicIridiumSolution.get(cell), + AmmoniumChloride.get(cell, 3), + null, + Materials.Ammonia.getGas(3000), + Materials.Empty.getCells(4), + IridiumChloride.get(dust), + 300); + GT_Values.RA.addChemicalRecipe( + IridiumChloride.get(dust), + Materials.Calcium.getDust(3), + null, + CalciumChloride.getFluidOrGas(3000), + PGSDResidue2.get(dust), + Materials.Iridium.getDust(1), + 300, + 1920); + + // Rh + GT_Values.RA.addChemicalRecipe( + RHSulfate.get(cell, 11), + GT_Utility.getIntegratedCircuit(1), + Materials.Water.getFluid(10000), + Materials.Potassium.getMolten(2000), + RHSulfateSolution.get(cell, 11), + LeachResidue.get(dustTiny, 10), + 300, + 30); + GT_Values.RA.addMultiblockChemicalRecipe( + new ItemStack[] {GT_Utility.getIntegratedCircuit(3)}, + new FluidStack[] {Materials.Water.getFluid(36000), RHSulfate.getFluidOrGas(39600)}, + new FluidStack[] {Materials.Potassium.getMolten(7200), RHSulfateSolution.getFluidOrGas(39600)}, + new ItemStack[] {LeachResidue.get(dust, 4)}, + 1200, + 30); + + GT_Values.RA.addChemicalRecipe( + Materials.Zinc.getDust(1), + null, + RHSulfateSolution.getFluidOrGas(1000), + null, + ZincSulfate.get(dust, 6), + CrudeRhMetall.get(dust), + 300); + GT_Values.RA.addBlastRecipe( + CrudeRhMetall.get(dust), + Materials.Salt.getDust(1), + Materials.Chlorine.getGas(1000), + null, + RHSalt.get(dust, 3), + null, + 300, + 120, + 600); + GT_Values.RA.addMixerRecipe( + RHSalt.get(dust, 10), + null, + null, + null, + Materials.Water.getFluid(2000), + RHSaltSolution.getFluidOrGas(2000), + null, + 300, + 30); + GT_Values.RA.addChemicalRecipe( + SodiumNitrate.get(dust, 5), + GT_Utility.getIntegratedCircuit(1), + RHSaltSolution.getFluidOrGas(1000), + null, + RHNitrate.get(dust), + Materials.Salt.getDust(2), + 300); + // Na + HNO3 = NaNO3 + H + GT_Values.RA.addChemicalRecipe( + Materials.Sodium.getDust(1), + GT_Values.NI, + Materials.NitricAcid.getFluid(1000), + Materials.Hydrogen.getGas(1000), + SodiumNitrate.get(dust, 5), + 8, + 60); + GT_Values.RA.addSifterRecipe( + RHNitrate.get(dust), + new ItemStack[] { + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + RhFilterCake.get(dust), + }, + new int[] { + 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, + }, + 600, + 30); + GT_Values.RA.addMixerRecipe( RhFilterCake.get(dust), - }, new int[] { - 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1500, - }, 600, 30); - GT_Values.RA.addMixerRecipe(RhFilterCake.get(dust), null, null, null, Materials.Water.getFluid(1000), RHFilterCakeSolution.getFluidOrGas(1000), null, 300, 30); - GT_Values.RA.addChemicalRecipe(GT_Utility.getIntegratedCircuit(2), null, RHFilterCakeSolution.getFluidOrGas(1000), null, ReRh.get(dust), null, 300); - GT_Values.RA.addChemicalRecipe(ReRh.get(dust), Materials.Empty.getCells(1), Materials.HydrochloricAcid.getFluid(1000), Materials.Chlorine.getGas(1000), Rhodium.get(dust), Materials.Ammonia.getCells(1), 300); + null, + null, + null, + Materials.Water.getFluid(1000), + RHFilterCakeSolution.getFluidOrGas(1000), + null, + 300, + 30); + GT_Values.RA.addChemicalRecipe( + GT_Utility.getIntegratedCircuit(2), + null, + RHFilterCakeSolution.getFluidOrGas(1000), + null, + ReRh.get(dust), + null, + 300); + GT_Values.RA.addChemicalRecipe( + ReRh.get(dust), + Materials.Empty.getCells(1), + Materials.HydrochloricAcid.getFluid(1000), + Materials.Chlorine.getGas(1000), + Rhodium.get(dust), + Materials.Ammonia.getCells(1), + 300); } private static boolean materialsContains(Materials one, ISubTagContainer other) { - if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) - return false; - for (MaterialStack stack : one.mMaterialList) - if (stack.mMaterial.equals(other)) - return true; + if (one == null || one.mMaterialList == null || one.mMaterialList.isEmpty()) return false; + for (MaterialStack stack : one.mMaterialList) if (stack.mMaterial.equals(other)) return true; return false; } - @SuppressWarnings({"unchecked","rawtypes"}) + @SuppressWarnings({"unchecked", "rawtypes"}) public static void replacePureElements() { - //furnace + // furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { Map.Entry realEntry = (Map.Entry) entry; - if (GT_Utility.isStackValid(realEntry.getKey()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { + if (GT_Utility.isStackValid(realEntry.getKey()) + && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getKey())) { ItemData association = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getKey()); - if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny)) || !association.mMaterial.mMaterial.equals(Materials.Platinum)) - if (GT_Utility.isStackValid(realEntry.getValue()) && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())){ + if ((!association.mPrefix.equals(dust) && !association.mPrefix.equals(dustTiny)) + || !association.mMaterial.mMaterial.equals(Materials.Platinum)) + if (GT_Utility.isStackValid(realEntry.getValue()) + && BW_Util.checkStackAndPrefix((ItemStack) realEntry.getValue())) { ItemData ass = GT_OreDictUnificator.getAssociation((ItemStack) realEntry.getValue()); if (ass.mMaterial.mMaterial.equals(Materials.Platinum)) if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PTMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); - else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) - if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) - realEntry.setValue(PDMetallicPowder.get(ass.mPrefix == nugget ? dustTiny : dust, ((ItemStack) realEntry.getValue()).stackSize * 2)); + realEntry.setValue(PTMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); + else if (ass.mMaterial.mMaterial.equals(Materials.Palladium)) + if (!PlatinumSludgeOverHaul.isInBlackList((ItemStack) realEntry.getKey())) + realEntry.setValue(PDMetallicPowder.get( + ass.mPrefix == nugget ? dustTiny : dust, + ((ItemStack) realEntry.getValue()).stackSize * 2)); } } } - //vanilla crafting + // vanilla crafting CraftingManager.getInstance().getRecipeList().forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); - //gt crafting + // gt crafting try { - ((List<IRecipe>) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true).get(null)).forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); + ((List<IRecipe>) FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true) + .get(null)) + .forEach(PlatinumSludgeOverHaul::setnewMaterialInRecipe); } catch (IllegalAccessException e) { e.printStackTrace(); } - //gt machines + // gt machines maploop: for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { - if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) - continue; + if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes + || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes + || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; HashSet<GT_Recipe> toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { - if (recipe.mFakeRecipe) - continue maploop; + if (recipe.mFakeRecipe) continue maploop; for (int i = 0; i < recipe.mFluidOutputs.length; i++) { - if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) - continue maploop; - else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { + if (map.equals(GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes)) continue maploop; + else if (map.equals(GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes) + || map.equals(GT_Recipe.GT_Recipe_Map.sChemicalRecipes)) { if (GT_Utility.areFluidsEqual(Ruthenium.getMolten(1), recipe.mFluidOutputs[i])) toDel.add(recipe); else if (GT_Utility.areFluidsEqual(Rhodium.getMolten(1), recipe.mFluidOutputs[i])) @@ -270,12 +713,11 @@ public class PlatinumSludgeOverHaul { else if (GT_Utility.areFluidsEqual(Materials.Iridium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicIridiumSolution.getFluidOrGas(1000); recipe.reloadOwner(); - } - else if (GT_Utility.areFluidsEqual(Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { + } else if (GT_Utility.areFluidsEqual( + Materials.Platinum.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = PTConcentrate.getFluidOrGas(1000); recipe.reloadOwner(); - } - else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { + } else if (GT_Utility.areFluidsEqual(Materials.Osmium.getMolten(1), recipe.mFluidOutputs[i])) { recipe.mFluidOutputs[i] = AcidicOsmiumSolution.getFluidOrGas(1000); recipe.reloadOwner(); } @@ -293,99 +735,155 @@ public class PlatinumSludgeOverHaul { } } for (int i = 0; i < recipe.mOutputs.length; i++) { - if (!GT_Utility.isStackValid(recipe.mOutputs[i])) - continue; - if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { + if (!GT_Utility.isStackValid(recipe.mOutputs[i])) continue; + if (BW_Util.areStacksEqualOrNull(Ruthenium.get(dust), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustImpure), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Ruthenium.get(dustPure), recipe.mOutputs[i])) { if (!BW_Util.areStacksEqualOrNull(Ruthenium.get(ingot), recipe.mInputs[0])) { for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = LeachResidue.get(dust, amount); recipe.reloadOwner(); } } - if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { + if (BW_Util.areStacksEqualOrNull(Rhodium.get(dust), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustImpure), recipe.mOutputs[i]) + || BW_Util.areStacksEqualOrNull(Rhodium.get(dustPure), recipe.mOutputs[i])) { if (!BW_Util.areStacksEqualOrNull(Rhodium.get(ingot), recipe.mInputs[0])) { for (int j = 0; j < recipe.mInputs.length; j++) - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; int amount = recipe.mOutputs[i].stackSize * 2; recipe.mOutputs[i] = CrudeRhMetall.get(dust, amount); recipe.reloadOwner(); } } - if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) - continue; - //Pt - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Platinum)) { + if (!BW_Util.checkStackAndPrefix(recipe.mOutputs[i])) continue; + // Pt + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Platinum)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dust), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustSmall), amount * 2); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PTMetallicPowder.get(dustTiny), amount * 2); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Palladium)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Palladium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dust), amount * 4); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustSmall), amount * 4); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(PDMetallicPowder.get(dustTiny), amount * 4); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Osmium)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Osmium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dust), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustSmall), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrOsLeachResidue.get(dustTiny), amount); recipe.reloadOwner(); } - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mMaterial.mMaterial.equals(Materials.Iridium)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mMaterial + .mMaterial + .equals(Materials.Iridium)) { for (int j = 0; j < recipe.mInputs.length; j++) { - if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) - continue recipeloop; + if (PlatinumSludgeOverHaul.isInBlackList(recipe.mInputs[j])) continue recipeloop; } - if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dust) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustImpure) || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustPure)) { + if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dust) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustImpure) + || GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustPure)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dust), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustSmall)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustSmall)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustSmall), amount); recipe.reloadOwner(); - } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]).mPrefix.equals(dustTiny)) { + } else if (GT_OreDictUnificator.getAssociation(recipe.mOutputs[i]) + .mPrefix + .equals(dustTiny)) { int amount = recipe.mOutputs[i].stackSize; recipe.mOutputs[i] = BW_Util.setStackSize(IrLeachResidue.get(dustTiny), amount); recipe.reloadOwner(); @@ -395,26 +893,34 @@ public class PlatinumSludgeOverHaul { } map.mRecipeList.removeAll(toDel); } - //TODO: remove EnderIO recipes + // TODO: remove EnderIO recipes - //fix HV tier + // fix HV tier PlatinumSludgeOverHaul.replaceHVCircuitMaterials(); - //add new recipes + // add new recipes PlatinumSludgeOverHaul.runHelperrecipes(); } @SuppressWarnings("deprecation") - private static void replaceHVCircuitMaterials(){ - GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); - for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ - if (recipe.mEUt > 512) - continue; + private static void replaceHVCircuitMaterials() { + GT_Values.RA.addMixerRecipe( + Materials.Redstone.getDust(1), + Materials.Electrum.getDust(1), + GT_Utility.getIntegratedCircuit(1), + null, + null, + null, + Materials.Nikolite.getDust(8), + 1800, + 120); + for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList) { + if (recipe.mEUt > 512) continue; if (BW_Util.checkStackAndPrefix(recipe.mOutputs[0])) { for (int i = 0; i < recipe.mInputs.length; i++) { ItemStack stack = recipe.mInputs[i]; ItemData ass = GT_OreDictUnificator.getAssociation(stack); if (BW_Util.checkStackAndPrefix(stack) && ass.mMaterial.mMaterial.equals(Materials.Platinum)) { - recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix,Materials.BlueAlloy,stack.stackSize); + recipe.mInputs[i] = GT_OreDictUnificator.get(ass.mPrefix, Materials.BlueAlloy, stack.stackSize); recipe.reloadOwner(); } } @@ -425,18 +931,19 @@ public class PlatinumSludgeOverHaul { private static void setnewMaterialInRecipe(Object obj) { String inputName = "output"; String inputItemName = "input"; - if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)){ - if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { - inputName = "recipeOutput"; - inputItemName = "recipeItems"; + if (!(obj instanceof ShapedOreRecipe || obj instanceof ShapelessOreRecipe)) { + if (obj instanceof ShapedRecipes || (obj instanceof ShapelessRecipes)) { + inputName = "recipeOutput"; + inputItemName = "recipeItems"; + } else if (LoaderReference.miscutils) { + try { + if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe") + .isAssignableFrom(obj.getClass())) + obj = CachedReflectionUtils.getField(obj.getClass(), "mRecipe") + .get(obj); + } catch (ClassNotFoundException | IllegalAccessException e) { + e.printStackTrace(); } - else if (LoaderReference.miscutils) { - try { - if (Class.forName("gtPlusPlus.api.objects.minecraft.ShapedRecipe").isAssignableFrom(obj.getClass())) - obj = CachedReflectionUtils.getField(obj.getClass(),"mRecipe").get(obj); - } catch (ClassNotFoundException | IllegalAccessException e) { - e.printStackTrace(); - } } } @@ -444,18 +951,15 @@ public class PlatinumSludgeOverHaul { ItemStack otpt = recipe.getRecipeOutput(); Field out = CachedReflectionUtils.getDeclaredField(recipe.getClass(), inputName); - if (out == null) - out = CachedReflectionUtils.getField(recipe.getClass(), inputName); - + if (out == null) out = CachedReflectionUtils.getField(recipe.getClass(), inputName); Field in = CachedReflectionUtils.getDeclaredField(recipe.getClass(), inputItemName); - if (in == null) - in = CachedReflectionUtils.getField(recipe.getClass(), inputItemName); - if (in == null) - return; + if (in == null) in = CachedReflectionUtils.getField(recipe.getClass(), inputItemName); + if (in == null) return; - //directly copied from the apache commons collection, cause GTNH had problems with that particular function for some reason? - //this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! + // directly copied from the apache commons collection, cause GTNH had problems with that particular function for + // some reason? + // this part here is NOT MIT LICENSED BUT LICSENSED UNDER THE Apache License, Version 2.0! try { if (Modifier.isFinal(in.getModifiers())) { // Do all JREs implement Field with a private ivar called "modifiers"? @@ -488,32 +992,28 @@ public class PlatinumSludgeOverHaul { } if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Platinum)) return; try { out.set(recipe, PTMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Palladium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Palladium)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Palladium)) return; try { out.set(recipe, PDMetallicPowder.get(dust, otpt.stackSize * 2)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Iridium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Iridium)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Iridium)) return; try { out.set(recipe, IrLeachResidue.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Osmium.getDust(1), true)) { - if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Osmium)) - return; + if (PlatinumSludgeOverHaul.checkRecipe(input, Materials.Osmium)) return; try { out.set(recipe, IrOsLeachResidue.get(dust, otpt.stackSize)); } catch (IllegalAccessException e) { @@ -522,29 +1022,24 @@ public class PlatinumSludgeOverHaul { } } - @SuppressWarnings({"rawtypes","unchecked"}) - private static boolean checkRecipe(Object input,Materials mat){ + @SuppressWarnings({"rawtypes", "unchecked"}) + private static boolean checkRecipe(Object input, Materials mat) { if (input instanceof List || input instanceof Object[]) { - Set lists = new HashSet(), stacks= new HashSet(); - List ip = input instanceof List ? (List)input : new ArrayList(); - Object[] ip2 = input instanceof Object[] ? (Object[])input : new Object[0]; - - for (Object o : ip){ - if (o instanceof List) - lists.add(o); - else if (o instanceof ItemStack) - stacks.add(o); + Set lists = new HashSet(), stacks = new HashSet(); + List ip = input instanceof List ? (List) input : new ArrayList(); + Object[] ip2 = input instanceof Object[] ? (Object[]) input : new Object[0]; + + for (Object o : ip) { + if (o instanceof List) lists.add(o); + else if (o instanceof ItemStack) stacks.add(o); } - for (Object o : ip2){ - if (o instanceof List) - lists.add(o); - else if (o instanceof ItemStack) - stacks.add(o); + for (Object o : ip2) { + if (o instanceof List) lists.add(o); + else if (o instanceof ItemStack) stacks.add(o); } for (Object o : lists) { - if (!((List) o).isEmpty()) - stacks.add(((List) o).get(0)); + if (!((List) o).isEmpty()) stacks.add(((List) o).get(0)); } for (Object stack : stacks) { @@ -557,13 +1052,16 @@ public class PlatinumSludgeOverHaul { boolean allSame = false; for (Object stack : stacks) { if (stack instanceof ItemStack) { - allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) && GT_OreDictUnificator.getAssociation((ItemStack) stack).mMaterial.mMaterial.equals(mat); + allSame = BW_Util.checkStackAndPrefix((ItemStack) stack) + && GT_OreDictUnificator.getAssociation((ItemStack) stack) + .mMaterial + .mMaterial + .equals(mat); } else { allSame = false; break; } - if (!allSame) - break; + if (!allSame) break; } return allSame; } @@ -571,47 +1069,51 @@ public class PlatinumSludgeOverHaul { } private static boolean isInBlackList(ItemStack stack) { - if (stack == null) - return true; + if (stack == null) return true; - if (stack.getItem() instanceof BW_MetaGenerated_Items) - return true; + if (stack.getItem() instanceof BW_MetaGenerated_Items) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) - return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(MainMod.MOD_ID)) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) - return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals(BartWorksCrossmod.MOD_ID)) return true; - if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") && !stack.getUnlocalizedName().contains("dust") && !stack.getUnlocalizedName().contains("Dust") ) - return true; + if (GameRegistry.findUniqueIdentifierFor(stack.getItem()).modId.equals("dreamcraft") + && !stack.getUnlocalizedName().contains("dust") + && !stack.getUnlocalizedName().contains("Dust")) return true; - if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) - return true; + if (Block.getBlockFromItem(stack.getItem()) instanceof GT_Generic_Block + && !(Block.getBlockFromItem(stack.getItem()) instanceof GT_Block_Ores_Abstract)) return true; - if (Arrays.stream(ItemList.values()).filter(ItemList::hasBeenSet).anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) + if (Arrays.stream(ItemList.values()) + .filter(ItemList::hasBeenSet) + .anyMatch(e -> !BW_Util.checkStackAndPrefix(stack) && GT_Utility.areStacksEqual(e.get(1), stack, true))) return true; if (stack.getItem() instanceof GT_Generic_Item) { - if (!BW_Util.checkStackAndPrefix(stack)) - return false; - return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + if (!BW_Util.checkStackAndPrefix(stack)) return false; + return (!Arrays.asList(PlatinumSludgeOverHaul.OPBLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mPrefix)) + || Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } if (LoaderReference.miscutils) { try { - if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent").isAssignableFrom(stack.getItem().getClass()) && !(stack.getUnlocalizedName().contains("dust") || stack.getUnlocalizedName().contains("Dust"))) - return true; - if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular").isAssignableFrom(Block.getBlockFromItem(stack.getItem()).getClass())) - return true; + if (Class.forName("gtPlusPlus.core.item.base.BaseItemComponent") + .isAssignableFrom(stack.getItem().getClass()) + && !(stack.getUnlocalizedName().contains("dust") + || stack.getUnlocalizedName().contains("Dust"))) return true; + if (Class.forName("gtPlusPlus.core.block.base.BlockBaseModular") + .isAssignableFrom( + Block.getBlockFromItem(stack.getItem()).getClass())) return true; } catch (ClassNotFoundException e) { e.printStackTrace(); } } - if (!BW_Util.checkStackAndPrefix(stack)) - return false; + if (!BW_Util.checkStackAndPrefix(stack)) return false; - return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST).contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); + return Arrays.asList(PlatinumSludgeOverHaul.BLACKLIST) + .contains(GT_OreDictUnificator.getAssociation(stack).mMaterial.mMaterial); } } 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 fc4209ed27..58c0811d93 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 @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material; +import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; +import static net.minecraft.util.EnumChatFormatting.GREEN; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; @@ -36,15 +39,11 @@ import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.*; - -import static net.minecraft.util.EnumChatFormatting.DARK_PURPLE; -import static net.minecraft.util.EnumChatFormatting.GREEN; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @@ -53,20 +52,20 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static final LinkedHashMap<Short, Werkstoff> werkstoffHashMap = new LinkedHashMap<>(); public static final LinkedHashMap<String, Werkstoff> werkstoffNameHashMap = new LinkedHashMap<>(); - public static final Map<String, String> modNameOverrides = new HashMap(){{ - put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); - }}; + public static final Map<String, String> modNameOverrides = new HashMap() { + { + put("GalaxySpace", DARK_PURPLE + "GalaxySpace"); + } + }; - private static final List<String> BWModNames = Arrays.asList( - MainMod.NAME, - BartWorksCrossmod.NAME, - MaterialsInjector.NAME - ); + private static final List<String> BWModNames = + Arrays.asList(MainMod.NAME, BartWorksCrossmod.NAME, MaterialsInjector.NAME); private static final HashSet<Short> idHashSet = new HashSet<>(); private static final Werkstoff.Stats DEFAULT_NULL_STATS = new Werkstoff.Stats(); - private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = new Werkstoff.GenerationFeatures().disable(); + private static final Werkstoff.GenerationFeatures DEFAULT_NULL_GENERATION_FEATURES = + new Werkstoff.GenerationFeatures().disable(); public static Werkstoff default_null_Werkstoff; private final HashSet<String> ADDITIONAL_OREDICT = new HashSet<>(); @@ -94,7 +93,15 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static void init() { - 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); + 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); } /** @@ -104,19 +111,18 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * @param type - self explainatory * @param mID > 31_766 && <= 32_767 */ - public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID){ - this( materials.mRGBa, - materials.mDefaultLocalName, - materials.getToolTip(), - type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, - generationFeatures, - mID, - materials.mIconSet, - (List) materials.mOreByProducts, - new Pair<>(materials, 1) - ); - if(!(mID > 31_766 && mID <= 32_767)) - throw new IllegalArgumentException(); + public Werkstoff(Materials materials, Werkstoff.GenerationFeatures generationFeatures, Types type, int mID) { + this( + materials.mRGBa, + materials.mDefaultLocalName, + materials.getToolTip(), + type == null ? materials.mElement != null ? Types.ELEMENT : Types.UNDEFINED : type, + generationFeatures, + mID, + materials.mIconSet, + (List) materials.mOreByProducts, + new Pair<>(materials, 1)); + if (!(mID > 31_766 && mID <= 32_767)) throw new IllegalArgumentException(); this.stats.mass = materials.getMass(); this.stats.protons = materials.getProtons(); this.stats.meltingPoint = materials.mMeltingPoint; @@ -128,59 +134,178 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { this.stats.setRadioactive(materials.isRadioactive()); this.stats.setBlastFurnace(materials.mBlastFurnaceRequired); this.stats.setMeltingVoltage(120); - if (type == Types.COMPOUND){ + if (type == Types.COMPOUND) { this.stats.setElektrolysis(true); this.generationFeatures.addChemicalRecipes(); - } - else if (type == Types.MIXTURE) { + } else if (type == Types.MIXTURE) { this.stats.setCentrifuge(true); 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); + 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); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair<ISubTagContainer, Integer>... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, int meltingpoint, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), type, generationFeatures, mID, texSet, oreByProduct, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + int meltingpoint, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List<ISubTagContainer> oreByProduct, + Pair<ISubTagContainer, Integer>... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type).setMeltingPoint(meltingpoint), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { - this(rgba, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List<ISubTagContainer> oreByProduct, + Pair<ISubTagContainer, Integer>... contents) { + this( + rgba, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } - public Werkstoff(short[] rgba, String toolTip, String defaultName, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { - this(rgba, toolTip, defaultName, Werkstoff.Types.getDefaultStatForType(type), type, generationFeatures, mID, texSet, oreByProduct, contents); + public Werkstoff( + short[] rgba, + String toolTip, + String defaultName, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List<ISubTagContainer> oreByProduct, + Pair<ISubTagContainer, Integer>... contents) { + this( + rgba, + toolTip, + defaultName, + Werkstoff.Types.getDefaultStatForType(type), + type, + generationFeatures, + mID, + texSet, + oreByProduct, + contents); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List<ISubTagContainer> oreByProduct, + Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff(short[] rgba, String defaultName, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, "", stats, type, generationFeatures, mID, texSet, contents); } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, List<ISubTagContainer> oreByProduct, Pair<ISubTagContainer, Integer>... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + String toolTip, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + List<ISubTagContainer> oreByProduct, + Pair<ISubTagContainer, Integer>... contents) { this(rgba, defaultName, toolTip, stats, type, generationFeatures, mID, texSet, contents); this.mOreByProducts.clear(); this.mOreByProducts.addAll(oreByProduct); } - public Werkstoff(short[] rgba, String defaultName, String toolTip, Werkstoff.Stats stats, Werkstoff.Types type, Werkstoff.GenerationFeatures generationFeatures, int mID, TextureSet texSet, Pair<ISubTagContainer, Integer>... contents) { + public Werkstoff( + short[] rgba, + String defaultName, + String toolTip, + Werkstoff.Stats stats, + Werkstoff.Types type, + Werkstoff.GenerationFeatures generationFeatures, + int mID, + TextureSet texSet, + Pair<ISubTagContainer, Integer>... contents) { if (Werkstoff.idHashSet.contains((short) mID)) throw new UnsupportedOperationException("ID (" + mID + ") is already in use!"); Werkstoff.idHashSet.add((short) mID); - if (type == null) - type = Werkstoff.Types.UNDEFINED; + if (type == null) type = Werkstoff.Types.UNDEFINED; this.mID = (short) mID; this.defaultName = defaultName; @@ -199,28 +324,33 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (contents.length > 1) { if (p.getKey() instanceof Materials) { if (((Materials) p.getKey()).mMaterialList.size() > 1 && p.getValue() > 1) - this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" + (BW_Util.subscriptNumber(p.getValue())); + this.toolTip += "(" + getFormula((Materials) p.getKey()) + ")" + + (BW_Util.subscriptNumber(p.getValue())); else - this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Materials) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } if (p.getKey() instanceof Werkstoff) { if (((Werkstoff) p.getKey()).CONTENTS.size() > 1 && p.getValue() > 1) - this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" + (BW_Util.subscriptNumber(p.getValue())); + this.toolTip += "(" + getFormula((Werkstoff) p.getKey()) + ")" + + (BW_Util.subscriptNumber(p.getValue())); else - this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } else { if (p.getKey() instanceof Materials) { - this.toolTip += getFormula((Materials) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Materials) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } else if (p.getKey() instanceof Werkstoff) - this.toolTip += getFormula((Werkstoff) p.getKey()) + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); + this.toolTip += getFormula((Werkstoff) p.getKey()) + + (p.getValue() > 1 ? BW_Util.subscriptNumber(p.getValue()) : ""); } } - } else - this.toolTip = toolTip; + } else this.toolTip = toolTip; -// if (this.toolTip.length() > 25) -// this.toolTip = "The formula is to long..."; + // if (this.toolTip.length() > 25) + // this.toolTip = "The formula is to long..."; // Ensure that localization key are written to the lang file GregTech_API.sAfterGTPreload.add(() -> { @@ -250,15 +380,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { count += p.getValue(); } } - if(count > 0) - this.stats = stats.setMass(tmpmass/count); + if (count > 0) this.stats = stats.setMass(tmpmass / count); } - if (this.stats.meltingPoint == 0) - this.stats.meltingPoint = 1123; + if (this.stats.meltingPoint == 0) this.stats.meltingPoint = 1123; - if (this.stats.meltingVoltage == 0) - this.stats.meltingVoltage = 120; + if (this.stats.meltingVoltage == 0) this.stats.meltingVoltage = 120; this.texSet = texSet; @@ -317,12 +444,11 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { HashSet<TC_Aspects.TC_AspectStack> tc_aspectStacks = new HashSet<>(); HashSet<Pair<Object, Integer>> set = new HashSet<>(); for (Pair p : this.getContents().getValue()) { - if (p.getKey() instanceof Materials) - tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); - if (p.getKey() instanceof Werkstoff) - set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); + if (p.getKey() instanceof Materials) tc_aspectStacks.addAll(((Materials) p.getKey()).mAspects); + if (p.getKey() instanceof Werkstoff) set.addAll(Arrays.asList(((Werkstoff) p.getKey()).getTCAspects())); } - tc_aspectStacks.forEach(tc_aspectStack -> set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); + tc_aspectStacks.forEach(tc_aspectStack -> + set.add(new Pair<>(tc_aspectStack.mAspect.mAspect, (int) tc_aspectStack.mAmount))); this.stats.mTC_Aspects = set.toArray(new Pair[0]); } Pair<Object, Integer>[] ret = this.stats.mTC_Aspects.clone(); @@ -336,7 +462,12 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { final List<TC_Aspects.TC_AspectStack> ret = new ArrayList<>(); Arrays.stream(getTCAspects()).forEach(objectIntegerPair -> { try { - new TC_Aspects.TC_AspectStack(TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke(objectIntegerPair.getKey())).toUpperCase(Locale.US)), objectIntegerPair.getValue()).addToAspectList(ret); + new TC_Aspects.TC_AspectStack( + TC_Aspects.valueOf(((String) ThaumcraftHandler.AspectAdder.getName.invoke( + objectIntegerPair.getKey())) + .toUpperCase(Locale.US)), + objectIntegerPair.getValue()) + .addToAspectList(ret); } catch (IllegalAccessException | InvocationTargetException ignored) { } }); @@ -353,8 +484,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public boolean containsStuff(ISubTagContainer stuff) { for (Pair<ISubTagContainer, Integer> pair : this.CONTENTS) { - if (pair.getKey().equals(stuff)) - return true; + if (pair.getKey().equals(stuff)) return true; } return false; } @@ -382,32 +512,23 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public ISubTagContainer getOreByProductRaw(int aNumber) { - if (this.mOreByProducts.size() == 0) - return null; - if (aNumber < 0) - aNumber = this.mOreByProducts.size() + aNumber; - while (aNumber >= this.mOreByProducts.size()) - aNumber--; + if (this.mOreByProducts.size() == 0) return null; + if (aNumber < 0) aNumber = this.mOreByProducts.size() + aNumber; + while (aNumber >= this.mOreByProducts.size()) aNumber--; ISubTagContainer o = this.mOreByProducts.get(aNumber); - if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) - return this; + if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this; return o; } public ItemStack getOreByProduct(int aNumber, OrePrefixes prefixes) { - if (this.mOreByProducts.size() == 0) - return null; - if (aNumber < 0) - aNumber = this.mOreByProducts.size() + aNumber; - while (aNumber >= this.mOreByProducts.size()) - aNumber--; + if (this.mOreByProducts.size() == 0) return null; + if (aNumber < 0) aNumber = this.mOreByProducts.size() + aNumber; + while (aNumber >= this.mOreByProducts.size()) aNumber--; Object o = this.mOreByProducts.get(aNumber); if (o == null || o.equals(Werkstoff.default_null_Werkstoff) || o.equals(Materials._NULL)) return this.get(prefixes); - if (o instanceof Werkstoff) - return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o); - if (o instanceof Materials) - return GT_OreDictUnificator.get(prefixes, o, 1L); + if (o instanceof Werkstoff) return WerkstoffLoader.getCorrespondingItemStack(prefixes, (Werkstoff) o); + if (o instanceof Materials) return GT_OreDictUnificator.get(prefixes, o, 1L); return null; } @@ -416,7 +537,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getLocalizedName() { - return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished); + return GT_LanguageManager.addStringLocalization( + String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished); } public String getVarName() { @@ -428,7 +550,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public String getLocalizedToolTip() { - return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished); + return GT_LanguageManager.addStringLocalization( + String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished); } public Werkstoff.Stats getStats() { @@ -452,20 +575,21 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public void setRgb(short[] rgb) { - this.rgb = new byte[]{(byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128)}; + this.rgb = new byte[] {(byte) (rgb[0] - 128), (byte) (rgb[1] - 128), (byte) (rgb[2] - 128)}; } @Override public short[] getRGBA() { - return new short[]{(short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0}; + return new short[] {(short) (this.rgb[0] + 128), (short) (this.rgb[1] + 128), (short) (this.rgb[2] + 128), 0}; } @Override public boolean contains(SubTag subTag) { - if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) && !subTag.equals(WerkstoffLoader.NO_BLAST)) + if (!subTag.equals(WerkstoffLoader.NOBLE_GAS) + && !subTag.equals(WerkstoffLoader.ANAEROBE_GAS) + && !subTag.equals(WerkstoffLoader.NO_BLAST)) for (Pair<ISubTagContainer, Integer> p : this.CONTENTS) - if (p.getKey().contains(subTag)) - return true; + if (p.getKey().contains(subTag)) return true; return this.SUBTAGS.contains(subTag); } @@ -501,17 +625,37 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public byte getToolQuality() { - return this.stats.getQualityOverride() > 0 ? this.stats.getQualityOverride() : (byte) ((15f * (((float) this.getStats().getProtons() / 188f) + (float) this.getStats().getMeltingPoint() / 10801f)) / (float) this.getContents().getKey()); + return this.stats.getQualityOverride() > 0 + ? this.stats.getQualityOverride() + : (byte) ((15f + * (((float) this.getStats().getProtons() / 188f) + + (float) this.getStats().getMeltingPoint() / 10801f)) + / (float) this.getContents().getKey()); } public float getToolSpeed() { - return this.stats.getSpeedOverride() > 0f ? this.stats.getSpeedOverride() : Math.max(1f, - 2f * ((float) -this.getStats().getMass() + 0.1f * (float) this.getStats().getMeltingPoint() + (float) this.getStats().getProtons()) * 0.1f / (float) this.getContents().getKey() * 0.1f * (float) this.getToolQuality() - ); + return this.stats.getSpeedOverride() > 0f + ? this.stats.getSpeedOverride() + : Math.max( + 1f, + 2f + * ((float) -this.getStats().getMass() + + 0.1f * (float) this.getStats().getMeltingPoint() + + (float) this.getStats().getProtons()) + * 0.1f + / (float) this.getContents().getKey() + * 0.1f + * (float) this.getToolQuality()); } public int getDurability() { - return this.stats.getDurOverride() > 0 ? this.stats.getDurOverride() : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey())); + return this.stats.getDurOverride() > 0 + ? this.stats.getDurOverride() + : (int) (this.stats.durMod + * ((0.01f + * (float) this.getStats().getMeltingPoint() + * (float) this.getStats().getMass()) + / (float) this.getContents().getKey())); } /** @@ -519,13 +663,14 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { */ public boolean hasItemType(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); - return (this.getGenerationFeatures().toGenerate & unpacked) != 0 && (this.getGenerationFeatures().blacklist & unpacked) == 0; + return (this.getGenerationFeatures().toGenerate & unpacked) != 0 + && (this.getGenerationFeatures().blacklist & unpacked) == 0; } /** * DOES NOT CHECK BLACKLIST! */ - public boolean hasGenerationFeature(OrePrefixes prefixes){ + public boolean hasGenerationFeature(OrePrefixes prefixes) { int unpacked = Werkstoff.GenerationFeatures.getPrefixDataRaw(prefixes); return (this.getGenerationFeatures().toGenerate & unpacked) != 0; } @@ -534,7 +679,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { * Checks if the Actual Stack exists in the OreDict */ public boolean doesOreDictedItemExists(OrePrefixes prefixes) { - return OreDictHandler.getItemStack(this.getDefaultName(), prefixes,1) != null; + return OreDictHandler.getItemStack(this.getDefaultName(), prefixes, 1) != null; } public String getOwner() { @@ -553,7 +698,13 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public enum Types { - MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED; + MATERIAL, + COMPOUND, + MIXTURE, + BIOLOGICAL, + ELEMENT, + ISOTOPE, + UNDEFINED; public static Werkstoff.Stats getDefaultStatForType(Werkstoff.Types T) { switch (T) { @@ -571,7 +722,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public static class GenerationFeatures { public static final GenerationFeatures DISABLED = new GenerationFeatures().disable(); long toGenerate = 0b0001001; - //logic gate shit + // logic gate shit /* dust 1 metal 10 (ingot, nugget) @@ -587,8 +738,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { private boolean isExtension; private static final NonNullWrappedHashMap<OrePrefixes, Integer> prefixLogic = new NonNullWrappedHashMap<>(0); - public GenerationFeatures() { - } + public GenerationFeatures() {} public static void initPrefixLogic() { Arrays.stream(OrePrefixes.values()).forEach(e -> prefixLogic.put(e, 0)); @@ -660,8 +810,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public static int getPrefixDataRaw(OrePrefixes prefixes) { - if (prefixes == null) - throw new IllegalArgumentException("OrePrefixes is NULL!"); + if (prefixes == null) throw new IllegalArgumentException("OrePrefixes is NULL!"); return GenerationFeatures.prefixLogic.get(prefixes); } @@ -669,7 +818,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return isExtension; } - //public byte toGenerateSecondary = 0b0000000; + // public byte toGenerateSecondary = 0b0000000; public byte blacklist; public boolean enforceUnification; @@ -711,22 +860,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { @Deprecated public Werkstoff.GenerationFeatures removeGems() { - if (this.hasGems()) - this.toGenerate = (long) (this.toGenerate ^ 0b100); + if (this.hasGems()) this.toGenerate = (long) (this.toGenerate ^ 0b100); return this; } @Deprecated public Werkstoff.GenerationFeatures removeDusts() { - if (this.hasDusts()) - this.toGenerate = (long) (this.toGenerate ^ 0b1); + if (this.hasDusts()) this.toGenerate = (long) (this.toGenerate ^ 0b1); return this; } @Deprecated public Werkstoff.GenerationFeatures removeOres() { - if (this.hasOres()) - this.toGenerate = (long) (this.toGenerate ^ 0b1000); + if (this.hasOres()) this.toGenerate = (long) (this.toGenerate ^ 0b1000); return this; } @@ -746,8 +892,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { public Werkstoff.GenerationFeatures addMixerRecipes(short aCircuit) { this.extraRecipes = (byte) (this.extraRecipes | 10); - if (aCircuit >= 1 && aCircuit <=24) - this.mixCircuit = aCircuit; + if (aCircuit >= 1 && aCircuit <= 24) this.mixCircuit = aCircuit; return this; } @@ -755,7 +900,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { return (this.extraRecipes & 10) != 0; } - public Werkstoff.GenerationFeatures addSifterRecipes() { this.extraRecipes = (byte) (this.extraRecipes | 100); return this; @@ -956,7 +1100,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } private Pair<Object, Integer>[] mTC_Aspects; - //logic gate shit + // logic gate shit byte quality = ~0b1111111; public Werkstoff.Stats setmTC_AspectsArray(Pair<Object, Integer>[] mTC_Aspects) { @@ -988,13 +1132,28 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { if (this.neutrons != that.neutrons) return false; if (this.electrons != that.electrons) return false; if (Math.abs(this.ebfGasRecipeTimeMultiplier - that.ebfGasRecipeTimeMultiplier) > 1.0e-6D) return false; - if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) > 1.0e-6D) return false; + if (Math.abs(this.ebfGasRecipeConsumedAmountMultiplier - that.ebfGasRecipeConsumedAmountMultiplier) + > 1.0e-6D) return false; return this.quality == that.quality; } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(49).put(this.quality).putInt(this.boilingPoint).putInt(this.meltingPoint).putLong(this.protons).putLong(this.neutrons).putLong(this.electrons).putLong(this.mass).putDouble(this.ebfGasRecipeTimeMultiplier).putDouble(this.ebfGasRecipeConsumedAmountMultiplier).array(), 0, 49, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(49) + .put(this.quality) + .putInt(this.boilingPoint) + .putInt(this.meltingPoint) + .putLong(this.protons) + .putLong(this.neutrons) + .putLong(this.electrons) + .putLong(this.mass) + .putDouble(this.ebfGasRecipeTimeMultiplier) + .putDouble(this.ebfGasRecipeConsumedAmountMultiplier) + .array(), + 0, + 49, + 31); } public Werkstoff.Stats setMass(long mass) { @@ -1012,10 +1171,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setSublimation(boolean sublimation) { - if (sublimation) - this.quality = (byte) (this.quality | 0b000001); - else - this.quality = (byte) (this.quality & 0b1111110); + if (sublimation) this.quality = (byte) (this.quality | 0b000001); + else this.quality = (byte) (this.quality & 0b1111110); return this; } @@ -1024,10 +1181,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setToxic(boolean toxic) { - if (toxic) - this.quality = (byte) (this.quality | 0b000010); - else - this.quality = (byte) (this.quality & 0b1111101); + if (toxic) this.quality = (byte) (this.quality | 0b000010); + else this.quality = (byte) (this.quality & 0b1111101); return this; } @@ -1047,10 +1202,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setRadioactive(boolean radioactive) { - if (radioactive) - this.quality = (byte) (this.quality | 0b000100); - else - this.quality = (byte) (this.quality & 0b1111011); + if (radioactive) this.quality = (byte) (this.quality | 0b000100); + else this.quality = (byte) (this.quality & 0b1111011); return this; } @@ -1059,10 +1212,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setBlastFurnace(boolean blastFurnace) { - if (blastFurnace) - this.quality = (byte) (this.quality | 0b001000); - else - this.quality = (byte) (this.quality & 0b1110111); + if (blastFurnace) this.quality = (byte) (this.quality | 0b001000); + else this.quality = (byte) (this.quality & 0b1110111); return this; } @@ -1080,10 +1231,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setElektrolysis(boolean elektrolysis) { - if (elektrolysis) - this.quality = (byte) (this.quality | 0x10); - else - this.quality = (byte) (this.quality & 0b1101111); + if (elektrolysis) this.quality = (byte) (this.quality | 0x10); + else this.quality = (byte) (this.quality & 0b1101111); return this; } @@ -1092,10 +1241,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setCentrifuge(boolean centrifuge) { - if (centrifuge) - this.quality = (byte) (this.quality | 0x20); - else - this.quality = (byte) (this.quality & 0b1011111); + if (centrifuge) this.quality = (byte) (this.quality | 0x20); + else this.quality = (byte) (this.quality & 0b1011111); return this; } @@ -1104,12 +1251,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer { } public Werkstoff.Stats setGas(boolean gas) { - if (gas) - this.quality = (byte) (this.quality | 0x40); - else - this.quality = (byte) (this.quality & 0b0111111); + if (gas) this.quality = (byte) (this.quality | 0x40); + else this.quality = (byte) (this.quality & 0b0111111); return this; } } - } 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 7047f99438..ac5c1948c1 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 @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material; +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.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.API.WerkstoffAdderRegistry; @@ -56,6 +60,8 @@ import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputOreDict; import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; +import java.lang.reflect.Field; +import java.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; @@ -64,17 +70,9 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary; import org.apache.logging.log4j.Level; -import java.lang.reflect.Field; -import java.util.*; - -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", "deprecation"}) public class WerkstoffLoader { - private WerkstoffLoader() { - } + private WerkstoffLoader() {} public static final SubTag NOBLE_GAS = SubTag.getNewSubTag("NobleGas"); public static final SubTag ANAEROBE_GAS = SubTag.getNewSubTag("AnaerobeGas"); @@ -93,15 +91,15 @@ public class WerkstoffLoader { public static boolean gtnhGT = false; public static void setUp() { - //GTNH detection hack + // GTNH detection hack try { Field f = GT_MetaGenerated_Tool_01.class.getField("SOLDERING_IRON_MV"); gtnhGT = true; } catch (Exception ignored) { gtnhGT = false; } - //GTNH detection hack #2 - //GTNH hack for molten cells + // GTNH detection hack #2 + // GTNH hack for molten cells for (OrePrefixes prefix : values()) { if (prefix.toString().equals("cellMolten")) { WerkstoffLoader.cellMolten = prefix; @@ -116,13 +114,24 @@ public class WerkstoffLoader { if (WerkstoffLoader.cellMolten == null) { WerkstoffLoader.cellMolten = EnumUtils.addNewOrePrefix( - "cellMolten","Cells of Molten stuff", "Molten ", - " Cell", true, true, - true, true, false, - false, false, true, - false, false, 0b1000000, - 3628800L, 64, 31 - ); + "cellMolten", + "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; @@ -137,11 +146,13 @@ public class WerkstoffLoader { } catch (NullPointerException | IllegalArgumentException ignored) { } - //add tiberium + // add tiberium Element t = EnumUtils.createNewElement("Tr", 123L, 203L, 0L, -1L, null, "Tiberium", false); - blockCasing = EnumUtils.addNewOrePrefix("blockCasing", + blockCasing = EnumUtils.addNewOrePrefix( + "blockCasing", "A Casing block for a Multiblock-Machine", - "Bolted ", " Casing", + "Bolted ", + " Casing", true, true, true, @@ -156,9 +167,11 @@ public class WerkstoffLoader { 32659200L, 64, -1); - blockCasingAdvanced = EnumUtils.addNewOrePrefix("blockCasingAdvanced", + blockCasingAdvanced = EnumUtils.addNewOrePrefix( + "blockCasingAdvanced", "An Advanced Casing block for a Multiblock-Machine", - "Rebolted ", " Casing", + "Rebolted ", + " Casing", true, true, true, @@ -173,16 +186,27 @@ public class WerkstoffLoader { 32659200L, 64, -1); - //add molten & regular capsuls + // add molten & regular capsuls if (LoaderReference.Forestry) { capsuleMolten = EnumUtils.addNewOrePrefix( - "capsuleMolten", "Capsule of Molten stuff", "Molten ", - " Capsule", true, true, - true, true, false, - false, false, true, - false, false, 0b1000000, - 3628800L, 64, -1 - ); + "capsuleMolten", + "Capsule of Molten stuff", + "Molten ", + " Capsule", + true, + true, + true, + true, + false, + false, + false, + true, + false, + false, + 0b1000000, + 3628800L, + 64, + -1); capsule.mMaterialGenerationBits = 0b100000; capsule.mDefaultStackSize = 64; } @@ -192,17 +216,17 @@ public class WerkstoffLoader { BW_GT_MaterialReference.init(); } - //TODO: - //FREE ID RANGE: 12_000-28_998 - //bartimaeusnek reserved 0-10_000 - //GlodBlock reserved range 10_001-10_999 - //Elisis reserved range 11_000-11_499 - //glowredman reserved range 11_500-11_999 - //bot reserved range 29_899-29_999 - //Tec & basdxz reserved range 30_000-31_000 - //GT Material range reserved on 31_767-32_767 + // TODO: + // FREE ID RANGE: 12_000-28_998 + // bartimaeusnek reserved 0-10_000 + // GlodBlock reserved range 10_001-10_999 + // Elisis reserved range 11_000-11_499 + // glowredman reserved range 11_500-11_999 + // bot reserved range 29_899-29_999 + // Tec & basdxz reserved range 30_000-31_000 + // GT Material range reserved on 31_767-32_767 public static final Werkstoff Bismutite = new Werkstoff( - new short[]{255, 233, 0, 0}, + new short[] {255, 233, 0, 0}, "Bismutite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), @@ -211,10 +235,9 @@ public class WerkstoffLoader { Collections.singletonList(Materials.Bismuth), new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Oxygen, 2), - new Pair<>(Materials.CarbonDioxide, 2) - ); + new Pair<>(Materials.CarbonDioxide, 2)); public static final Werkstoff Bismuthinit = new Werkstoff( - new short[]{192, 192, 192, 0}, + new short[] {192, 192, 192, 0}, "Bismuthinite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -222,21 +245,28 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Arrays.asList(Materials.Bismuth, Materials.Sulfur), new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Sulfur, 3) - ); + new Pair<>(Materials.Sulfur, 3)); public static final Werkstoff Zirconium = new Werkstoff( - new short[]{175, 175, 175, 0}, + new short[] {175, 175, 175, 0}, "Zirconium", "Zr", - new Werkstoff.Stats().setProtons(40).setBlastFurnace(true).setMeltingPoint(2130).setMeltingVoltage(480), + new Werkstoff.Stats() + .setProtons(40) + .setBlastFurnace(true) + .setMeltingPoint(2130) + .setMeltingVoltage(480), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .enforceUnification(), 3, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff CubicZirconia = new Werkstoff( - new short[]{255, 255, 255, 0}, + new short[] {255, 255, 255, 0}, "Cubic Zirconia", Werkstoff.Types.COMPOUND, 3273, @@ -245,10 +275,9 @@ public class WerkstoffLoader { TextureSet.SET_DIAMOND, Collections.singletonList(WerkstoffLoader.Zirconium), new Pair<>(WerkstoffLoader.Zirconium, 1), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff FluorBuergerit = new Werkstoff( - new short[]{0x20, 0x20, 0x20, 0}, + new short[] {0x20, 0x20, 0x20, 0}, "Fluor-Buergerite", subscriptNumbers("NaFe3Al6(Si6O18)(BO3)3O3F"), new Werkstoff.Stats().setElektrolysis(false), @@ -263,20 +292,20 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 30), - new Pair<>(Materials.Fluorine, 1) - ); + new Pair<>(Materials.Fluorine, 1)); public static final Werkstoff YttriumOxide = new Werkstoff( - new short[]{255, 255, 255, 0}, + new short[] {255, 255, 255, 0}, "Yttrium Oxide", Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().onlyDust().enforceUnification(), //No autoadd here to gate this material by hand + new Werkstoff.GenerationFeatures() + .onlyDust() + .enforceUnification(), // No autoadd here to gate this material by hand 6, TextureSet.SET_DULL, new Pair<>(Materials.Yttrium, 2), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff ChromoAluminoPovondrait = new Werkstoff( - new short[]{0, 0x79, 0x6A, 0}, + new short[] {0, 0x79, 0x6A, 0}, "Chromo-Alumino-Povondraite", subscriptNumbers("NaCr3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -291,10 +320,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 3) - ); + new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff VanadioOxyDravit = new Werkstoff( - new short[]{0x60, 0xA0, 0xA0, 0}, + new short[] {0x60, 0xA0, 0xA0, 0}, "Vanadio-Oxy-Dravite", subscriptNumbers("NaV3(Al4Mg2)(Si6O18)(BO3)3(OH)3O"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -309,10 +337,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 3) - ); + new Pair<>(Materials.Hydrogen, 3)); public static final Werkstoff Olenit = new Werkstoff( - new short[]{210, 210, 210, 0}, + new short[] {210, 210, 210, 0}, "Olenite", subscriptNumbers("NaAl3Al6(Si6O18)(BO3)3O3OH"), Werkstoff.Types.getDefaultStatForType(Werkstoff.Types.COMPOUND).setElektrolysis(false), @@ -326,10 +353,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Silicon, 6), new Pair<>(Materials.Boron, 3), new Pair<>(Materials.Oxygen, 31), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff Arsenopyrite = new Werkstoff( - new short[]{0xB0, 0xB0, 0xB0, 0}, + new short[] {0xB0, 0xB0, 0xB0, 0}, "Arsenopyrite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -338,10 +364,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Sulfur, Materials.Arsenic, Materials.Iron), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Arsenic, 1), - new Pair<>(Materials.Sulfur, 1) - ); + new Pair<>(Materials.Sulfur, 1)); public static final Werkstoff Ferberite = new Werkstoff( - new short[]{0xB0, 0xB0, 0xB0, 0}, + new short[] {0xB0, 0xB0, 0xB0, 0}, "Ferberite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -350,10 +375,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Iron, Materials.Tungsten), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Tungsten, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Loellingit = new Werkstoff( - new short[]{0xD0, 0xD0, 0xD0, 0}, + new short[] {0xD0, 0xD0, 0xD0, 0}, "Loellingite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -361,10 +385,9 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Arrays.asList(Materials.Iron, Materials.Arsenic), new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Arsenic, 2) - ); + new Pair<>(Materials.Arsenic, 2)); public static final Werkstoff Roquesit = new Werkstoff( - new short[]{0xA0, 0xA0, 0xA0, 0}, + new short[] {0xA0, 0xA0, 0xA0, 0}, "Roquesite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -373,10 +396,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Copper, Materials.Sulfur), new Pair<>(Materials.Copper, 1), new Pair<>(Materials.Indium, 1), - new Pair<>(Materials.Sulfur, 2) - ); + new Pair<>(Materials.Sulfur, 2)); public static final Werkstoff Bornite = new Werkstoff( - new short[]{0x97, 0x66, 0x2B, 0}, + new short[] {0x97, 0x66, 0x2B, 0}, "Bornite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -385,8 +407,7 @@ public class WerkstoffLoader { Arrays.asList(Materials.Copper, Materials.Iron, Materials.Sulfur), new Pair<>(Materials.Copper, 5), new Pair<>(Materials.Iron, 1), - new Pair<>(Materials.Sulfur, 4) - ); + new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Wittichenit = new Werkstoff( Materials.Copper.mRGBa, "Wittichenite", @@ -397,10 +418,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Copper, Materials.Bismuth, Materials.Sulfur), new Pair<>(Materials.Copper, 5), new Pair<>(Materials.Bismuth, 1), - new Pair<>(Materials.Sulfur, 4) - ); + new Pair<>(Materials.Sulfur, 4)); public static final Werkstoff Djurleit = new Werkstoff( - new short[]{0x60, 0x60, 0x60, 0}, + new short[] {0x60, 0x60, 0x60, 0}, "Djurleite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -408,10 +428,9 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Arrays.asList(Materials.Copper, Materials.Copper, Materials.Sulfur), new Pair<>(Materials.Copper, 31), - new Pair<>(Materials.Sulfur, 16) - ); + new Pair<>(Materials.Sulfur, 16)); public static final Werkstoff Huebnerit = new Werkstoff( - new short[]{0x80, 0x60, 0x60, 0}, + new short[] {0x80, 0x60, 0x60, 0}, "Huebnerite", Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -420,10 +439,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Manganese, Materials.Tungsten), new Pair<>(Materials.Manganese, 1), new Pair<>(Materials.Tungsten, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff Thorianit = new Werkstoff( - new short[]{0x30, 0x30, 0x30, 0}, + new short[] {0x30, 0x30, 0x30, 0}, "Thorianite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -432,10 +450,9 @@ public class WerkstoffLoader { TextureSet.SET_METALLIC, Collections.singletonList(Materials.Thorium), new Pair<>(Materials.Thorium, 1), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff RedZircon = new Werkstoff( - new short[]{195, 19, 19, 0}, + new short[] {195, 19, 19, 0}, "Red Zircon", new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(2130), Werkstoff.Types.COMPOUND, @@ -445,10 +462,9 @@ public class WerkstoffLoader { Arrays.asList(WerkstoffLoader.Zirconium, Materials.SiliconDioxide), new Pair<>(WerkstoffLoader.Zirconium, 1), new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); - //GT Enhancements + // GT Enhancements public static final Werkstoff Salt = new Werkstoff( Materials.Salt.mRGBa, "Salt", @@ -458,8 +474,7 @@ public class WerkstoffLoader { 20, TextureSet.SET_FLINT, Arrays.asList(Materials.RockSalt, Materials.Borax), - new Pair<>(Materials.Salt, 1) - ); + new Pair<>(Materials.Salt, 1)); public static final Werkstoff Spodumen = new Werkstoff( Materials.Spodumene.mRGBa, "Spodumene", @@ -469,8 +484,7 @@ public class WerkstoffLoader { 21, TextureSet.SET_FLINT, Collections.singletonList(Materials.Spodumene), - new Pair<>(Materials.Spodumene, 1) - ); + new Pair<>(Materials.Spodumene, 1)); public static final Werkstoff RockSalt = new Werkstoff( Materials.RockSalt.mRGBa, "Rock Salt", @@ -480,12 +494,11 @@ public class WerkstoffLoader { 22, TextureSet.SET_FLINT, Arrays.asList(Materials.RockSalt, Materials.Borax), - new Pair<>(Materials.RockSalt, 1) - ); + new Pair<>(Materials.RockSalt, 1)); - //More NonGT Stuff + // More NonGT Stuff public static final Werkstoff Fayalit = new Werkstoff( - new short[]{50, 50, 50, 0}, + new short[] {50, 50, 50, 0}, "Fayalite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -495,10 +508,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Iron, Materials.SiliconDioxide), new Pair<>(Materials.Iron, 2), new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Forsterit = new Werkstoff( - new short[]{255, 255, 255, 0}, + new short[] {255, 255, 255, 0}, "Forsterite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -508,10 +520,9 @@ public class WerkstoffLoader { Arrays.asList(Materials.Magnesium, Materials.SiliconDioxide), new Pair<>(Materials.Magnesium, 2), new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff Hedenbergit = new Werkstoff( - new short[]{100, 150, 100, 0}, + new short[] {100, 150, 100, 0}, "Hedenbergite", new Werkstoff.Stats().setElektrolysis(false), Werkstoff.Types.COMPOUND, @@ -522,11 +533,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Iron, 1), new Pair<>(Materials.Silicon, 2), - new Pair<>(Materials.Oxygen, 6) - ); + new Pair<>(Materials.Oxygen, 6)); public static final Werkstoff DescloiziteZNVO4 = new Werkstoff( - new short[]{0xBF, 0x18, 0x0F, 0}, - "Red Descloizite",//Pb(Zn,Cu)[OH|VO4 + new short[] {0xBF, 0x18, 0x0F, 0}, + "Red Descloizite", // Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -536,11 +546,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Lead, 1), new Pair<>(Materials.Zinc, 1), new Pair<>(Materials.Vanadium, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff DescloiziteCUVO4 = new Werkstoff( - new short[]{0xf9, 0x6d, 0x18, 0}, - "Orange Descloizite",//Pb(Zn,Cu)[OH|VO4 + new short[] {0xf9, 0x6d, 0x18, 0}, + "Orange Descloizite", // Pb(Zn,Cu)[OH|VO4 new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures(), @@ -550,10 +559,9 @@ public class WerkstoffLoader { new Pair<>(Materials.Lead, 1), new Pair<>(Materials.Copper, 1), new Pair<>(Materials.Vanadium, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FuchsitAL = new Werkstoff( - new short[]{0x4D, 0x7F, 0x64, 0}, + new short[] {0x4D, 0x7F, 0x64, 0}, "Green Fuchsite", subscriptNumbers("KAl3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(false), @@ -566,11 +574,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Aluminium, 3), new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Oxygen, 12), - new Pair<>(Materials.Hydrogen, 2) + new Pair<>(Materials.Hydrogen, 2)); - ); public static final Werkstoff FuchsitCR = new Werkstoff( - new short[]{128, 0, 0, 0}, + new short[] {128, 0, 0, 0}, "Red Fuchsite", subscriptNumbers("KCr3Si3O10(OH)2"), new Werkstoff.Stats().setElektrolysis(false), @@ -583,11 +590,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chrome, 3), new Pair<>(Materials.Silicon, 3), new Pair<>(Materials.Oxygen, 12), - new Pair<>(Materials.Hydrogen, 2) + new Pair<>(Materials.Hydrogen, 2)); - ); public static final Werkstoff Thorium232 = new Werkstoff( - new short[]{0, 64, 0, 0}, + new short[] {0, 64, 0, 0}, "Thorium 232", superscriptNumbers("Th232"), new Werkstoff.Stats().setRadioactive(true), @@ -595,88 +601,82 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust().enforceUnification(), 30, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff BismuthTellurite = new Werkstoff( - new short[]{32, 72, 32, 0}, + new short[] {32, 72, 32, 0}, "Bismuth Tellurite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 31, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Bismuth, 2), - new Pair<>(Materials.Tellurium, 3) - ); + new Pair<>(Materials.Tellurium, 3)); public static final Werkstoff Tellurium = new Werkstoff( - new short[]{0xff, 0xff, 0xff, 0}, + new short[] {0xff, 0xff, 0xff, 0}, "Tellurium", new Werkstoff.Stats(), Werkstoff.Types.ELEMENT, new Werkstoff.GenerationFeatures().addMetalItems().removePrefix(ore), 32, TextureSet.SET_METALLIC, - //No Byproducts - new Pair<>(Materials.Tellurium, 1) - ); + // No Byproducts + new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff BismuthHydroBorat = new Werkstoff( - new short[]{72, 144, 72, 0}, + new short[] {72, 144, 72, 0}, "Dibismuthhydroborat", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addChemicalRecipes(), 33, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Bismuth, 2), new Pair<>(Materials.Boron, 1), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff ArInGaPhoBiBoTe = new Werkstoff( - new short[]{36, 36, 36, 0}, + new short[] {36, 36, 36, 0}, "Circuit Compound MK3", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMixerRecipes(), 34, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.IndiumGalliumPhosphide, 1), new Pair<>(WerkstoffLoader.BismuthHydroBorat, 3), - new Pair<>(WerkstoffLoader.BismuthTellurite, 2) - ); + new Pair<>(WerkstoffLoader.BismuthTellurite, 2)); public static final Werkstoff Prasiolite = new Werkstoff( - new short[]{0xD0, 0xDD, 0x95, 0}, + new short[] {0xD0, 0xDD, 0x95, 0}, "Prasiolite", new Werkstoff.Stats().setElektrolysis(false).setMeltingPoint(1923), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems(), 35, TextureSet.SET_QUARTZ, - //No Byproducts + // No Byproducts new Pair<>(Materials.Silicon, 5), new Pair<>(Materials.Oxygen, 10), - new Pair<>(Materials.Iron, 1) - ); + new Pair<>(Materials.Iron, 1)); public static final Werkstoff MagnetoResonaticDust = new Werkstoff( - new short[]{0xDD, 0x77, 0xDD, 0}, + new short[] {0xDD, 0x77, 0xDD, 0}, "Magneto Resonatic", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().onlyDust().addMixerRecipes().addGems(), 36, TextureSet.SET_MAGNETIC, - //No Byproducts + // No Byproducts new Pair<>(WerkstoffLoader.Prasiolite, 3), new Pair<>(WerkstoffLoader.BismuthTellurite, 4), new Pair<>(WerkstoffLoader.CubicZirconia, 1), - new Pair<>(Materials.SteelMagnetic, 1) - ); + new Pair<>(Materials.SteelMagnetic, 1)); public static final Werkstoff Xenon = new Werkstoff( - new short[]{0x14, 0x39, 0x7F, 0}, + new short[] {0x14, 0x39, 0x7F, 0}, "Xenon", "Xe", new Werkstoff.Stats().setProtons(54).setMass(131).setGas(true), @@ -684,11 +684,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells().enforceUnification(), 37, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Oganesson = new Werkstoff( - new short[]{0x14, 0x39, 0x7F, 0}, + new short[] {0x14, 0x39, 0x7F, 0}, "Oganesson", "Og", new Werkstoff.Stats().setProtons(118).setMass(294).setGas(true), @@ -696,71 +696,94 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 38, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Californium = new Werkstoff( - new short[]{0xAA, 0xAA, 0xAA, 0}, + new short[] {0xAA, 0xAA, 0xAA, 0}, "Californium", "Cf", - new Werkstoff.Stats().setProtons(98).setMass(251).setBlastFurnace(true).setMeltingPoint(900), + new Werkstoff.Stats() + .setProtons(98) + .setMass(251) + .setBlastFurnace(true) + .setMeltingPoint(900), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .addMolten() + .enforceUnification(), 39, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // 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), + 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(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .addMolten(), 40, Materials.Calcium.mIconSet, - //No Byproducts - new Pair<>(Materials.Calcium,1) - ); + // No Byproducts + new Pair<>(Materials.Calcium, 1)); public static final Werkstoff Neon = new Werkstoff( - new short[]{0xff, 0x07, 0x3a}, + new short[] {0xff, 0x07, 0x3a}, "Neon", "Ne", - new Werkstoff.Stats().setProtons(Element.Ne.mProtons).setMass(Element.Ne.getMass()).setGas(true), + 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 - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Krypton = new Werkstoff( - new short[]{0xb1, 0xff, 0x32}, + new short[] {0xb1, 0xff, 0x32}, "Krypton", "Kr", - new Werkstoff.Stats().setProtons(Element.Kr.mProtons).setMass(Element.Kr.getMass()).setGas(true), + 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 - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff BArTiMaEuSNeK = new Werkstoff( - new short[]{0x00, 0xff, 0x00}, + new short[] {0x00, 0xff, 0x00}, "BArTiMaEuSNeK", "Are you serious?", - new Werkstoff.Stats().setMeltingPoint(9001).setCentrifuge(true).setBlastFurnace(true).setMeltingVoltage(1920), + new Werkstoff.Stats() + .setMeltingPoint(9001) + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingVoltage(1920), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().addGems().addMetalItems().addMolten(), 43, TextureSet.SET_DIAMOND, - Arrays.asList( - Materials.Boron, - Materials.Titanium, - Materials.Europium - ), + Arrays.asList(Materials.Boron, Materials.Titanium, Materials.Europium), new Pair<>(Materials.Boron, 1), new Pair<>(Materials.Argon, 1), new Pair<>(Materials.Titanium, 1), @@ -768,8 +791,7 @@ public class WerkstoffLoader { new Pair<>(Materials.Europium, 1), new Pair<>(Materials.Sulfur, 1), new Pair<>(WerkstoffLoader.Neon, 1), - new Pair<>(Materials.Potassium, 1) - ); + new Pair<>(Materials.Potassium, 1)); public static final Werkstoff PTConcentrate = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Concentrate", @@ -779,9 +801,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 44, TextureSet.SET_FLUID - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTSaltCrude = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Salt", @@ -791,9 +813,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 45, TextureSet.SET_DULL - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTSaltRefined = new Werkstoff( Materials.Platinum.getRGBA(), "Refined Platinum Salt", @@ -803,9 +825,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 46, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PTMetallicPowder = new Werkstoff( Materials.Platinum.getRGBA(), "Platinum Metallic Powder", @@ -815,24 +837,22 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 47, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Platinum, 1), - new Pair<>(Materials.Stone, 2) - ); + new Pair<>(Materials.Stone, 2)); public static final Werkstoff AquaRegia = new Werkstoff( - new short[]{0xff, 0xb1, 0x32}, + new short[] {0xff, 0xb1, 0x32}, "Aqua Regia", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 48, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.DilutedSulfuricAcid, 1), - new Pair<>(Materials.NitricAcid, 1) - ); + new Pair<>(Materials.NitricAcid, 1)); public static final Werkstoff PTResidue = new Werkstoff( - new short[]{0x64, 0x63, 0x2E}, + new short[] {0x64, 0x63, 0x2E}, "Platinum Residue", "??IrOsRhRu??", new Werkstoff.Stats(), @@ -840,10 +860,10 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 49, TextureSet.SET_ROUGH - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff AmmoniumChloride = new Werkstoff( - new short[]{0xff, 0xff, 0xff}, + new short[] {0xff, 0xff, 0xff}, "Ammonium Chloride", subscriptNumbers("NH4Cl"), new Werkstoff.Stats(), @@ -851,10 +871,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 50, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Ammonium, 1), - new Pair<>(Materials.HydrochloricAcid, 1) - ); + new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff PTRawPowder = new Werkstoff( Materials.Platinum.getRGBA(), "Reprecipitated Platinum", @@ -864,8 +883,8 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 51, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff PDAmmonia = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Enriched Ammonia", @@ -874,10 +893,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 52, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Ammonium, 1), - new Pair<>(Materials.Palladium, 1) - ); + new Pair<>(Materials.Palladium, 1)); public static final Werkstoff PDMetallicPowder = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Metallic Powder", @@ -887,10 +905,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 53, TextureSet.SET_METALLIC, - //No Byproducts + // No Byproducts new Pair<>(Materials.Palladium, 1), - new Pair<>(Materials.Stone, 2) - ); + new Pair<>(Materials.Stone, 2)); public static final Werkstoff PDRawPowder = new Werkstoff( Materials.Palladium.getRGBA(), "Reprecipitated Palladium", @@ -900,9 +917,9 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 54, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff PDSalt = new Werkstoff( Materials.Palladium.getRGBA(), "Palladium Salt", @@ -911,11 +928,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().onlyDust(), 55, TextureSet.SET_METALLIC - //No Byproducts - //No Ingredients - ); + // No Byproducts + // No Ingredients + ); public static final Werkstoff Sodiumformate = new Werkstoff( - new short[]{0xff, 0xaa, 0xaa}, + new short[] {0xff, 0xaa, 0xaa}, "Sodium Formate", "HCOONa", new Werkstoff.Stats(), @@ -923,25 +940,23 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 56, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.SodiumHydroxide, 1), - new Pair<>(Materials.CarbonMonoxide, 1) - ); + new Pair<>(Materials.CarbonMonoxide, 1)); public static final Werkstoff Sodiumsulfate = new Werkstoff( - new short[]{0xff, 0xff, 0xff}, + new short[] {0xff, 0xff, 0xff}, "Sodium Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust(), 57, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Sulfur, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff FormicAcid = new Werkstoff( - new short[]{0xff, 0xaa, 0x77}, + new short[] {0xff, 0xaa, 0x77}, "Formic Acid", subscriptNumbers("CH2O2"), new Werkstoff.Stats().setElektrolysis(false), @@ -949,26 +964,24 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures().disable().addCells(), 58, TextureSet.SET_FLUID, - //No Byproducts + // No Byproducts new Pair<>(Materials.Carbon, 1), new Pair<>(Materials.Hydrogen, 2), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff PotassiumDisulfate = new Werkstoff( - new short[]{0xfb, 0xbb, 0x66}, + new short[] {0xfb, 0xbb, 0x66}, "Potassium Disulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addChemicalRecipes(), 59, TextureSet.SET_DULL, - //No Byproducts + // No Byproducts new Pair<>(Materials.Potassium, 2), new Pair<>(Materials.Sulfur, 2), - new Pair<>(Materials.Oxygen, 7) - ); + new Pair<>(Materials.Oxygen, 7)); public static final Werkstoff LeachResidue = new Werkstoff( - new short[]{0x64, 0x46, 0x29}, + new short[] {0x64, 0x46, 0x29}, "Leach Residue", "??IrOsRu??", new Werkstoff.Stats(), @@ -976,30 +989,30 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 60, TextureSet.SET_ROUGH - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RHSulfate = new Werkstoff( - new short[]{0xee, 0xaa, 0x55}, + new short[] {0xee, 0xaa, 0x55}, "Rhodium Sulfate", new Werkstoff.Stats().setGas(true), Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable().addCells(), 61, TextureSet.SET_FLUID - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RHSulfateSolution = new Werkstoff( - new short[]{0xff, 0xbb, 0x66}, + new short[] {0xff, 0xbb, 0x66}, "Rhodium Sulfate Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 62, TextureSet.SET_FLUID - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff CalciumChloride = new Werkstoff( - new short[]{0xff, 0xff, 0xff}, + new short[] {0xff, 0xff, 0xff}, "Calcium Chloride", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1008,21 +1021,29 @@ public class WerkstoffLoader { TextureSet.SET_DULL, new Pair<>(Materials.Calcium, 1), new Pair<>(Materials.Chlorine, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff Ruthenium = new Werkstoff( - new short[]{0x64, 0x64, 0x64}, + new short[] {0x64, 0x64, 0x64}, "Ruthenium", "Ru", - new Werkstoff.Stats().setBlastFurnace(true).setMeltingPoint(2607).setMass(Element.Ru.getMass()).setProtons(Element.Ru.mProtons), + new Werkstoff.Stats() + .setBlastFurnace(true) + .setMeltingPoint(2607) + .setMass(Element.Ru.getMass()) + .setProtons(Element.Ru.mProtons), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().onlyDust().addMolten().addMetalItems().enforceUnification(), + new Werkstoff.GenerationFeatures() + .onlyDust() + .addMolten() + .addMetalItems() + .enforceUnification(), 64, TextureSet.SET_METALLIC - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff SodiumRuthenate = new Werkstoff( - new short[]{0x3a, 0x40, 0xcb}, + new short[] {0x3a, 0x40, 0xcb}, "Sodium Ruthenate", new Werkstoff.Stats(), Werkstoff.Types.COMPOUND, @@ -1032,10 +1053,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Sodium, 2), new Pair<>(Ruthenium, 1), new Pair<>(Materials.Oxygen, 3) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RutheniumTetroxide = new Werkstoff( - new short[]{0xc7, 0xc7, 0xc7}, + new short[] {0xc7, 0xc7, 0xc7}, "Ruthenium Tetroxide", new Werkstoff.Stats().setMeltingPoint(313), Werkstoff.Types.COMPOUND, @@ -1044,10 +1065,10 @@ public class WerkstoffLoader { TextureSet.SET_DULL, new Pair<>(WerkstoffLoader.Ruthenium, 1), new Pair<>(Materials.Oxygen, 4) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff HotRutheniumTetroxideSollution = new Werkstoff( - new short[]{0xc7, 0xc7, 0xc7}, + new short[] {0xc7, 0xc7, 0xc7}, "Hot Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setGas(true).setMeltingPoint(700), @@ -1060,10 +1081,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 2), new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Water, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff RutheniumTetroxideSollution = new Werkstoff( - new short[]{0xc7, 0xc7, 0xc7}, + new short[] {0xc7, 0xc7, 0xc7}, "Ruthenium Tetroxide Solution", "???", new Werkstoff.Stats().setMeltingPoint(313), @@ -1076,10 +1097,10 @@ public class WerkstoffLoader { new Pair<>(Materials.Chlorine, 2), new Pair<>(Materials.Sodium, 2), new Pair<>(Materials.Water, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff IrOsLeachResidue = new Werkstoff( - new short[]{0x64, 0x46, 0x29}, + new short[] {0x64, 0x46, 0x29}, "Rarest Metal Residue", "??OsIr??", new Werkstoff.Stats(), @@ -1087,12 +1108,11 @@ public class WerkstoffLoader { new Werkstoff.GenerationFeatures(), 69, TextureSet.SET_ROUGH, - //No Byproducts + // No Byproducts new Pair<>(Materials.Osmiridium, 1), - new Pair<>(Materials.Stone, 2) - ); + new Pair<>(Materials.Stone, 2)); public static final Werkstoff IrLeachResidue = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Iridium Metal Residue", "??Ir??", new Werkstoff.Stats(), @@ -1102,10 +1122,10 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Iridium, 1), new Pair<>(Materials.Stone, 2) - //No Byproducts - ); + // No Byproducts + ); public static final Werkstoff PGSDResidue = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Sludge Dust Residue", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1113,10 +1133,9 @@ public class WerkstoffLoader { 71, TextureSet.SET_DULL, new Pair<>(Materials.SiliconDioxide, 3), - new Pair<>(Materials.Gold, 2) - ); + new Pair<>(Materials.Gold, 2)); public static final Werkstoff AcidicOsmiumSolution = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Acidic Osmium Solution", "???", new Werkstoff.Stats(), @@ -1125,10 +1144,9 @@ public class WerkstoffLoader { 72, TextureSet.SET_FLUID, new Pair<>(Materials.Osmium, 1), - new Pair<>(Materials.HydrochloricAcid, 1) - ); + new Pair<>(Materials.HydrochloricAcid, 1)); public static final Werkstoff IridiumDioxide = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Iridium Dioxide", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, @@ -1136,10 +1154,9 @@ public class WerkstoffLoader { 73, TextureSet.SET_FLUID, new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Oxygen, 2) - ); + new Pair<>(Materials.Oxygen, 2)); public static final Werkstoff OsmiumSolution = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Osmium Solution", "???", new Werkstoff.Stats(), @@ -1148,10 +1165,9 @@ public class WerkstoffLoader { 74, TextureSet.SET_FLUID, new Pair<>(Materials.Osmium, 1), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff AcidicIridiumSolution = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Acidic Iridium Solution", "???", new Werkstoff.Stats(), @@ -1160,10 +1176,9 @@ public class WerkstoffLoader { 75, TextureSet.SET_FLUID, new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Hydrogen, 1) - ); + new Pair<>(Materials.Hydrogen, 1)); public static final Werkstoff IridiumChloride = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Iridium Chloride", subscriptNumbers("IrCl3"), new Werkstoff.Stats(), @@ -1172,10 +1187,9 @@ public class WerkstoffLoader { 76, TextureSet.SET_LAPIS, new Pair<>(Materials.Iridium, 1), - new Pair<>(Materials.Chlorine, 3) - ); + new Pair<>(Materials.Chlorine, 3)); public static final Werkstoff PGSDResidue2 = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Metallic Sludge Dust Residue", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1183,20 +1197,27 @@ public class WerkstoffLoader { 77, TextureSet.SET_DULL, new Pair<>(Materials.Nickel, 1), - new Pair<>(Materials.Copper, 1) - ); + new Pair<>(Materials.Copper, 1)); public static final Werkstoff Rhodium = new Werkstoff( - new short[]{0xF4, 0xF4, 0xF4}, + new short[] {0xF4, 0xF4, 0xF4}, "Rhodium", "Rh", - new Werkstoff.Stats().setProtons(Element.Rh.mProtons).setMass(Element.Rh.getMass()).setBlastFurnace(true).setMeltingPoint(2237), + new Werkstoff.Stats() + .setProtons(Element.Rh.mProtons) + .setMass(Element.Rh.getMass()) + .setBlastFurnace(true) + .setMeltingPoint(2237), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems().addMolten().enforceUnification(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMetalItems() + .addMolten() + .enforceUnification(), 78, - TextureSet.SET_METALLIC - ); + TextureSet.SET_METALLIC); public static final Werkstoff CrudeRhMetall = new Werkstoff( - new short[]{0x66, 0x66, 0x66}, + new short[] {0x66, 0x66, 0x66}, "Crude Rhodium Metal", "??Rh??", new Werkstoff.Stats(), @@ -1205,28 +1226,25 @@ public class WerkstoffLoader { 79, TextureSet.SET_DULL, new Pair<>(Rhodium, 1), - new Pair<>(Materials.Stone, 1) - ); + new Pair<>(Materials.Stone, 1)); public static final Werkstoff RHSalt = new Werkstoff( - new short[]{0x84, 0x84, 0x84}, + new short[] {0x84, 0x84, 0x84}, "Rhodium Salt", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 80, - TextureSet.SET_GEM_VERTICAL - ); + TextureSet.SET_GEM_VERTICAL); public static final Werkstoff RHSaltSolution = new Werkstoff( - new short[]{0x66, 0x77, 0x88}, + new short[] {0x66, 0x77, 0x88}, "Rhodium Salt Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 81, - TextureSet.SET_FLUID - ); + TextureSet.SET_FLUID); public static final Werkstoff SodiumNitrate = new Werkstoff( - new short[]{0x84, 0x66, 0x84}, + new short[] {0x84, 0x66, 0x84}, "Sodium Nitrate", subscriptNumbers("NaNO3"), new Werkstoff.Stats(), @@ -1236,19 +1254,17 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Sodium, 1), new Pair<>(Materials.Nitrogen, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RHNitrate = new Werkstoff( - new short[]{0x77, 0x66, 0x49}, + new short[] {0x77, 0x66, 0x49}, "Rhodium Nitrate", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 83, - TextureSet.SET_QUARTZ - ); + TextureSet.SET_QUARTZ); public static final Werkstoff ZincSulfate = new Werkstoff( - new short[]{0x84, 0x66, 0x49}, + new short[] {0x84, 0x66, 0x49}, "Zinc Sulfate", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.MIXTURE, @@ -1257,70 +1273,96 @@ public class WerkstoffLoader { TextureSet.SET_QUARTZ, new Pair<>(Materials.Zinc, 1), new Pair<>(Materials.Sulfur, 1), - new Pair<>(Materials.Oxygen, 4) - ); + new Pair<>(Materials.Oxygen, 4)); public static final Werkstoff RhFilterCake = new Werkstoff( - new short[]{0x77, 0x66, 0x49}, + new short[] {0x77, 0x66, 0x49}, "Rhodium Filter Cake", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 85, - TextureSet.SET_QUARTZ - ); + TextureSet.SET_QUARTZ); public static final Werkstoff RHFilterCakeSolution = new Werkstoff( - new short[]{0x66, 0x77, 0x88}, + new short[] {0x66, 0x77, 0x88}, "Rhodium Filter Cake Solution", new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().addCells(), 86, - TextureSet.SET_FLUID - ); + TextureSet.SET_FLUID); public static final Werkstoff ReRh = new Werkstoff( - new short[]{0x77, 0x66, 0x49}, + new short[] {0x77, 0x66, 0x49}, "Reprecipitated Rhodium", subscriptNumbers("Rh2NH4"), new Werkstoff.Stats(), Werkstoff.Types.MIXTURE, new Werkstoff.GenerationFeatures().disable().onlyDust(), 87, - TextureSet.SET_QUARTZ - ); + TextureSet.SET_QUARTZ); public static final Werkstoff LuVTierMaterial = new Werkstoff( Materials.Chrome.getRGBA(), "Rhodium-Plated Palladium", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500).setMeltingVoltage(480), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(4500) + .setMeltingVoltage(480), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 88, TextureSet.SET_METALLIC, new Pair<>(Materials.Palladium, 3), - new Pair<>(WerkstoffLoader.Rhodium, 1) - ); + new Pair<>(WerkstoffLoader.Rhodium, 1)); public static final Werkstoff Tiberium = new Werkstoff( - new short[]{0x22, 0xEE, 0x22}, + new short[] {0x22, 0xEE, 0x22}, "Tiberium", "Tr", - new Werkstoff.Stats().setProtons(123).setMass(326).setBlastFurnace(true).setMeltingPoint(1800).setRadioactive(true).setToxic(true), + new Werkstoff.Stats() + .setProtons(123) + .setMass(326) + .setBlastFurnace(true) + .setMeltingPoint(1800) + .setRadioactive(true) + .setToxic(true), Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().addGems().addCraftingMetalWorkingItems().addSimpleMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .addGems() + .addCraftingMetalWorkingItems() + .addSimpleMetalWorkingItems(), 89, - TextureSet.SET_DIAMOND - ); + TextureSet.SET_DIAMOND); public static final Werkstoff Ruridit = new Werkstoff( - new short[]{0xA4, 0xA4, 0xA4}, + new short[] {0xA4, 0xA4, 0xA4}, "Ruridit", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(4500).setMeltingVoltage(480), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(4500) + .setMeltingVoltage(480), Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 90, TextureSet.SET_METALLIC, new Pair<>(WerkstoffLoader.Ruthenium, 2), - new Pair<>(Materials.Iridium, 1) - ); + new Pair<>(Materials.Iridium, 1)); public static final Werkstoff Fluorspar = new Werkstoff( - new short[]{185, 69, 251}, + new short[] {185, 69, 251}, "Fluorspar", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1328,14 +1370,25 @@ public class WerkstoffLoader { 91, TextureSet.SET_GEM_VERTICAL, new Pair<>(Materials.Calcium, 1), - new Pair<>(Materials.Fluorine, 2) - ); + new Pair<>(Materials.Fluorine, 2)); public static final Werkstoff HDCS = new Werkstoff( - new short[]{0x33, 0x44, 0x33}, + new short[] {0x33, 0x44, 0x33}, "High Durability Compound Steel", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setMeltingPoint(9000).setMeltingVoltage(7680), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setMeltingPoint(9000) + .setMeltingVoltage(7680), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMolten().addMetalItems().addMixerRecipes().addSimpleMetalWorkingItems().addCraftingMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .disable() + .onlyDust() + .addMolten() + .addMetalItems() + .addMixerRecipes() + .addSimpleMetalWorkingItems() + .addCraftingMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 92, TextureSet.SET_SHINY, new Pair<>(Materials.TungstenSteel, 12), @@ -1343,10 +1396,9 @@ public class WerkstoffLoader { new Pair<>(Materials.HSSG, 6), new Pair<>(WerkstoffLoader.Ruridit, 3), new Pair<>(WerkstoffLoader.MagnetoResonaticDust, 2), - new Pair<>(Materials.Plutonium, 1) - ); + new Pair<>(Materials.Plutonium, 1)); public static final Werkstoff Atheneite = new Werkstoff( - new short[]{175, 175, 175}, + new short[] {175, 175, 175}, "Atheneite", subscriptNumbers("(Pd,Hg)3As"), new Werkstoff.Stats().setElektrolysis(true), @@ -1356,10 +1408,9 @@ public class WerkstoffLoader { TextureSet.SET_SHINY, new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), new Pair<>(Materials.Mercury, 3), - new Pair<>(Materials.Arsenic, 1) - ); + new Pair<>(Materials.Arsenic, 1)); public static final Werkstoff Temagamite = new Werkstoff( - new short[]{245, 245, 245}, + new short[] {245, 245, 245}, "Temagamite", subscriptNumbers("Pd3HgTe"), new Werkstoff.Stats().setElektrolysis(true), @@ -1369,10 +1420,9 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(WerkstoffLoader.PDMetallicPowder, 3), new Pair<>(Materials.Mercury, 1), - new Pair<>(Materials.Tellurium, 1) - ); + new Pair<>(Materials.Tellurium, 1)); public static final Werkstoff Terlinguaite = new Werkstoff( - new short[]{245, 245, 245}, + new short[] {245, 245, 245}, "Terlinguaite", new Werkstoff.Stats().setElektrolysis(true), Werkstoff.Types.COMPOUND, @@ -1381,24 +1431,35 @@ public class WerkstoffLoader { TextureSet.SET_GEM_HORIZONTAL, new Pair<>(Materials.Mercury, 2), new Pair<>(Materials.Chlorine, 1), - new Pair<>(Materials.Oxygen, 1) - ); + new Pair<>(Materials.Oxygen, 1)); public static final Werkstoff AdemicSteel = new Werkstoff( - new short[]{0xcc, 0xcc, 0xcc}, + new short[] {0xcc, 0xcc, 0xcc}, "Ademic Steel", "The break in the line", - new Werkstoff.Stats().setCentrifuge(true).setBlastFurnace(true).setDurOverride(6144).setMeltingPoint(1800).setSpeedOverride(12).setQualityOverride((byte) 4).setMeltingVoltage(1920), + new Werkstoff.Stats() + .setCentrifuge(true) + .setBlastFurnace(true) + .setDurOverride(6144) + .setMeltingPoint(1800) + .setSpeedOverride(12) + .setQualityOverride((byte) 4) + .setMeltingVoltage(1920), Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().onlyDust().addMetalItems().addCraftingMetalWorkingItems().addMolten().addSimpleMetalWorkingItems().addMultipleIngotMetalWorkingItems(), + new Werkstoff.GenerationFeatures() + .onlyDust() + .addMetalItems() + .addCraftingMetalWorkingItems() + .addMolten() + .addSimpleMetalWorkingItems() + .addMultipleIngotMetalWorkingItems(), 96, TextureSet.SET_METALLIC, new Pair<>(Materials.Steel, 2), new Pair<>(Materials.VanadiumSteel, 1), new Pair<>(Materials.DamascusSteel, 1), - new Pair<>(Materials.Carbon, 4) - ); + new Pair<>(Materials.Carbon, 4)); public static final Werkstoff RawAdemicSteel = new Werkstoff( - new short[]{0xed, 0xed, 0xed}, + new short[] {0xed, 0xed, 0xed}, "Raw Ademic Steel", new Werkstoff.Stats().setCentrifuge(true), Werkstoff.Types.MIXTURE, @@ -1407,84 +1468,76 @@ public class WerkstoffLoader { TextureSet.SET_ROUGH, new Pair<>(Materials.Steel, 2), new Pair<>(Materials.VanadiumSteel, 1), - new Pair<>(Materials.DamascusSteel, 1) - ); + new Pair<>(Materials.DamascusSteel, 1)); public static final Werkstoff HexafluorosilicicAcid = new Werkstoff( - new short[]{0x2c, 0x70, 0xb5}, - "Hexafluorosilicic Acid", - subscriptNumbers("H2SiF6"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().addCells(), - 98, - TextureSet.SET_FLUID, - new Pair<>(Materials.Hydrogen, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Fluorine, 6) - ); + new short[] {0x2c, 0x70, 0xb5}, + "Hexafluorosilicic Acid", + subscriptNumbers("H2SiF6"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().addCells(), + 98, + TextureSet.SET_FLUID, + new Pair<>(Materials.Hydrogen, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Potassiumfluorosilicate = new Werkstoff( - new short[]{0x2e, 0x97, 0xb2}, - "Potassiumfluorosilicate", - subscriptNumbers("K2SiF6"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 99, - TextureSet.SET_SHINY, - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Silicon, 1), - new Pair<>(Materials.Fluorine, 6) - ); + new short[] {0x2e, 0x97, 0xb2}, + "Potassiumfluorosilicate", + subscriptNumbers("K2SiF6"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 99, + TextureSet.SET_SHINY, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Silicon, 1), + new Pair<>(Materials.Fluorine, 6)); public static final Werkstoff Alumina = new Werkstoff( - new short[]{0xa0, 0xad, 0xb1}, - "Alumina", - subscriptNumbers("Al2O3"), - new Werkstoff.Stats(), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 100, - TextureSet.SET_DULL - ); + new short[] {0xa0, 0xad, 0xb1}, + "Alumina", + subscriptNumbers("Al2O3"), + new Werkstoff.Stats(), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 100, + TextureSet.SET_DULL); public static final Werkstoff PotassiumCarbonate = new Werkstoff( - new short[]{0x7b, 0x96, 0x4f}, - "Potassium Carbonate", - subscriptNumbers("K2CO3"), - new Werkstoff.Stats().setElektrolysis(true), - Werkstoff.Types.COMPOUND, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 101, - TextureSet.SET_DULL, - new Pair<>(Materials.Potassium, 2), - new Pair<>(Materials.Carbon, 1), - new Pair<>(Materials.Oxygen, 3) - ); + new short[] {0x7b, 0x96, 0x4f}, + "Potassium Carbonate", + subscriptNumbers("K2CO3"), + new Werkstoff.Stats().setElektrolysis(true), + Werkstoff.Types.COMPOUND, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 101, + TextureSet.SET_DULL, + new Pair<>(Materials.Potassium, 2), + new Pair<>(Materials.Carbon, 1), + new Pair<>(Materials.Oxygen, 3)); public static final Werkstoff RawFluorophlogopite = new Werkstoff( - new short[]{0x36, 0x51, 0x0b}, - "Raw Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust(), - 102, - TextureSet.SET_DULL - ); + new short[] {0x36, 0x51, 0x0b}, + "Raw Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust(), + 102, + TextureSet.SET_DULL); public static final Werkstoff HotFluorophlogopite = new Werkstoff( - new short[]{0xbf, 0xd3, 0x55}, - "Unformed Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().addCells(), - 103, - TextureSet.SET_FLUID - ); + new short[] {0xbf, 0xd3, 0x55}, + "Unformed Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().addCells(), + 103, + TextureSet.SET_FLUID); public static final Werkstoff Fluorophlogopite = new Werkstoff( - new short[]{0xbf, 0xd3, 0x55}, - "Fluorophlogopite", - new Werkstoff.Stats(), - Werkstoff.Types.MIXTURE, - new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems(), - 104, - TextureSet.SET_SHINY - ); + new short[] {0xbf, 0xd3, 0x55}, + "Fluorophlogopite", + new Werkstoff.Stats(), + Werkstoff.Types.MIXTURE, + new Werkstoff.GenerationFeatures().disable().onlyDust().addMetalItems(), + 104, + TextureSet.SET_SHINY); public static HashMap<OrePrefixes, BW_MetaGenerated_Items> items = new HashMap<>(); public static HashBiMap<Werkstoff, Fluid> fluids = HashBiMap.create(); @@ -1514,34 +1567,31 @@ public class WerkstoffLoader { public static ItemStack getCorrespondingItemStackUnsafe(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { if (!werkstoff.getGenerationFeatures().enforceUnification) { ItemStack ret = GT_OreDictUnificator.get(orePrefixes, werkstoff.getBridgeMaterial(), amount); - if (ret != null) - return ret; + if (ret != null) return ret; ret = OreDictHandler.getItemStack(werkstoff.getVarName(), orePrefixes, amount); - if (ret != null) - return ret; + if (ret != null) return ret; } - if (orePrefixes == ore) - return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); - else if (orePrefixes == oreSmall) - return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); - else if (orePrefixes == block) - return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); + if (orePrefixes == ore) return new ItemStack(WerkstoffLoader.BWOres, amount, werkstoff.getmID()); + else if (orePrefixes == oreSmall) return new ItemStack(WerkstoffLoader.BWSmallOres, amount, werkstoff.getmID()); + else if (orePrefixes == block) return new ItemStack(WerkstoffLoader.BWBlocks, amount, werkstoff.getmID()); else if (orePrefixes == WerkstoffLoader.blockCasing) return new ItemStack(WerkstoffLoader.BWBlockCasings, amount, werkstoff.getmID()); else if (orePrefixes == WerkstoffLoader.blockCasingAdvanced) return new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, amount, werkstoff.getmID()); - else if (WerkstoffLoader.items.get(orePrefixes) == null) - return null; + else if (WerkstoffLoader.items.get(orePrefixes) == null) return null; return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } public static ItemStack getCorrespondingItemStack(OrePrefixes orePrefixes, Werkstoff werkstoff, int amount) { ItemStack stack = getCorrespondingItemStackUnsafe(orePrefixes, werkstoff, amount); - if (stack != null) - return stack; + if (stack != null) return stack; else - MainMod.LOGGER.catching(Level.ERROR, new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + - "If you are a Developer, you forgot to enable " + orePrefixes + " OrePrefix for Werkstoff " + werkstoff.getDefaultName())); + MainMod.LOGGER.catching( + Level.ERROR, + new Exception("NO SUCH ITEM! " + orePrefixes + werkstoff.getVarName() + + " If you encounter this as a user, make sure to contact the authors of the pack/the mods you're playing! " + + "If you are a Developer, you forgot to enable " + orePrefixes + + " OrePrefix for Werkstoff " + werkstoff.getDefaultName())); return new ItemStack(WerkstoffLoader.items.get(orePrefixes), amount, werkstoff.getmID()).copy(); } @@ -1553,51 +1603,52 @@ public class WerkstoffLoader { addItemsForGeneration(); runAdditionalOreDict(); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + MainMod.LOGGER.info("Making Meta Items for BW Materials took " + (timepost - timepre) + "ns/" + + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); } public static void run() { if (!registered) { MainMod.LOGGER.info("Loading Processing Recipes for BW Materials"); long timepre = System.nanoTime(); - ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); + ProgressManager.ProgressBar progressBar = + ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size() + 1); DebugLog.log("Loading Recipes" + (System.nanoTime() - timepre)); Integer[] clsArr = new Integer[0]; int size = 0; - if (LoaderReference.betterloadingscreen) - clsArr = CLSCompat.initCls(); + if (LoaderReference.betterloadingscreen) clsArr = CLSCompat.initCls(); - IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[]{ - new ToolLoader(), - new DustLoader(), - new GemLoader(), - new SimpleMetalLoader(), - new CasingLoader(), - new AspectLoader(), - new OreLoader(), - new CrushedLoader(), - new CraftingMaterialLoader(), - new CellLoader(), - new MoltenCellLoader(), - new MultipleMetalLoader(), - new MetalLoader(), - new BlockLoader() + IWerkstoffRunnable[] werkstoffRunnables = new IWerkstoffRunnable[] { + new ToolLoader(), + new DustLoader(), + new GemLoader(), + new SimpleMetalLoader(), + new CasingLoader(), + new AspectLoader(), + new OreLoader(), + new CrushedLoader(), + new CraftingMaterialLoader(), + new CellLoader(), + new MoltenCellLoader(), + new MultipleMetalLoader(), + new MetalLoader(), + new BlockLoader() }; long timepreone = 0; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { timepreone = System.nanoTime(); - DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + (System.nanoTime() - timepreone)); + DebugLog.log("Werkstoff is null or id < 0 ? " + (werkstoff == null || werkstoff.getmID() < 0) + " " + + (System.nanoTime() - timepreone)); if (werkstoff == null || werkstoff.getmID() < 0) { progressBar.step(""); continue; } - if (LoaderReference.betterloadingscreen) - size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); + if (LoaderReference.betterloadingscreen) size = CLSCompat.invokeStepSize(werkstoff, clsArr, size); DebugLog.log("Werkstoff: " + werkstoff.getDefaultName() + " " + (System.nanoTime() - timepreone)); for (IWerkstoffRunnable runnable : werkstoffRunnables) { String loaderName = runnable.getClass().getSimpleName(); - DebugLog.log( loaderName + " started " + (System.nanoTime() - timepreone)); + DebugLog.log(loaderName + " started " + (System.nanoTime() - timepreone)); runnable.run(werkstoff); DebugLog.log(loaderName + " done " + (System.nanoTime() - timepreone)); } @@ -1607,14 +1658,14 @@ public class WerkstoffLoader { DebugLog.log("Loading New Circuits" + " " + (System.nanoTime() - timepreone)); BW_CircuitsLoader.initNewCircuits(); - if (LoaderReference.betterloadingscreen) - CLSCompat.disableCls(); + if (LoaderReference.betterloadingscreen) CLSCompat.disableCls(); progressBar.step("Load Additional Recipes"); AdditionalRecipes.run(); ProgressManager.pop(progressBar); long timepost = System.nanoTime(); - MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); + MainMod.LOGGER.info("Loading Processing Recipes for BW Materials took " + (timepost - timepre) + "ns/" + + ((timepost - timepre) / 1000000) + "ms/" + ((timepost - timepre) / 1000000000) + "s!"); registered = true; } } @@ -1641,7 +1692,7 @@ public class WerkstoffLoader { WerkstoffLoader.MagnetoResonaticDust.add(WerkstoffLoader.NO_BLAST); - //Calcium Smelting block + // Calcium Smelting block Materials.Calcium.mBlastFurnaceRequired = true; Materials.Salt.mDurability = WerkstoffLoader.Salt.getDurability(); @@ -1660,7 +1711,8 @@ public class WerkstoffLoader { Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality(); for (Werkstoff W : Werkstoff.werkstoffHashSet) { - for (Pair<ISubTagContainer, Integer> pair : W.getContents().getValue().toArray(new Pair[0])) { + for (Pair<ISubTagContainer, Integer> pair : + W.getContents().getValue().toArray(new Pair[0])) { if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) { W.add(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM); @@ -1687,7 +1739,9 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(cell)) { if (!FluidRegistry.isFluidRegistered(werkstoff.getDefaultName())) { DebugLog.log("Adding new Fluid: " + werkstoff.getDefaultName()); - GT_Fluid fluid = (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()).setGaseous(werkstoff.getStats().isGas()); + GT_Fluid fluid = + (GT_Fluid) new GT_Fluid(werkstoff.getDefaultName(), "autogenerated", werkstoff.getRGBA()) + .setGaseous(werkstoff.getStats().isGas()); FluidRegistry.registerFluid(fluid); WerkstoffLoader.fluids.put(werkstoff, fluid); } else { @@ -1697,23 +1751,31 @@ public class WerkstoffLoader { if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { 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()); + Fluid fluid = new GT_Fluid( + "molten." + werkstoff.getDefaultName(), "molten.autogenerated", werkstoff.getRGBA()); if (werkstoff.getStats().getMeltingPoint() > 0) fluid = fluid.setTemperature(werkstoff.getStats().getMeltingPoint()); FluidRegistry.registerFluid(fluid); - //GT_LanguageManager.addStringLocalization("Molten." + werkstoff.getDefaultName(), "Molten "+ werkstoff.getDefaultName()); - GT_LanguageManager.addStringLocalization(fluid.getUnlocalizedName(), "Molten " + werkstoff.getDefaultName()); + // 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 (Materials.get(werkstoff.getDefaultName()) != null && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { - DebugLog.log("Found: " + (p + werkstoff.getVarName()) + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); + if (Materials.get(werkstoff.getDefaultName()) != null + && Materials.get(werkstoff.getDefaultName()).mMetaItemSubID != -1 + && (werkstoff.getGenerationFeatures().toGenerate & p.mMaterialGenerationBits) != 0 + && OreDictHandler.getItemStack(werkstoff.getDefaultName(), p, 1) != null) { + DebugLog.log("Found: " + (p + werkstoff.getVarName()) + + " in GT material system, disable and reroute my Items to that, also add a Tooltip."); werkstoff.getGenerationFeatures().setBlacklist(p); } - WerkstoffLoader.toGenerateGlobal = (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); + WerkstoffLoader.toGenerateGlobal = + (WerkstoffLoader.toGenerateGlobal | werkstoff.getGenerationFeatures().toGenerate); } DebugLog.log("GlobalGeneration: " + WerkstoffLoader.toGenerateGlobal); if ((WerkstoffLoader.toGenerateGlobal & 0b1) != 0) { @@ -1723,7 +1785,7 @@ public class WerkstoffLoader { } if ((WerkstoffLoader.toGenerateGlobal & 0b10) != 0) { WerkstoffLoader.items.put(ingot, new BW_MetaGenerated_Items(ingot)); - WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); //1750 + WerkstoffLoader.items.put(ingotHot, new BW_MetaGenerated_Items(ingotHot)); // 1750 WerkstoffLoader.items.put(nugget, new BW_MetaGenerated_Items(nugget)); } if ((WerkstoffLoader.toGenerateGlobal & 0b100) != 0) { @@ -1744,15 +1806,15 @@ public class WerkstoffLoader { } if ((WerkstoffLoader.toGenerateGlobal & 0b10000) != 0) { WerkstoffLoader.items.put(cell, new BW_MetaGenerated_Items(cell)); - //WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); - if (LoaderReference.Forestry) - WerkstoffLoader.items.put(capsule, new BW_MetaGenerated_Items(capsule)); + // WerkstoffLoader.items.put(bottle, new BW_MetaGenerated_Items(bottle)); + if (LoaderReference.Forestry) 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(WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); + WerkstoffLoader.items.put( + WerkstoffLoader.cellMolten, new BW_MetaGenerated_Items(WerkstoffLoader.cellMolten)); if (LoaderReference.Forestry) WerkstoffLoader.items.put(capsuleMolten, new BW_MetaGenerated_Items(capsuleMolten)); } @@ -1794,79 +1856,67 @@ public class WerkstoffLoader { } static void gameRegistryHandler() { - if (SideReference.Side.Client) - RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); + if (SideReference.Side.Client) RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE); GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE"); GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE"); GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE"); - GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); + GameRegistry.registerTileEntity( + BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE"); WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores"); - WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); - WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); - WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing); - WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvanced", blockCasingAdvanced); + WerkstoffLoader.BWSmallOres = + new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall"); + WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks( + Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks"); + WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing( + Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing); + WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing( + Material.iron, + BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, + "bw.werkstoffblockscasingadvanced", + blockCasingAdvanced); GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01"); GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02"); GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01"); if (!ConfigHandler.disableBoltedBlocksCasing) - GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); + GameRegistry.registerBlock( + WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01"); if (!ConfigHandler.disableReboltedBlocksCasing) - GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01"); + GameRegistry.registerBlock( + WerkstoffLoader.BWBlockCasingsAdvanced, + BW_MetaGeneratedBlock_Item.class, + "bw.werkstoffblockscasingadvanced.01"); GTMetaItemEnhancer.addAdditionalOreDictToForestry(); GTMetaItemEnhancer.init(); } private static void runGTItemDataRegistrator() { - IWerkstoffRunnable[] registrations = new IWerkstoffRunnable[] { - new BridgeMaterialsLoader(), - new AssociationLoader(), - new CasingRegistrator() - }; + IWerkstoffRunnable[] registrations = + new IWerkstoffRunnable[] {new BridgeMaterialsLoader(), new AssociationLoader(), new CasingRegistrator() + }; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) { for (IWerkstoffRunnable registration : registrations) { - registration.run(werkstoff); + registration.run(werkstoff); } } addFakeItemDataToInWorldBlocksAndCleanUpFakeData(); addVanillaCasingsToGTOreDictUnificator(); } - public static void addVanillaCasingsToGTOreDictUnificator(){ - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Aluminium, - ItemList.Casing_FrostProof.get(1L), - false - ); - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Nickel, - ItemList.Casing_HeatProof.get(1L), - false - ); - GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Lead, - ItemList.Casing_RadiationProof.get(1L), - false - ); + public static void addVanillaCasingsToGTOreDictUnificator() { GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Steel, - ItemList.Casing_SolidSteel.get(1L), - false - ); + blockCasing, Materials.Aluminium, ItemList.Casing_FrostProof.get(1L), false); + GT_OreDictUnificator.addAssociation(blockCasing, Materials.Nickel, ItemList.Casing_HeatProof.get(1L), false); + GT_OreDictUnificator.addAssociation(blockCasing, Materials.Lead, ItemList.Casing_RadiationProof.get(1L), false); + GT_OreDictUnificator.addAssociation(blockCasing, Materials.Steel, ItemList.Casing_SolidSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, Materials.TungstenSteel, - ItemList.Casing_RobustTungstenSteel.get(1L), - false - ); + blockCasing, Materials.TungstenSteel, ItemList.Casing_RobustTungstenSteel.get(1L), false); GT_OreDictUnificator.addAssociation( - blockCasing, Materials.Polytetrafluoroethylene, - ItemList.Casing_Chemically_Inert.get(1L), - false - ); + blockCasing, Materials.Polytetrafluoroethylene, ItemList.Casing_Chemically_Inert.get(1L), false); } /** @@ -1886,8 +1936,7 @@ public class WerkstoffLoader { e.printStackTrace(); } - if (MATERIALS_MAP == null) - throw new NullPointerException("MATERIALS_MAP null!"); + if (MATERIALS_MAP == null) throw new NullPointerException("MATERIALS_MAP null!"); Materials oreMat = new Materials(-1, null, 0, 0, 0, false, "bwores", "bwores", null, true, null); Materials smallOreMat = new Materials(-1, null, 0, 0, 0, false, "bwsmallores", "bwsmallores", null, true, null); @@ -1907,14 +1956,14 @@ public class WerkstoffLoader { public static void removeIC2Recipes() { try { Set<Map.Entry<IRecipeInput, RecipeOutput>> remset = new HashSet<>(); - for (Map.Entry<IRecipeInput, RecipeOutput> curr : Recipes.macerator.getRecipes().entrySet()) { + for (Map.Entry<IRecipeInput, RecipeOutput> curr : + Recipes.macerator.getRecipes().entrySet()) { if (curr.getKey() instanceof RecipeInputOreDict) { if (((RecipeInputOreDict) curr.getKey()).input.equalsIgnoreCase("oreNULL")) { remset.add(curr); } for (ItemStack stack : curr.getValue().items) { - if (stack.getItem() instanceof BW_MetaGenerated_Items) - remset.add(curr); + if (stack.getItem() instanceof BW_MetaGenerated_Items) remset.add(curr); } } } @@ -1930,22 +1979,29 @@ public class WerkstoffLoader { GT_OreDictUnificator.registerOre(ore + werkstoff.getVarName(), werkstoff.get(ore)); GT_OreDictUnificator.registerOre(oreSmall + werkstoff.getVarName(), werkstoff.get(oreSmall)); werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(ore + e, werkstoff.get(ore))); - werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); + werkstoff + .getADDITIONAL_OREDICT() + .forEach(e -> OreDictionary.registerOre(oreSmall + e, werkstoff.get(oreSmall))); } if (werkstoff.hasItemType(gem)) - OreDictionary.registerOre("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""), werkstoff.get(lens)); + OreDictionary.registerOre( + "craftingLens" + + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()) + .mName + .replace(" ", ""), + werkstoff.get(lens)); if (werkstoff.hasItemType(gem) || werkstoff.hasItemType(ingot)) { GT_OreDictUnificator.registerOre(block + werkstoff.getVarName(), werkstoff.get(block)); - werkstoff.getADDITIONAL_OREDICT().forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); + werkstoff + .getADDITIONAL_OREDICT() + .forEach(e -> OreDictionary.registerOre(block + e, werkstoff.get(block))); } - werkstoff.getADDITIONAL_OREDICT() - .forEach(s -> ENABLED_ORE_PREFIXES - .stream() - .filter(o -> Objects.nonNull(werkstoff.get(o))) - .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); + werkstoff.getADDITIONAL_OREDICT().forEach(s -> ENABLED_ORE_PREFIXES.stream() + .filter(o -> Objects.nonNull(werkstoff.get(o))) + .forEach(od -> OreDictionary.registerOre(od + s, werkstoff.get(od)))); } GT_OreDictUnificator.registerOre("craftingIndustrialDiamond", WerkstoffLoader.CubicZirconia.get(gemExquisite)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index 7ab619a92f..149bd67629 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 @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.CLEANROOM; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; @@ -41,56 +44,52 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; import ic2.core.item.ItemFluidCell; +import java.lang.reflect.Field; +import java.util.Map; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.reflect.FieldUtils; -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 { - private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)); - private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance.getMappingsFor((byte) 1)); + private static BWRecipes.BW_Recipe_Map_LiquidFuel sAcidGenFuels = + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)); + private static BWRecipes.BacteriaVatRecipeMap sBacteriaVat = + ((BWRecipes.BacteriaVatRecipeMap) BWRecipes.instance.getMappingsFor((byte) 1)); private static GT_Recipe.GT_Recipe_Map sBiolab = BWRecipes.instance.getMappingsFor((byte) 0); - private static void runBWRecipes(){ + private static void runBWRecipes() { if (ConfigHandler.BioLab) { - FluidStack[] dnaFluid = {LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 1000) : Materials.Biomass.getFluid(1000L)}; + FluidStack[] dnaFluid = { + LoaderReference.gendustry + ? FluidRegistry.getFluidStack("liquiddna", 1000) + : Materials.Biomass.getFluid(1000L) + }; for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData DNA = + BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); if (DNA != null) { ItemStack Detergent = BioItemList.getOther(1); ItemStack DNAFlask = BioItemList.getDNASampleFlask(null); ItemStack EthanolCell = Materials.Ethanol.getCells(1); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - DNAFlask, - Detergent, - EthanolCell - }, - new ItemStack[]{ - BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), - GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) + sBiolab.addFakeRecipe( + false, + new ItemStack[] {stack, DNAFlask, Detergent, EthanolCell}, + new ItemStack[] { + BioItemList.getDNASampleFlask(BioDNA.convertDataToDNA(DNA)), + GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Empty, 1L) }, BioItemList.mBioLabParts[0], - new int[]{DNA.getChance(), 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, + new int[] {DNA.getChance(), 10000}, + new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, null, 500, BW_Util.getMachineVoltageFromTier(3 + DNA.getTier()), - BW_Util.STANDART - ); + BW_Util.STANDART); } } @@ -102,25 +101,22 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); Behaviour_DataOrb.setDataName(Outp, DNA.getName()); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - stack, - FluidLoader.BioLabFluidCells[0], - FluidLoader.BioLabFluidCells[3], - ItemList.Tool_DataOrb.get(1L) - }, - new ItemStack[]{ - Outp, - ItemList.Cell_Universal_Fluid.get(2L) + sBiolab.addFakeRecipe( + false, + new ItemStack[] { + stack, + FluidLoader.BioLabFluidCells[0], + FluidLoader.BioLabFluidCells[3], + ItemList.Tool_DataOrb.get(1L) }, + new ItemStack[] {Outp, ItemList.Cell_Universal_Fluid.get(2L)}, BioItemList.mBioLabParts[1], - new int[]{DNA.getChance(), 10000}, + new int[] {DNA.getChance(), 10000}, dnaFluid, null, 500, BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); + BW_Util.STANDART); } } @@ -135,130 +131,117 @@ public class AdditionalRecipes { Behaviour_DataOrb.setDataTitle(inp2, "DNA Sample"); Behaviour_DataOrb.setDataName(inp2, BioCultureLoader.BIO_DATA_BETA_LACMATASE.getName()); - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - FluidLoader.BioLabFluidCells[1], - BioItemList.getPlasmidCell(null), - inp, - inp2 - }, - new ItemStack[]{ - stack, - ItemList.Cell_Universal_Fluid.get(1L) + sBiolab.addFakeRecipe( + false, + new ItemStack[] { + FluidLoader.BioLabFluidCells[1], BioItemList.getPlasmidCell(null), inp, inp2 }, + new ItemStack[] {stack, ItemList.Cell_Universal_Fluid.get(1L)}, BioItemList.mBioLabParts[2], - new int[]{DNA.getChance(), 10000}, + new int[] {DNA.getChance(), 10000}, dnaFluid, null, 500, BW_Util.getMachineVoltageFromTier(4 + DNA.getTier()), - BW_Util.STANDART - ); + BW_Util.STANDART); } } for (ItemStack stack : BioItemList.getAllPetriDishes()) { - BioData DNA = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); - BioData Plasmid = BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); + BioData DNA = + BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("DNA")); + BioData Plasmid = + BioData.getBioDataFromNBTTag(stack.getTagCompound().getCompoundTag("Plasmid")); if (DNA.getName() != Plasmid.getName()) { - sBiolab.addFakeRecipe(true, - new ItemStack[]{ - BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), - BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), - FluidLoader.BioLabFluidCells[2], - }, - new ItemStack[]{ - stack, - ItemList.Cell_Universal_Fluid.get(1L) - }, - BioItemList.mBioLabParts[3], - new int[]{10000, 10000}, - new FluidStack[]{ - FluidRegistry.getFluidStack("ic2distilledwater", 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); + sBiolab.addFakeRecipe( + true, + new ItemStack[] { + BioItemList.getPetriDish(BioCulture.getBioCulture(DNA.getName())), + BioItemList.getPlasmidCell(BioPlasmid.convertDataToPlasmid(Plasmid)), + FluidLoader.BioLabFluidCells[2], + }, + new ItemStack[] {stack, ItemList.Cell_Universal_Fluid.get(1L)}, + BioItemList.mBioLabParts[3], + new int[] {10000, 10000}, + new FluidStack[] {FluidRegistry.getFluidStack("ic2distilledwater", 1000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(6), + BW_Util.STANDART); } } - ItemStack Outp = ItemList.Tool_DataOrb.get(1L); Behaviour_DataOrb.setDataTitle(Outp, "DNA Sample"); Behaviour_DataOrb.setDataName(Outp, "Any DNA"); - //Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data - sBiolab.addFakeRecipe(false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - BioItemList.getOther(4), - ItemList.Circuit_Chip_Stemcell.get(2L), - Outp + // Clonal Cellular Synthesis- [Liquid DNA] + Medium Petri Dish + Plasma Membrane + Stem Cells + Genome Data + sBiolab.addFakeRecipe( + false, + new ItemStack[] { + BioItemList.getPetriDish(null), + BioItemList.getOther(4), + ItemList.Circuit_Chip_Stemcell.get(2L), + Outp }, - new ItemStack[]{ - BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), + new ItemStack[] { + BioItemList.getPetriDish(null).setStackDisplayName("The Culture made from DNA"), }, BioItemList.mBioLabParts[4], - new int[]{7500, 10000}, - new FluidStack[]{new FluidStack(dnaFluid[0].getFluid(), 9000)}, + new int[] {7500, 10000}, + new FluidStack[] {new FluidStack(dnaFluid[0].getFluid(), 9000)}, null, 500, BW_Util.getMachineVoltageFromTier(6), - BW_Util.STANDART - ); + BW_Util.STANDART); - FluidStack[] easyFluids = {Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000)}; + FluidStack[] easyFluids = { + Materials.Water.getFluid(1000L), FluidRegistry.getFluidStack("ic2distilledwater", 1000) + }; for (FluidStack fluidStack : easyFluids) { for (BioCulture bioCulture : BioCulture.BIO_CULTURE_ARRAY_LIST) { if (bioCulture.isBreedable() && bioCulture.getTier() == 0) { sBacteriaVat.addRecipe( - //boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue + // boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, + // int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, + // int aEUt, int aSpecialValue new BWRecipes.BacteriaVatRecipe( true, - new ItemStack[]{ - GT_Utility.getIntegratedCircuit(0), - new ItemStack(Items.sugar, 64) + new ItemStack[] { + GT_Utility.getIntegratedCircuit(0), new ItemStack(Items.sugar, 64) }, null, BioItemList.getPetriDish(bioCulture), null, - new FluidStack[]{ - fluidStack - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 10) - }, + new FluidStack[] {fluidStack}, + new FluidStack[] {new FluidStack(bioCulture.getFluid(), 10)}, 1000, BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - ), true - ); - //aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue - sBiolab.addRecipe( - new BWRecipes.DynamicGTRecipe( - false, - new ItemStack[]{ - BioItemList.getPetriDish(null), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Water.getCells(1) : ItemFluidCell.getUniversalFluidCell(FluidRegistry.getFluidStack("ic2distilledwater", 1000)) - }, - new ItemStack[]{ - BioItemList.getPetriDish(bioCulture), - fluidStack.equals(Materials.Water.getFluid(1000L)) ? Materials.Empty.getCells(1) : ItemList.Cell_Universal_Fluid.get(1L) - }, - null, - new int[]{ - bioCulture.getChance(), - 10000 - }, - new FluidStack[]{ - new FluidStack(bioCulture.getFluid(), 1000) - }, - null, - 500, - BW_Util.getMachineVoltageFromTier(3), - BW_Util.STANDART - )); + BW_Util.STANDART), + true); + // aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, + // aDuration, aEUt, aSpecialValue + sBiolab.addRecipe(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BioItemList.getPetriDish(null), + fluidStack.equals(Materials.Water.getFluid(1000L)) + ? Materials.Water.getCells(1) + : ItemFluidCell.getUniversalFluidCell( + FluidRegistry.getFluidStack("ic2distilledwater", 1000)) + }, + new ItemStack[] { + BioItemList.getPetriDish(bioCulture), + fluidStack.equals(Materials.Water.getFluid(1000L)) + ? Materials.Empty.getCells(1) + : ItemList.Cell_Universal_Fluid.get(1L) + }, + null, + new int[] {bioCulture.getChance(), 10000}, + new FluidStack[] {new FluidStack(bioCulture.getFluid(), 1000)}, + null, + 500, + BW_Util.getMachineVoltageFromTier(3), + BW_Util.STANDART)); } } } @@ -280,129 +263,340 @@ public class AdditionalRecipes { @SuppressWarnings("deprecation") public static void run() { runBWRecipes(); - GT_Values.RA.addImplosionRecipe(WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null); - ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)).addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); - //Thorium/Yttrium Glas - GT_Values.RA.addBlastRecipe(WerkstoffLoader.YttriumOxide.get(dustSmall, 2), WerkstoffLoader.Thorianit.get(dustSmall, 2), Materials.Glass.getMolten(144), null, new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), null, 800, BW_Util.getMachineVoltageFromTier(5), 3663); - //Thorianit recipes - GT_Values.RA.addSifterRecipe(WerkstoffLoader.Thorianit.get(crushedPurified), - new ItemStack[]{ - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - WerkstoffLoader.Thorianit.get(dust), - Materials.Thorium.getDust(1), - Materials.Thorium.getDust(1), - WerkstoffLoader.Thorium232.get(dust), - }, new int[]{7000, 1300, 700, 600, 300, 100}, + GT_Values.RA.addImplosionRecipe( + WerkstoffLoader.RawAdemicSteel.get(dust), 4, WerkstoffLoader.AdemicSteel.get(dust), null); + ((BWRecipes.BW_Recipe_Map_LiquidFuel) BWRecipes.instance.getMappingsFor((byte) 2)) + .addLiquidFuel(WerkstoffLoader.FormicAcid.getBridgeMaterial(), 40); + // Thorium/Yttrium Glas + GT_Values.RA.addBlastRecipe( + WerkstoffLoader.YttriumOxide.get(dustSmall, 2), + WerkstoffLoader.Thorianit.get(dustSmall, 2), + Materials.Glass.getMolten(144), + null, + new ItemStack(ItemRegistry.bw_glasses[0], 1, 12), + null, + 800, + BW_Util.getMachineVoltageFromTier(5), + 3663); + // Thorianit recipes + GT_Values.RA.addSifterRecipe( + WerkstoffLoader.Thorianit.get(crushedPurified), + new ItemStack[] { + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + WerkstoffLoader.Thorianit.get(dust), + Materials.Thorium.getDust(1), + Materials.Thorium.getDust(1), + WerkstoffLoader.Thorium232.get(dust), + }, + new int[] {7000, 1300, 700, 600, 300, 100}, 400, - BW_Util.getMachineVoltageFromTier(5) - ); - //3ThO2 + 4Al = 3Th + 2Al2O3 - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust, 9), Materials.Aluminium.getDust(4), null, null, Materials.Thorium.getDust(3), Materials.Aluminiumoxide.getDust(10), 1000); - //ThO2 + 2Mg = Th + 2MgO - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(dust, 3), Materials.Magnesium.getDust(2), null, null, Materials.Thorium.getDust(1), Materials.Magnesia.getDust(4), 1000); - GT_Values.RA.addChemicalRecipe(WerkstoffLoader.Thorianit.get(crushed), ItemList.Crop_Drop_Thorium.get(9), Materials.Water.getFluid(1000), Materials.Thorium.getMolten(144), WerkstoffLoader.Thorianit.get(crushedPurified, 4), 96, 24); + BW_Util.getMachineVoltageFromTier(5)); + // 3ThO2 + 4Al = 3Th + 2Al2O3 + GT_Values.RA.addChemicalRecipe( + WerkstoffLoader.Thorianit.get(dust, 9), + Materials.Aluminium.getDust(4), + null, + null, + Materials.Thorium.getDust(3), + Materials.Aluminiumoxide.getDust(10), + 1000); + // ThO2 + 2Mg = Th + 2MgO + GT_Values.RA.addChemicalRecipe( + WerkstoffLoader.Thorianit.get(dust, 3), + Materials.Magnesium.getDust(2), + null, + null, + Materials.Thorium.getDust(1), + Materials.Magnesia.getDust(4), + 1000); + GT_Values.RA.addChemicalRecipe( + WerkstoffLoader.Thorianit.get(crushed), + ItemList.Crop_Drop_Thorium.get(9), + Materials.Water.getFluid(1000), + Materials.Thorium.getMolten(144), + WerkstoffLoader.Thorianit.get(crushedPurified, 4), + 96, + 24); - //Prasiolite - GT_Values.RA.addBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), GT_Values.NF, GT_Values.NF, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800, BW_Util.getMachineVoltageFromTier(2), 500); - GT_Values.RA.addPrimitiveBlastRecipe(GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), Materials.Amethyst.getDust(10), 6, WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), GT_Values.NI, 800); - //Cubic Circonia - //2Y + 3O = Y2O3 - GT_Values.RA.addChemicalRecipe(Materials.Yttrium.getDust(2), GT_Utility.getIntegratedCircuit(5), Materials.Oxygen.getGas(3000), GT_Values.NF, WerkstoffLoader.YttriumOxide.get(dust, 5), 4096, BW_Util.getMachineVoltageFromTier(1)); - //Zr + 2O =Y22O3= ZrO2 - 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, 57600, BW_Util.getMachineVoltageFromTier(3), 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(48), Materials.Beryllium.getMolten(48), WerkstoffLoader.Californium.getMolten(48), 240, 49152, 480000000); - GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(32), WerkstoffLoader.Calcium.getMolten(144), WerkstoffLoader.Oganesson.getFluidOrGas(144), 420, 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), WerkstoffLoader.Xenon.getFluidOrGas(9)}, 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)); + // Prasiolite + GT_Values.RA.addBlastRecipe( + GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), + Materials.Amethyst.getDust(10), + GT_Values.NF, + GT_Values.NF, + WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), + GT_Values.NI, + 800, + BW_Util.getMachineVoltageFromTier(2), + 500); + GT_Values.RA.addPrimitiveBlastRecipe( + GT_OreDictUnificator.get(dust, Materials.Quartzite, 40L), + Materials.Amethyst.getDust(10), + 6, + WerkstoffLoader.Prasiolite.get(OrePrefixes.gemFlawed, 20), + GT_Values.NI, + 800); + // Cubic Circonia + // 2Y + 3O = Y2O3 + GT_Values.RA.addChemicalRecipe( + Materials.Yttrium.getDust(2), + GT_Utility.getIntegratedCircuit(5), + Materials.Oxygen.getGas(3000), + GT_Values.NF, + WerkstoffLoader.YttriumOxide.get(dust, 5), + 4096, + BW_Util.getMachineVoltageFromTier(1)); + // Zr + 2O =Y22O3= ZrO2 + 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, + 57600, + BW_Util.getMachineVoltageFromTier(3), + 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(48), + Materials.Beryllium.getMolten(48), + WerkstoffLoader.Californium.getMolten(48), + 240, + 49152, + 480000000); + GT_Values.RA.addFusionReactorRecipe( + WerkstoffLoader.Californium.getMolten(32), + WerkstoffLoader.Calcium.getMolten(144), + WerkstoffLoader.Oganesson.getFluidOrGas(144), + 420, + 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), + WerkstoffLoader.Xenon.getFluidOrGas(9) + }, + 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)); - //Milk - //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1), GT_Values.NI, Materials.Milk.getFluid(10000), Materials.Water.getFluid(8832), Materials.Sugar.getDustSmall(21), Materials.Calcium.getDustTiny(1), Materials.Magnesium.getDustTiny(1), Materials.Potassium.getDustTiny(1), Materials.Sodium.getDustTiny(4), Materials.Phosphor.getDustTiny(1), new int[]{10000, 10000, 1000, 10000, 1000, 1000}, 50, 120); + // Milk + // GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), + // Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); + GT_Values.RA.addCentrifugeRecipe( + GT_Utility.getIntegratedCircuit(1), + GT_Values.NI, + Materials.Milk.getFluid(10000), + Materials.Water.getFluid(8832), + Materials.Sugar.getDustSmall(21), + Materials.Calcium.getDustTiny(1), + Materials.Magnesium.getDustTiny(1), + Materials.Potassium.getDustTiny(1), + Materials.Sodium.getDustTiny(4), + Materials.Phosphor.getDustTiny(1), + new int[] {10000, 10000, 1000, 10000, 1000, 1000}, + 50, + 120); - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gem), - ItemList.NandChip.get(1), - ItemList.Circuit_Parts_DiodeSMD.get(4), - ItemList.Circuit_Parts_CapacitorSMD.get(4), - ItemList.Circuit_Parts_TransistorSMD.get(4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(4) - }, null, null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten(36) - }, null, 750, BW_Util.getMachineVoltageFromTier(1), CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gem), + ItemList.NandChip.get(1), + ItemList.Circuit_Parts_DiodeSMD.get(4), + ItemList.Circuit_Parts_CapacitorSMD.get(4), + ItemList.Circuit_Parts_TransistorSMD.get(4) + }, + new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(4)}, + null, + null, + new FluidStack[] {Materials.SolderingAlloy.getMolten(36)}, + null, + 750, + BW_Util.getMachineVoltageFromTier(1), + CLEANROOM)); for (int i = 1; i <= 6; 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)); + 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)); } for (int i = 7; i <= 10; i++) { - GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( - new BWRecipes.DynamicGTRecipe(false, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(3), - WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), - ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), - ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) - }, - new ItemStack[]{ - BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4) - }, null, null, - new FluidStack[]{ - Materials.SolderingAlloy.getMolten((i + 1) * 144) - }, null, (i + 1) * 1500, BW_Util.getMachineVoltageFromTier(i + 1), CLEANROOM)); + GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add(new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] { + BW_Meta_Items.getNEWCIRCUITS().getStack(3), + WerkstoffLoader.MagnetoResonaticDust.get(gemExquisite, (1)), + BW_Meta_Items.getNEWCIRCUITS().getStack(i + 3), + ItemList.Circuit_Parts_DiodeSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_CapacitorSMD.get((i + 6) * 4), + ItemList.Circuit_Parts_TransistorSMD.get((i + 6) * 4) + }, + new ItemStack[] {BW_Meta_Items.getNEWCIRCUITS().getStack(i + 4)}, + null, + null, + new FluidStack[] {Materials.SolderingAlloy.getMolten((i + 1) * 144)}, + null, + (i + 1) * 1500, + BW_Util.getMachineVoltageFromTier(i + 1), + CLEANROOM)); } - GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(bolt)}, new ItemStack[]{}, null, null, null, 0, 0, 12500); - GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); + GT_Recipe.GT_Recipe_Map.sSmallNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(bolt)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 12500); + GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stick)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 62500); try { Class<GT_Recipe.GT_Recipe_Map> map = GT_Recipe.GT_Recipe_Map.class; - GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null); - GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null); - sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); - sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - } catch (NullPointerException | IllegalAccessException ignored) {} + GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) + FieldUtils.getField(map, "sHugeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) + FieldUtils.getField(map, "sExtremeNaquadahReactorFuels").get(null); + GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) + FieldUtils.getField(map, "sUltraHugeNaquadahReactorFuels").get(null); + sHugeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stickLong)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); + sExtremeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stick)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 31250); + sUltraHugeNaquadahReactorFuels.addRecipe( + true, + new ItemStack[] {WerkstoffLoader.Tiberium.get(stickLong)}, + new ItemStack[] {}, + null, + null, + null, + 0, + 0, + 125000); + } catch (NullPointerException | IllegalAccessException ignored) { + } LoadItemContainers.run(); - GT_Values.RA.addCannerRecipe(ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), WerkstoffLoader.Tiberium.get(dust, 3), BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), null, 30, 16); - GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), 100, 400); - GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 150, 400); - GT_Values.RA.addAssemblerRecipe(BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), 100, 400); + GT_Values.RA.addCannerRecipe( + ItemList.Large_Fluid_Cell_TungstenSteel.get(1L), + WerkstoffLoader.Tiberium.get(dust, 3), + BW_NonMeta_MaterialItems.TiberiumCell_1.get(1L), + null, + 30, + 16); + GT_Values.RA.addAssemblerRecipe( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(2L), + GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), + BW_NonMeta_MaterialItems.TiberiumCell_2.get(1L), + 100, + 400); + GT_Values.RA.addAssemblerRecipe( + BW_NonMeta_MaterialItems.TiberiumCell_1.get(4L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 6L), + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), + 150, + 400); + GT_Values.RA.addAssemblerRecipe( + BW_NonMeta_MaterialItems.TiberiumCell_2.get(2L), + GT_OreDictUnificator.get(stick, Materials.TungstenSteel, 4L), + BW_NonMeta_MaterialItems.TiberiumCell_4.get(1L), + 100, + 400); GT_Values.RA.addAssemblerRecipe( - new ItemStack[]{ItemList.NaquadahCell_1.get(32L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), - WerkstoffLoader.Tiberium.get(dust, 64), - WerkstoffLoader.Tiberium.get(dust, 64) - }, null, BW_NonMeta_MaterialItems.TheCoreCell.get(1L), 100, BW_Util.getMachineVoltageFromTier(6)); + new ItemStack[] { + ItemList.NaquadahCell_1.get(32L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 64L), + WerkstoffLoader.Tiberium.get(dust, 64), + WerkstoffLoader.Tiberium.get(dust, 64) + }, + null, + BW_NonMeta_MaterialItems.TheCoreCell.get(1L), + 100, + BW_Util.getMachineVoltageFromTier(6)); GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); @@ -410,14 +604,23 @@ public class AdditionalRecipes { @SuppressWarnings("unchecked") private static void oldGThelperMethod() { - //manual override for older GT + // 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 = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : - new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : new Materials( + -1, + werkstoff.getTexSet(), + 0, + 0, + 0, + false, + werkstoff.getDefaultName(), + werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); aElementSet = true; @@ -425,8 +628,7 @@ public class AdditionalRecipes { break; } } - if (!aElementSet) - return; + if (!aElementSet) return; GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); try { @@ -440,7 +642,31 @@ public class AdditionalRecipes { 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.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, 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), 30, 0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {werkstoff.get(cell)}, + new ItemStack[] {scannerOutput}, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); + GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe( + false, + 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), + 30, + 0)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index a162f4ed45..f1ac227c5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; +import static gregtech.api.enums.OrePrefixes.dust; +import static gregtech.api.enums.OrePrefixes.dustSmall; + import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import gregtech.api.enums.GT_Values; @@ -29,49 +32,70 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; -import static gregtech.api.enums.OrePrefixes.dust; -import static gregtech.api.enums.OrePrefixes.dustSmall; - public class AfterLuVTierEnhacement { - private AfterLuVTierEnhacement(){} + private AfterLuVTierEnhacement() {} public static void run() { - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(1), + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(1), WerkstoffLoader.Zirconium.get(dust), WerkstoffLoader.Zirconium.get(dust), - WerkstoffLoader.Tiberium.get(dustSmall,2), - WerkstoffLoader.Zirconium.get(dust,2), + WerkstoffLoader.Tiberium.get(dustSmall, 2), + WerkstoffLoader.Zirconium.get(dust, 2), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 8L), GT_OreDictUnificator.get(dust, Materials.Platinum, 1L), - new int[]{10_000,5_000,5_000,2_500,10_000,10_000},250,2000); + new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + 250, + 2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(2), - WerkstoffLoader.Zirconium.get(dust,2), - WerkstoffLoader.Zirconium.get(dust,2), + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(2), + WerkstoffLoader.Zirconium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 2), WerkstoffLoader.Tiberium.get(dust), - WerkstoffLoader.Zirconium.get(dust,4), + WerkstoffLoader.Zirconium.get(dust, 4), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 18L), GT_OreDictUnificator.get(dust, Materials.Platinum, 2L), - new int[]{10_000,5_000,5_000,2_500,10_000,10_000},500,2000); + new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + 500, + 2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), null,null,WerkstoffLoader.Xenon.getFluidOrGas(4), - WerkstoffLoader.Zirconium.get(dust,4), - WerkstoffLoader.Zirconium.get(dust,4), - WerkstoffLoader.Tiberium.get(dust,2), - WerkstoffLoader.Zirconium.get(dust,8), + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + null, + null, + WerkstoffLoader.Xenon.getFluidOrGas(4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Zirconium.get(dust, 4), + WerkstoffLoader.Tiberium.get(dust, 2), + WerkstoffLoader.Zirconium.get(dust, 8), GT_OreDictUnificator.get(dust, Materials.TungstenSteel, 38L), GT_OreDictUnificator.get(dust, Materials.Platinum, 4L), - new int[]{10_000,5_000,5_000,2_500,10_000,10_000},1000,2000); + new int[] {10_000, 5_000, 5_000, 2_500, 10_000, 10_000}, + 1000, + 2000); - GT_Values.RA.addCentrifugeRecipe(BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), null,null,null, + GT_Values.RA.addCentrifugeRecipe( + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + null, + null, + null, ItemList.Depleted_Naquadah_4.get(8), - WerkstoffLoader.Zirconium.get(dust,64), - WerkstoffLoader.Zirconium.get(dust,64), + WerkstoffLoader.Zirconium.get(dust, 64), + WerkstoffLoader.Zirconium.get(dust, 64), null, null, null, - new int[]{10_000,5_000,5_000},2000,8000); + new int[] {10_000, 5_000, 5_000}, + 2000, + 8000); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index c6768aad7b..54bd8d3942 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.system.material.processingLoaders; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.StreamUtils; import gregtech.api.util.GT_Recipe; - import java.util.HashSet; import java.util.Objects; import java.util.Set; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index c008588477..a613708f29 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -29,13 +29,53 @@ import gregtech.common.items.GT_DepletetCell_Item; public class LoadItemContainers { public static void run() { - BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set(new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set(new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set(new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); - BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item("Tiberiumcell", "Fuel Rod (Tiberium)", 1, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), false)); - BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item("Double_Tiberiumcell", "Dual Fuel Rod (Tiberium)", 2, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), false)); - BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item("Quad_Tiberiumcell", "Quad Fuel Rod (Tiberium)", 4, 50000, 2F, 1, 0.5F, BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), false)); - BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set(new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); - BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item("Core_Reactor_Cell", "\"The Core\" Cell", 32, 100000, 8F, 32, 1F, BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), false)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.set( + new GT_DepletetCell_Item("TiberiumcellDep", "Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.set( + new GT_DepletetCell_Item("Double_TiberiumcellDep", "Dual Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.set( + new GT_DepletetCell_Item("Quad_TiberiumcellDep", "Quad Fuel Rod (Depleted Tiberium)", 1)); + BW_NonMeta_MaterialItems.TiberiumCell_1.set(new GT_RadioactiveCellIC_Item( + "Tiberiumcell", + "Fuel Rod (Tiberium)", + 1, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_1.get(1), + false)); + BW_NonMeta_MaterialItems.TiberiumCell_2.set(new GT_RadioactiveCellIC_Item( + "Double_Tiberiumcell", + "Dual Fuel Rod (Tiberium)", + 2, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_2.get(1), + false)); + BW_NonMeta_MaterialItems.TiberiumCell_4.set(new GT_RadioactiveCellIC_Item( + "Quad_Tiberiumcell", + "Quad Fuel Rod (Tiberium)", + 4, + 50000, + 2F, + 1, + 0.5F, + BW_NonMeta_MaterialItems.Depleted_Tiberium_4.get(1), + false)); + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.set( + new GT_DepletetCell_Item("Core_Reactor_CellDep", "Depleted \"The Core\" Cell", 32)); + BW_NonMeta_MaterialItems.TheCoreCell.set(new GT_RadioactiveCellIC_Item( + "Core_Reactor_Cell", + "\"The Core\" Cell", + 32, + 100000, + 8F, + 32, + 1F, + BW_NonMeta_MaterialItems.Depleted_TheCoreCell.get(1), + false)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java index ae7f85ed68..6e68abc432 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/IWerkstoffRunnable.java @@ -26,4 +26,4 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public interface IWerkstoffRunnable { void run(Werkstoff werkstoff); -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java index 822706fb77..7b1d649b50 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/AspectLoader.java @@ -31,31 +31,32 @@ import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TC_Aspects; - import java.util.Objects; public class AspectLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!LoaderReference.Thaumcraft) - return; + if (!LoaderReference.Thaumcraft) return; for (OrePrefixes enabledOrePrefixes : WerkstoffLoader.ENABLED_ORE_PREFIXES) { if (werkstoff.hasItemType(enabledOrePrefixes)) { if (enabledOrePrefixes.mMaterialAmount >= 3628800L || enabledOrePrefixes == OrePrefixes.ore) { - DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + enabledOrePrefixes.mMaterialAmount / 3628800L); + DebugLog.log("OrePrefix: " + enabledOrePrefixes.name() + " mMaterialAmount: " + + enabledOrePrefixes.mMaterialAmount / 3628800L); if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) ThaumcraftHandler.AspectAdder.addAspectViaBW( werkstoff.get(enabledOrePrefixes), - werkstoff.getTCAspects(enabledOrePrefixes == OrePrefixes.ore ? 1 : - (int) (enabledOrePrefixes.mMaterialAmount / 3628800L)) - ); + werkstoff.getTCAspects( + enabledOrePrefixes == OrePrefixes.ore + ? 1 + : (int) (enabledOrePrefixes.mMaterialAmount / 3628800L))); } else if (enabledOrePrefixes.mMaterialAmount >= 0L) { if (Objects.nonNull(WerkstoffLoader.items.get(enabledOrePrefixes))) //noinspection unchecked - ThaumcraftHandler.AspectAdder.addAspectViaBW(werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); + ThaumcraftHandler.AspectAdder.addAspectViaBW( + werkstoff.get(enabledOrePrefixes), new Pair<>(TC_Aspects.PERDITIO.mAspect, 1)); } } } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java index 369423817f..9d3cbc4b96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/BlockLoader.java @@ -22,27 +22,32 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class BlockLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(block)) - return; + if (!werkstoff.hasItemType(block)) return; if (werkstoff.hasItemType(ingot)) { - GT_Values.RA.addArcFurnaceRecipe(werkstoff.get(block), new ItemStack[]{werkstoff.get(ingot, 9)}, null, 16, 90, false); + GT_Values.RA.addArcFurnaceRecipe( + werkstoff.get(block), new ItemStack[] {werkstoff.get(ingot, 9)}, null, 16, 90, false); } if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(block), null, werkstoff.getMolten(1296), 0, 288, 8); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addCutterRecipe(werkstoff.get(block), werkstoff.get(plate, 9), null, (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), 30); + GT_Values.RA.addCutterRecipe( + werkstoff.get(block), + werkstoff.get(plate, 9), + null, + (int) Math.max(werkstoff.getStats().getMass() * 10L, 1L), + 30); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java index a1db413dca..d774ff166d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CasingLoader.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.BW_GT_MaterialReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -30,59 +34,52 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import net.minecraft.item.ItemStack; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; -import static gregtech.api.enums.OrePrefixes.*; - public class CasingLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff == BW_GT_MaterialReference.Wood /*|| werkstoff == BW_GT_MaterialReference.WoodSealed*/) { addCasingRecipes(werkstoff, plank); } else { - if (! - ( - werkstoff.hasGenerationFeature(blockCasing) && - werkstoff.doesOreDictedItemExists(plate) && - werkstoff.doesOreDictedItemExists(screw) && - werkstoff.doesOreDictedItemExists(gearGtSmall) && - werkstoff.doesOreDictedItemExists(gearGt) && - werkstoff.doesOreDictedItemExists(plateDouble) - ) - ) - return; + if (!(werkstoff.hasGenerationFeature(blockCasing) + && werkstoff.doesOreDictedItemExists(plate) + && werkstoff.doesOreDictedItemExists(screw) + && werkstoff.doesOreDictedItemExists(gearGtSmall) + && werkstoff.doesOreDictedItemExists(gearGt) + && werkstoff.doesOreDictedItemExists(plateDouble))) return; addCasingRecipes(werkstoff, plateDouble); } } - private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff){ - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing), new Object[]{ - "PSP", - "PGP", - "PSP", - 'P', werkstoff.get(plate), - 'S', werkstoff.get(screw), - 'G', werkstoff.get(gearGtSmall) + private static void addCasingRecipes(Werkstoff werkstoff, OrePrefixes reboltedCasingsOuterStuff) { + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasing), new Object[] { + "PSP", "PGP", "PSP", 'P', werkstoff.get(plate), 'S', werkstoff.get(screw), 'G', werkstoff.get(gearGtSmall) }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(plate, 6), - werkstoff.get(screw, 2), - werkstoff.get(gearGtSmall) - }, GT_Values.NF, werkstoff.get(blockCasing), 200, 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] {werkstoff.get(plate, 6), werkstoff.get(screw, 2), werkstoff.get(gearGtSmall)}, + GT_Values.NF, + werkstoff.get(blockCasing), + 200, + 30); - GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced), new Object[]{ - "PSP", - "PGP", - "PSP", - 'P', werkstoff.get(reboltedCasingsOuterStuff), - 'S', werkstoff.get(screw), - 'G', werkstoff.get(gearGt) + GT_ModHandler.addCraftingRecipe(werkstoff.get(blockCasingAdvanced), new Object[] { + "PSP", + "PGP", + "PSP", + 'P', + werkstoff.get(reboltedCasingsOuterStuff), + 'S', + werkstoff.get(screw), + 'G', + werkstoff.get(gearGt) }); - GT_Values.RA.addAssemblerRecipe(new ItemStack[]{ - werkstoff.get(reboltedCasingsOuterStuff, 6), - werkstoff.get(screw, 2), - werkstoff.get(gearGt) - }, GT_Values.NF, werkstoff.get(blockCasingAdvanced), 200, 30); + GT_Values.RA.addAssemblerRecipe( + new ItemStack[] { + werkstoff.get(reboltedCasingsOuterStuff, 6), werkstoff.get(screw, 2), werkstoff.get(gearGt) + }, + GT_Values.NF, + werkstoff.get(blockCasingAdvanced), + 200, + 30); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java index 1c1e530f42..a1de8695a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CellLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -35,32 +37,32 @@ 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.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Objects; - -import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; public class CellLoader implements IWerkstoffRunnable { @Override @SuppressWarnings("unchecked") public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(cell)) - return; + if (!werkstoff.hasItemType(cell)) return; - if ((werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) && !werkstoff.hasItemType(dust)) { + if ((werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge()) + && !werkstoff.hasItemType(dust)) { List<FluidStack> flOutputs = new ArrayList<>(); List<ItemStack> stOutputs = new ArrayList<>(); HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>(); int cells = 0; - for (Pair<ISubTagContainer, Integer> container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + for (Pair<ISubTagContainer, Integer> container : + werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).hasCorrespondingGas() || ((Materials) container.getKey()).hasCorrespondingFluid() || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + if (((Materials) container.getKey()).hasCorrespondingGas() + || ((Materials) container.getKey()).hasCorrespondingFluid() + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); @@ -71,24 +73,27 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Materials) container.getKey()) + .getCells( + tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { - if (((Materials) container.getKey()).getDust(container.getValue()) == null) - continue; + if (((Materials) container.getKey()).getDust(container.getValue()) == null) continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Materials) container.getKey()) + .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { + if (((Werkstoff) container.getKey()).getStats().isGas() + || ((Werkstoff) container.getKey()).hasItemType(cell)) { FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); @@ -99,19 +104,22 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Werkstoff) container.getKey()) + .get( + cell, + tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) - continue; + if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.add(((Werkstoff) container.getKey()) + .get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -124,27 +132,84 @@ public class CellLoader implements IWerkstoffRunnable { stOutputs.add(Materials.Empty.getCells(-cellEmpty)); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : 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().getProtons() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : 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().getProtons() + * werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : 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().getMass() * werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {input, cellEmpty > 0 ? Materials.Empty.getCells(cellEmpty) : 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().getMass() + * werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); } - //Tank "Recipe" - GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(cell), Materials.Empty.getCells(1))); - FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + // Tank "Recipe" + GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + werkstoff.get(cell), + Materials.Empty.getCells(1))); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getFluidOrGas(1).getFluid(), werkstoff.get(cell), Materials.Empty.getCells(1)); + GT_Values.RA.addFluidCannerRecipe( + Materials.Empty.getCells(1), + werkstoff.get(cell), + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(cell), + Materials.Empty.getCells(1), + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); if (LoaderReference.Forestry) { - FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true); + FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), + werkstoff.get(capsule), + GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), + true); GT_Utility.addFluidContainerData(emptyData); FluidContainerRegistry.registerFluidContainer(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(capsule), + GT_Values.NI, + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000)); } if (werkstoff.hasItemType(dust)) { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getFluidOrGas(1000), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(GT_Utility.getIntegratedCircuit(1), werkstoff.getFluidOrGas(1000), werkstoff.get(dust), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dust), + null, + werkstoff.getFluidOrGas(1000), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe( + GT_Utility.getIntegratedCircuit(1), + werkstoff.getFluidOrGas(1000), + werkstoff.get(dust), + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); } if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -152,8 +217,17 @@ public class CellLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : - new Materials(-1, werkstoff.getTexSet(), 0, 0, 0, false, werkstoff.getDefaultName(), werkstoff.getDefaultName()); + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : new Materials( + -1, + werkstoff.getTexSet(), + 0, + 0, + 0, + false, + werkstoff.getDefaultName(), + werkstoff.getDefaultName()); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials.add(werkstoffBridgeMaterial); ElementSet = true; @@ -161,23 +235,37 @@ public class CellLoader implements IWerkstoffRunnable { break; } } - if (!ElementSet) - return; + if (!ElementSet) return; GT_OreDictUnificator.addAssociation(cell, werkstoffBridgeMaterial, werkstoff.get(cell), false); -// 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(); -// } + // 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.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(cell)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, 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), 30, 0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {werkstoff.get(cell)}, + new ItemStack[] {scannerOutput}, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); + // GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, 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), 30, 0)); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java index 0302f12a59..d82f7aa559 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CraftingMaterialLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -33,74 +35,170 @@ import gregtech.api.util.GT_ModHandler; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class CraftingMaterialLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(screw)) { int tVoltageMultiplier = werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15; - //bolt - GT_Values.RA.addExtruderRecipe(werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), ItemList.Shape_Extruder_Bolt.get(0L), werkstoff.get(bolt, 8), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 8 * tVoltageMultiplier); - GT_Values.RA.addCutterRecipe(werkstoff.get(stick), werkstoff.get(bolt, 4), null, (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 4); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(bolt), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - - //screw - GT_Values.RA.addLatheRecipe(werkstoff.get(bolt), werkstoff.get(screw), null, (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), 4); - GT_ModHandler.addCraftingRecipe(werkstoff.get(screw), GT_Proxy.tBits, new Object[]{"fX", "X ", 'X', werkstoff.get(bolt)}); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(screw), new ItemStack[]{werkstoff.get(dustTiny, 1)}, null, 2, 8); - - if (werkstoff.hasItemType(gem)) - return; - - //ring - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Ring.get(0L), werkstoff.get(ring, 4), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), 6 * tVoltageMultiplier); - GT_ModHandler.addCraftingRecipe(werkstoff.get(ring), GT_Proxy.tBits, new Object[]{"h ", "fX", 'X', werkstoff.get(stick)}); - - //Gear - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[]{"SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick)}); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 4), ItemList.Shape_Extruder_Gear.get(0L), werkstoff.get(gearGt), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), 8 * tVoltageMultiplier); - - //wireFine - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Wire.get(0L), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(ingot), werkstoff.get(wireFine, 8), (int) Math.max(werkstoff.getStats().getMass(), 1), 8 * tVoltageMultiplier); - GT_Values.RA.addWiremillRecipe(werkstoff.get(stick), werkstoff.get(wireFine, 4), (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), 8 * tVoltageMultiplier); - - //smallGear + // bolt + GT_Values.RA.addExtruderRecipe( + werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(ingot), + ItemList.Shape_Extruder_Bolt.get(0L), + werkstoff.get(bolt, 8), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), + 8 * tVoltageMultiplier); + GT_Values.RA.addCutterRecipe( + werkstoff.get(stick), + werkstoff.get(bolt, 4), + null, + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 4); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(bolt), new ItemStack[] {werkstoff.get(dustTiny, 1)}, null, 2, 8); + + // screw + GT_Values.RA.addLatheRecipe( + werkstoff.get(bolt), + werkstoff.get(screw), + null, + (int) Math.max(werkstoff.getStats().getMass() / 8L, 1L), + 4); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(screw), GT_Proxy.tBits, new Object[] {"fX", "X ", 'X', werkstoff.get(bolt)}); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(screw), new ItemStack[] {werkstoff.get(dustTiny, 1)}, null, 2, 8); + + if (werkstoff.hasItemType(gem)) return; + + // ring + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Ring.get(0L), + werkstoff.get(ring, 4), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1), + 6 * tVoltageMultiplier); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(ring), GT_Proxy.tBits, new Object[] {"h ", "fX", 'X', werkstoff.get(stick)}); + + // Gear + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGt), GT_Proxy.tBits, new Object[] { + "SPS", "PwP", "SPS", 'P', werkstoff.get(plate), 'S', werkstoff.get(stick) + }); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 4), + ItemList.Shape_Extruder_Gear.get(0L), + werkstoff.get(gearGt), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1), + 8 * tVoltageMultiplier); + + // wireFine + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Wire.get(0L), + werkstoff.get(wireFine, 8), + (int) Math.max(werkstoff.getStats().getMass() * 1.5F, 1F), + 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe( + werkstoff.get(ingot), + werkstoff.get(wireFine, 8), + (int) Math.max(werkstoff.getStats().getMass(), 1), + 8 * tVoltageMultiplier); + GT_Values.RA.addWiremillRecipe( + werkstoff.get(stick), + werkstoff.get(wireFine, 4), + (int) Math.max(werkstoff.getStats().getMass() * 0.5F, 1F), + 8 * tVoltageMultiplier); + + // smallGear if (WerkstoffLoader.smallGearShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), WerkstoffLoader.smallGearShape.get(0L), werkstoff.get(gearGtSmall), (int) werkstoff.getStats().getMass(), 8 * tVoltageMultiplier); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + WerkstoffLoader.smallGearShape.get(0L), + werkstoff.get(gearGtSmall), + (int) werkstoff.getStats().getMass(), + 8 * tVoltageMultiplier); if (ConfigHandler.hardmode) - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{" S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate)}); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { + " S ", "hPx", " S ", 'S', werkstoff.get(stick), 'P', werkstoff.get(plate) + }); else - GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[]{"P ", " h ", 'P', werkstoff.get(plate)}); - - //Rotor - GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[]{"PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw)}); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Tin.getMolten(32), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.Lead.getMolten(48), werkstoff.get(rotor), 240, 24); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(plate, 4), werkstoff.get(ring), Materials.SolderingAlloy.getMolten(16), werkstoff.get(rotor), 240, 24); + GT_ModHandler.addCraftingRecipe(werkstoff.get(gearGtSmall), GT_Proxy.tBits, new Object[] { + "P ", " h ", 'P', werkstoff.get(plate) + }); + + // Rotor + GT_ModHandler.addCraftingRecipe(werkstoff.get(rotor), GT_Proxy.tBits, new Object[] { + "PhP", "SRf", "PdP", 'P', werkstoff.get(plate), 'R', werkstoff.get(ring), 'S', werkstoff.get(screw) + }); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(plate, 4), + werkstoff.get(ring), + Materials.Tin.getMolten(32), + werkstoff.get(rotor), + 240, + 24); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(plate, 4), + werkstoff.get(ring), + Materials.Lead.getMolten(48), + werkstoff.get(rotor), + 240, + 24); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(plate, 4), + werkstoff.get(ring), + Materials.SolderingAlloy.getMolten(16), + werkstoff.get(rotor), + 240, + 24); if (WerkstoffLoader.rotorShape != null) - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 5), WerkstoffLoader.rotorShape.get(0L), werkstoff.get(rotor), 200, 60); - //molten -> metal + // molten -> metal if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear_Small.get(0L), werkstoff.getMolten(144), werkstoff.get(gearGtSmall), 16, 8); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear.get(0L), werkstoff.getMolten(576), werkstoff.get(gearGt), 128, 8); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear_Small.get(0L), + werkstoff.getMolten(144), + werkstoff.get(gearGtSmall), + 16, + 8); if (WerkstoffLoader.ringMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.ringMold.get(0L), werkstoff.getMolten(36), werkstoff.get(ring), 100, 4 * tVoltageMultiplier); + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.ringMold.get(0L), + werkstoff.getMolten(36), + werkstoff.get(ring), + 100, + 4 * tVoltageMultiplier); if (WerkstoffLoader.boltMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.boltMold.get(0L), werkstoff.getMolten(18), werkstoff.get(bolt), 50, 2 * tVoltageMultiplier); + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.boltMold.get(0L), + werkstoff.getMolten(18), + werkstoff.get(bolt), + 50, + 2 * tVoltageMultiplier); if (WerkstoffLoader.rotorMold != null) - GT_Values.RA.addFluidSolidifierRecipe(WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); + GT_Values.RA.addFluidSolidifierRecipe( + WerkstoffLoader.rotorMold.get(0L), werkstoff.getMolten(612), werkstoff.get(rotor), 100, 60); } - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGt), new ItemStack[]{werkstoff.get(dust, 4)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(gearGtSmall), new ItemStack[]{werkstoff.get(dust, 1)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(rotor), new ItemStack[]{werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ring), new ItemStack[]{werkstoff.get(dustSmall, 1)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(gearGt), new ItemStack[] {werkstoff.get(dust, 4)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(gearGtSmall), new ItemStack[] {werkstoff.get(dust, 1)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(rotor), + new ItemStack[] {werkstoff.get(dust, 4), werkstoff.get(dustSmall)}, + null, + 2, + 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(ring), new ItemStack[] {werkstoff.get(dustSmall, 1)}, null, 2, 8); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java index f35d7c14a2..3967a56e6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/CrushedLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.GT_Mod; @@ -31,13 +33,10 @@ import gregtech.api.enums.SubTag; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; -import static gregtech.api.enums.OrePrefixes.*; - public class CrushedLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) - return; + if (!werkstoff.hasItemType(ore) || !werkstoff.hasItemType(dust)) return; if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { if (werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -54,40 +53,140 @@ public class CrushedLoader implements IWerkstoffRunnable { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); } - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustImpure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushed)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dustPure), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedPurified)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dustImpure), new Object[] {"h ", "W ", 'W', werkstoff.get(crushed)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dustPure), new Object[] {"h ", "W ", 'W', werkstoff.get(crushedPurified)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dust), new Object[] {"h ", "W ", 'W', werkstoff.get(crushedCentrifuged)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); - GT_ModHandler.addOreWasherRecipe(werkstoff.get(crushed), new int[] {10000, 1111, 10000}, 1000, werkstoff.get(crushedPurified), werkstoff.getOreByProduct(0, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushed), new int[] {10000, 1111, 10000}, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(crushed), werkstoff.get(dustImpure), werkstoff.getOreByProduct(0, dust), 10, false); + GT_ModHandler.addOreWasherRecipe( + werkstoff.get(crushed), + new int[] {10000, 1111, 10000}, + 1000, + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(0, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); + GT_ModHandler.addThermalCentrifugeRecipe( + werkstoff.get(crushed), + new int[] {10000, 1111, 10000}, + (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), + werkstoff.get(crushedCentrifuged), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); - GT_ModHandler.addThermalCentrifugeRecipe(werkstoff.get(crushedPurified), new int[] {10000, 1111}, (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), werkstoff.get(crushedCentrifuged), werkstoff.getOreByProduct(1, dust)); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(crushedPurified), werkstoff.get(dustPure), werkstoff.getOreByProduct(1, dust), 10, false); + GT_ModHandler.addThermalCentrifugeRecipe( + werkstoff.get(crushedPurified), + new int[] {10000, 1111}, + (int) Math.min(5000L, Math.abs(werkstoff.getStats().getProtons() * 20L)), + werkstoff.get(crushedCentrifuged), + werkstoff.getOreByProduct(1, dust)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), 10, 16); - GT_ModHandler.addPulverisationRecipe(werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); + GT_ModHandler.addPulverisationRecipe( + werkstoff.get(crushedCentrifuged), werkstoff.get(dust), werkstoff.getOreByProduct(2, dust), 10, false); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustImpure), null, null, null, werkstoff.get(dust), werkstoff.getOreByProduct(0, dust), null, null, null, null, new int[] {10000, 1111}, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); - GT_Values.RA.addCentrifugeRecipe(werkstoff.get(dustPure), null, null, null, werkstoff.get(dust), werkstoff.getOreByProduct(1, dust), null, null, null, null, new int[] {10000, 1111}, (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), 5); + GT_Values.RA.addCentrifugeRecipe( + werkstoff.get(dustImpure), + null, + null, + null, + werkstoff.get(dust), + werkstoff.getOreByProduct(0, dust), + null, + null, + null, + null, + new int[] {10000, 1111}, + (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), + 5); + GT_Values.RA.addCentrifugeRecipe( + werkstoff.get(dustPure), + null, + null, + null, + werkstoff.get(dust), + werkstoff.getOreByProduct(1, dust), + null, + null, + null, + null, + new int[] {10000, 1111}, + (int) Math.max(1L, werkstoff.getStats().getMass() * 8L), + 5); if (werkstoff.contains(SubTag.CRYSTALLISABLE)) { - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustPure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); - GT_Values.RA.addAutoclaveRecipe(werkstoff.get(dustImpure), gregtech.api.util.GT_ModHandler.getDistilledWater(200L), werkstoff.get(gem), 9500, 1500, 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustPure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustImpure), Materials.Water.getFluid(200L), werkstoff.get(gem), 9000, 2000, 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustPure), + gregtech.api.util.GT_ModHandler.getDistilledWater(200L), + werkstoff.get(gem), + 9500, + 1500, + 24); + GT_Values.RA.addAutoclaveRecipe( + werkstoff.get(dustImpure), + gregtech.api.util.GT_ModHandler.getDistilledWater(200L), + werkstoff.get(gem), + 9500, + 1500, + 24); } if (werkstoff.contains(SubTag.WASHING_MERCURY)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.Mercury.getFluid(1000L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addChemicalBathRecipe( + werkstoff.get(crushed), + Materials.Mercury.getFluid(1000L), + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L), + new int[] {10000, 7000, 4000}, + 800, + 8); if (werkstoff.contains(SubTag.WASHING_SODIUMPERSULFATE)) - GT_Values.RA.addChemicalBathRecipe(werkstoff.get(crushed), Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), werkstoff.get(crushedPurified), werkstoff.getOreByProduct(1, dust), GT_OreDictUnificator.get(dust, Materials.Stone, 1L), new int[]{10000, 7000, 4000}, 800, 8); + GT_Values.RA.addChemicalBathRecipe( + werkstoff.get(crushed), + Materials.SodiumPersulfate.getFluid(GT_Mod.gregtechproxy.mDisableOldChemicalRecipes ? 1000L : 100L), + werkstoff.get(crushedPurified), + werkstoff.getOreByProduct(1, dust), + GT_OreDictUnificator.get(dust, Materials.Stone, 1L), + new int[] {10000, 7000, 4000}, + 800, + 8); if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_GOLD)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe( + werkstoff.get(dustPure), + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Gold, 1L), + GT_OreDictUnificator.get(nugget, Materials.Gold, 1L), + new int[] {10000, 4000, 2000}, + 400, + 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_IRON)) - GT_Values.RA.addElectromagneticSeparatorRecipe(werkstoff.get(dustPure), werkstoff.get(dust), GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), new int[]{10000, 4000, 2000}, 400, 24); + GT_Values.RA.addElectromagneticSeparatorRecipe( + werkstoff.get(dustPure), + werkstoff.get(dust), + GT_OreDictUnificator.get(dustSmall, Materials.Iron, 1L), + GT_OreDictUnificator.get(nugget, Materials.Iron, 1L), + new int[] {10000, 4000, 2000}, + 400, + 24); else if (werkstoff.contains(SubTag.ELECTROMAGNETIC_SEPERATION_NEODYMIUM)) - 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); + 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); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java index aa580c3237..de1a0d1b34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/DustLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -35,14 +37,11 @@ import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; - -import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class DustLoader implements IWerkstoffRunnable { @@ -55,10 +54,16 @@ public class DustLoader implements IWerkstoffRunnable { HashMap<ISubTagContainer, Pair<Integer, Integer>> tracker = new HashMap<>(); int cells = 0; - if (werkstoff.getGenerationFeatures().hasMixerRecipes() || werkstoff.getStats().isElektrolysis() || werkstoff.getStats().isCentrifuge() || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - for (Pair<ISubTagContainer, Integer> container : werkstoff.getContents().getValue().toArray(new Pair[0])) { + if (werkstoff.getGenerationFeatures().hasMixerRecipes() + || werkstoff.getStats().isElektrolysis() + || werkstoff.getStats().isCentrifuge() + || werkstoff.getGenerationFeatures().hasChemicalRecipes()) { + for (Pair<ISubTagContainer, Integer> container : + werkstoff.getContents().getValue().toArray(new Pair[0])) { if (container.getKey() instanceof Materials) { - if (((Materials) container.getKey()).getGas(0) != null || ((Materials) container.getKey()).getFluid(0) != null || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { + if (((Materials) container.getKey()).getGas(0) != null + || ((Materials) container.getKey()).getFluid(0) != null + || ((Materials) container.getKey()).mIconSet == TextureSet.SET_FLUID) { FluidStack tmpFl = ((Materials) container.getKey()).getGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getFluid(1000 * container.getValue()); @@ -67,45 +72,63 @@ public class DustLoader implements IWerkstoffRunnable { if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + tracker.put( + container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(((Materials) container.getKey()) + .getCells(tracker.get(container.getKey()) + .getKey() + + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { if (((Materials) container.getKey()).getDust(container.getValue()) == null) { - if (((Materials) container.getKey()).getCells(container.getValue()) != null && (((Materials) container.getKey()).getMolten(0) != null || ((Materials) container.getKey()).getSolid(0) != null)) { - FluidStack tmpFl = ((Materials) container.getKey()).getMolten(1000 * container.getValue()); + if (((Materials) container.getKey()).getCells(container.getValue()) != null + && (((Materials) container.getKey()).getMolten(0) != null + || ((Materials) container.getKey()).getSolid(0) != null)) { + FluidStack tmpFl = + ((Materials) container.getKey()).getMolten(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Materials) container.getKey()).getSolid(1000 * container.getValue()); } flOutputs.add(tmpFl); if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { - stOutputs.add(((Materials) container.getKey()).getCells(container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + stOutputs.add( + ((Materials) container.getKey()).getCells(container.getValue())); + tracker.put( + container.getKey(), + new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getCells(tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(((Materials) container.getKey()) + .getCells(tracker.get(container.getKey()) + .getKey() + + container.getValue())); + stOutputs.remove(tracker.get(container.getKey()) + .getValue() + + 1); } cells += container.getValue(); } - } else - continue; + } else continue; } if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Materials) container.getKey()).getDust(container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Materials) container.getKey()).getDust(tracker.get(container.getKey()).getKey() + container.getValue())); + stOutputs.add(((Materials) container.getKey()) + .getDust(tracker.get(container.getKey()).getKey() + container.getValue())); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } } else if (container.getKey() instanceof Werkstoff) { - if (((Werkstoff) container.getKey()).getStats().isGas() || ((Werkstoff) container.getKey()).hasItemType(cell)) { - FluidStack tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); + if (((Werkstoff) container.getKey()).getStats().isGas() + || ((Werkstoff) container.getKey()).hasItemType(cell)) { + FluidStack tmpFl = + ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); if (tmpFl == null || tmpFl.getFluid() == null) { tmpFl = ((Werkstoff) container.getKey()).getFluidOrGas(1000 * container.getValue()); } @@ -113,21 +136,30 @@ public class DustLoader implements IWerkstoffRunnable { if (flOutputs.size() > 1) { if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(cell, container.getValue())); - tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); + tracker.put( + container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(cell, tracker.get(container.getKey()).getKey() + container.getValue())); - stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); + stOutputs.add(((Werkstoff) container.getKey()) + .get( + cell, + tracker.get(container.getKey()) + .getKey() + + container.getValue())); + stOutputs.remove( + tracker.get(container.getKey()).getValue() + 1); } cells += container.getValue(); } } else { - if (!((Werkstoff) container.getKey()).hasItemType(dust)) - continue; + if (!((Werkstoff) container.getKey()).hasItemType(dust)) continue; if (!tracker.containsKey(container.getKey())) { stOutputs.add(((Werkstoff) container.getKey()).get(dust, container.getValue())); tracker.put(container.getKey(), new Pair<>(container.getValue(), stOutputs.size() - 1)); } else { - stOutputs.add(((Werkstoff) container.getKey()).get(dust, (tracker.get(container.getKey()).getKey() + container.getValue()))); + stOutputs.add(((Werkstoff) container.getKey()) + .get( + dust, + (tracker.get(container.getKey()).getKey() + container.getValue()))); stOutputs.remove(tracker.get(container.getKey()).getValue() + 1); } } @@ -136,64 +168,175 @@ public class DustLoader implements IWerkstoffRunnable { ItemStack input = werkstoff.get(dust); input.stackSize = werkstoff.getContents().getKey(); if (werkstoff.getStats().isElektrolysis()) - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe(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().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); + GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.add(new BWRecipes.DynamicGTRecipe( + 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().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); if (werkstoff.getStats().isCentrifuge()) - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe(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().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.add(new BWRecipes.DynamicGTRecipe( + 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().getMass() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); if (werkstoff.getGenerationFeatures().hasChemicalRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); - GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0)); - GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getProtons() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 30, 0); + if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); + GT_Recipe.GT_Recipe_Map.sChemicalRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0)); + GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getProtons() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 30, + 0); } if (werkstoff.getGenerationFeatures().hasMixerRecipes()) { - if (cells > 0) - stOutputs.add(Materials.Empty.getCells(cells)); + if (cells > 0) stOutputs.add(Materials.Empty.getCells(cells)); short circuitID = werkstoff.getMixCircuit(); ItemStack circuit = circuitID == -1 ? null : GT_Utility.getIntegratedCircuit(circuitID); if (circuit != null) stOutputs.add(circuit); - GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe(true, stOutputs.toArray(new ItemStack[0]), new ItemStack[]{input}, null, null, new FluidStack[]{flOutputs.size() > 0 ? flOutputs.get(0) : null}, null, (int) Math.max(1L, Math.abs(werkstoff.getStats().getMass() / werkstoff.getContents().getValue().size())), Math.min(4, werkstoff.getContents().getValue().size()) * 5, 0)); + GT_Recipe.GT_Recipe_Map.sMixerRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + stOutputs.toArray(new ItemStack[0]), + new ItemStack[] {input}, + null, + null, + new FluidStack[] {flOutputs.size() > 0 ? flOutputs.get(0) : null}, + null, + (int) Math.max( + 1L, + Math.abs(werkstoff.getStats().getMass() + / werkstoff.getContents().getValue().size())), + Math.min(4, werkstoff.getContents().getValue().size()) * 5, + 0)); } } - GT_ModHandler.addCraftingRecipe(werkstoff.get(dust), new Object[]{ - "TTT", "TTT", "TTT", 'T', - werkstoff.get(dustTiny) - }); - 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', werkstoff.get(dust) - }); - GT_ModHandler.addCraftingRecipe(WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), new Object[]{ - "T ", 'T', werkstoff.get(dust) - }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(dust), new Object[] {"TTT", "TTT", "TTT", 'T', werkstoff.get(dustTiny)}); + 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', werkstoff.get(dust)}); + GT_ModHandler.addCraftingRecipe( + WerkstoffLoader.getCorrespondingItemStack(dustTiny, werkstoff, 9), + new Object[] {"T ", 'T', werkstoff.get(dust)}); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); - GT_Values.RA.addBoxingRecipe(werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustTiny, 9), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustSmall, 4), ItemList.Schematic_Dust.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustTiny, 9), ItemList.Schematic_3by3.get(0L), werkstoff.get(dust), 100, 4); + GT_Values.RA.addBoxingRecipe( + werkstoff.get(dustSmall, 4), ItemList.Schematic_2by2.get(0L), werkstoff.get(dust), 100, 4); if (werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) { GT_ModHandler.addSmeltingRecipe(werkstoff.get(dust), werkstoff.get(ingot)); GT_ModHandler.addSmeltingRecipe(werkstoff.get(dustTiny), werkstoff.get(nugget)); - } else if (werkstoff.hasItemType(ingot) && werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() != 0) { + } else if (werkstoff.hasItemType(ingot) + && werkstoff.getStats().isBlastFurnace() + && werkstoff.getStats().getMeltingPoint() != 0) { if (werkstoff.contains(WerkstoffLoader.ANAEROBE_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Nitrogen.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(11), + Materials.Nitrogen.getGas(1000), + null, + werkstoff.getStats().getMeltingPoint() < 1750 + ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); } else if (werkstoff.contains(WerkstoffLoader.NOBLE_GAS_SMELTING)) { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(11), Materials.Argon.getGas(1000), null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(11), + Materials.Argon.getGas(1000), + null, + werkstoff.getStats().getMeltingPoint() < 1750 + ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); } else { - GT_Values.RA.addBlastRecipe(werkstoff.get(dust), GT_Utility.getIntegratedCircuit(1), null, null, werkstoff.getStats().getMeltingPoint() < 1750 ? werkstoff.get(ingot) : werkstoff.get(ingotHot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingVoltage(), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addBlastRecipe( + werkstoff.get(dust), + GT_Utility.getIntegratedCircuit(1), + null, + null, + werkstoff.getStats().getMeltingPoint() < 1750 + ? werkstoff.get(ingot) + : werkstoff.get(ingotHot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingVoltage(), + werkstoff.getStats().getMeltingPoint()); if (werkstoff.getStats().getMeltingPoint() <= 1000) { - GT_Values.RA.addPrimitiveBlastRecipe(werkstoff.get(dust), null, 9, werkstoff.get(ingot), null, (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) * werkstoff.getStats().getMeltingPoint()); - //GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), werkstoff.getStats().getMeltingPoint()); + GT_Values.RA.addPrimitiveBlastRecipe( + werkstoff.get(dust), + null, + 9, + werkstoff.get(ingot), + null, + (int) Math.max(werkstoff.getStats().getMass() / 40L, 1L) + * werkstoff.getStats().getMeltingPoint()); + // GT_ModHandler.addRCBlastFurnaceRecipe(werkstoff.get(ingot), werkstoff.get(dust), + // werkstoff.getStats().getMeltingPoint()); } } } if (werkstoff.getStats().isBlastFurnace() && werkstoff.getStats().getMeltingPoint() > 1750) { - GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) Math.max(werkstoff.getStats().getMass() * 3L, 1L)); + GT_Values.RA.addVacuumFreezerRecipe(werkstoff.get(ingotHot), werkstoff.get(ingot), (int) + Math.max(werkstoff.getStats().getMass() * 3L, 1L)); } if (werkstoff.hasItemType(ingot)) { @@ -205,4 +348,4 @@ public class DustLoader implements IWerkstoffRunnable { } } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java index 194ab143d9..d8ee81065b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/GemLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -36,33 +38,29 @@ import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import static gregtech.api.enums.OrePrefixes.*; - public class GemLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(gem)) { - if (werkstoff.getGenerationFeatures().hasSifterRecipes() || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { + if (werkstoff.getGenerationFeatures().hasSifterRecipes() + || (werkstoff.hasItemType(ore) && werkstoff.hasItemType(dust))) { GT_ModHandler.addCompressionRecipe(werkstoff.get(gem, 9), werkstoff.get(block)); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(block), werkstoff.get(gem, 9), 100, 24); GT_Values.RA.addSifterRecipe( werkstoff.get(crushedPurified), - new ItemStack[]{ - 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 + new ItemStack[] { + 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}, 800, - 16 - ); + 16); } GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemExquisite), werkstoff.get(dust, 4)); @@ -71,10 +69,14 @@ public class GemLoader implements IWerkstoffRunnable { GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemFlawed), werkstoff.get(dustSmall, 2)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(gemChipped), werkstoff.get(dustSmall)); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawless, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemExquisite)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gem, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawless)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemFlawed, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gem)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(gemChipped, 2), 0, new Object[]{"h ", "W ", 'W', werkstoff.get(gemFlawed)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gemFlawless, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemExquisite)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gem, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemFlawless)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gemFlawed, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gem)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(gemChipped, 2), 0, new Object[] {"h ", "W ", 'W', werkstoff.get(gemFlawed)}); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemExquisite), werkstoff.get(gemFlawless, 2), 64, 16); GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemFlawless), werkstoff.get(gem, 2), 64, 16); @@ -83,28 +85,59 @@ public class GemLoader implements IWerkstoffRunnable { GT_Values.RA.addForgeHammerRecipe(werkstoff.get(gemChipped), werkstoff.get(dustTiny), 64, 16); if (!werkstoff.contains(WerkstoffLoader.NO_BLAST)) { - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawless, 3), 8, werkstoff.get(gemExquisite), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gem, 3), 8, werkstoff.get(gemFlawless), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemFlawed, 3), 8, werkstoff.get(gem), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(gemChipped, 3), 8, werkstoff.get(gemFlawed), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gemFlawless, 3), + 8, + werkstoff.get(gemExquisite), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gem, 3), + 8, + werkstoff.get(gemFlawless), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gemFlawed, 3), + 8, + werkstoff.get(gem), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(gemChipped, 3), + 8, + werkstoff.get(gemFlawed), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 2)); - GT_Values.RA.addImplosionRecipe(werkstoff.get(dust, 4), 24, werkstoff.get(gem, 3), GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); + GT_Values.RA.addImplosionRecipe( + werkstoff.get(dust, 4), + 24, + werkstoff.get(gem, 3), + GT_OreDictUnificator.get(dustTiny, Materials.DarkAsh, 8)); } if (werkstoff.hasItemType(plate)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); + GT_Values.RA.addLatheRecipe( + werkstoff.get(plate), werkstoff.get(lens), werkstoff.get(dustSmall), 1200, 120); } - GT_Values.RA.addLatheRecipe(werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); - GregTech_API.registerCover(werkstoff.get(lens), TextureFactory.of(Textures.BlockIcons.MACHINE_CASINGS[2][0], TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); + GT_Values.RA.addLatheRecipe( + werkstoff.get(gemExquisite), werkstoff.get(lens), werkstoff.get(dust, 2), 2400, 30); + GregTech_API.registerCover( + werkstoff.get(lens), + TextureFactory.of( + Textures.BlockIcons.MACHINE_CASINGS[2][0], + TextureFactory.of(Textures.BlockIcons.OVERLAY_LENS, werkstoff.getRGBA(), false)), + new gregtech.common.covers.GT_Cover_Lens(BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mIndex)); GT_ModHandler.addPulverisationRecipe(werkstoff.get(lens), werkstoff.get(dustSmall, 3)); - for (ItemStack is : OreDictionary.getOres("craftingLens" + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { + for (ItemStack is : OreDictionary.getOres("craftingLens" + + BW_ColorUtil.getDyeFromColor(werkstoff.getRGBA()).mName.replace(" ", ""))) { is.stackSize = 0; - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); + GT_Values.RA.addLaserEngraverRecipe( + werkstoff.get(gemChipped, 3), is, werkstoff.get(gemFlawed, 1), 600, 30); GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawed, 3), is, werkstoff.get(gem, 1), 600, 120); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); - GT_Values.RA.addLaserEngraverRecipe(werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); + GT_Values.RA.addLaserEngraverRecipe( + werkstoff.get(gem, 3), is, werkstoff.get(gemFlawless, 1), 1200, 480); + GT_Values.RA.addLaserEngraverRecipe( + werkstoff.get(gemFlawless, 3), is, werkstoff.get(gemExquisite, 1), 2400, 2000); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java index 9db7e8f26a..874d82859d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MetalLoader.java @@ -22,22 +22,32 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.block; +import static gregtech.api.enums.OrePrefixes.ingot; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; -import static gregtech.api.enums.OrePrefixes.block; -import static gregtech.api.enums.OrePrefixes.ingot; - public class MetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(ingot)) { GT_ModHandler.addCompressionRecipe(werkstoff.get(ingot, 9), werkstoff.get(block)); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Extruder_Block.get(0), werkstoff.get(block), (int) werkstoff.getStats().getMass(), 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); - GT_Values.RA.addAlloySmelterRecipe(werkstoff.get(ingot, 9), ItemList.Shape_Mold_Block.get(0L), werkstoff.get(block), (int) (werkstoff.getStats().getMass() / 2), 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 9), + ItemList.Shape_Extruder_Block.get(0), + werkstoff.get(block), + (int) werkstoff.getStats().getMass(), + 8 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); + GT_Values.RA.addAlloySmelterRecipe( + werkstoff.get(ingot, 9), + ItemList.Shape_Mold_Block.get(0L), + werkstoff.get(block), + (int) (werkstoff.getStats().getMass() / 2), + 4 * werkstoff.getStats().getMeltingPoint() >= 2800 ? 60 : 15); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java index 0e6d14d4a9..153f131383 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MoltenCellLoader.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -31,58 +34,137 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; +import java.util.Objects; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; -import java.util.Objects; - -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.capsuleMolten; -import static gregtech.api.enums.OrePrefixes.*; - public class MoltenCellLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) - return; + if (!werkstoff.hasItemType(WerkstoffLoader.cellMolten)) return; if (!werkstoff.hasItemType(ingot)) { - if (!werkstoff.hasItemType(dust)) - return; - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dust), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustSmall), null, werkstoff.getMolten(36), 0, (int) ((double) werkstoff.getStats().getMass() / 4D), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(dustTiny), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + if (!werkstoff.hasItemType(dust)) return; + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dust), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dustSmall), + null, + werkstoff.getMolten(36), + 0, + (int) ((double) werkstoff.getStats().getMass() / 4D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(dustTiny), + null, + werkstoff.getMolten(16), + 0, + (int) ((double) werkstoff.getStats().getMass() / 9D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); } else { - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(ingot), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(ingot), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(nugget), null, werkstoff.getMolten(16), 0, (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(nugget), + null, + werkstoff.getMolten(16), + 0, + (int) ((double) werkstoff.getStats().getMass() / 9D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), werkstoff.getMolten(144), werkstoff.get(ingot), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - //GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), werkstoff.getMolten(16), werkstoff.get(nugget), (int) ((double) werkstoff.getStats().getMass() / 9D), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(1296), werkstoff.get(block), (int) werkstoff.getStats().getMass() * 9, werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Ingot.get(0), + werkstoff.getMolten(144), + werkstoff.get(ingot), + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + // GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), werkstoff.getMolten(144), + // werkstoff.get(block), (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : + // 30); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Nugget.get(0), + werkstoff.getMolten(16), + werkstoff.get(nugget), + (int) ((double) werkstoff.getStats().getMass() / 9D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Block.get(0), + werkstoff.getMolten(1296), + werkstoff.get(block), + (int) werkstoff.getStats().getMass() * 9, + werkstoff.getStats().getMass() > 128 ? 64 : 30); - if (!werkstoff.hasItemType(plate)) - return; + if (!werkstoff.hasItemType(plate)) return; - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stickLong), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(plate), null, werkstoff.getMolten(144), 0, (int) werkstoff.getStats().getMass(), werkstoff.getStats().getMass() > 128 ? 64 : 30); - GT_Values.RA.addFluidExtractionRecipe(werkstoff.get(stick), null, werkstoff.getMolten(72), 0, (int) ((double) werkstoff.getStats().getMass() / 2D), werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(stickLong), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(plate), + null, + werkstoff.getMolten(144), + 0, + (int) werkstoff.getStats().getMass(), + werkstoff.getStats().getMass() > 128 ? 64 : 30); + GT_Values.RA.addFluidExtractionRecipe( + werkstoff.get(stick), + null, + werkstoff.getMolten(72), + 0, + (int) ((double) werkstoff.getStats().getMass() / 2D), + werkstoff.getStats().getMass() > 128 ? 64 : 30); } - //Tank "Recipe" - final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); + // Tank "Recipe" + final FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + werkstoff.get(WerkstoffLoader.cellMolten), + Materials.Empty.getCells(1)); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getMolten(144), werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1)); GT_Utility.addFluidContainerData(data); - GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(WerkstoffLoader.cellMolten), new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), GT_Values.NF); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(WerkstoffLoader.cellMolten), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + GT_Values.RA.addFluidCannerRecipe( + Materials.Empty.getCells(1), + werkstoff.get(WerkstoffLoader.cellMolten), + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + GT_Values.NF); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(WerkstoffLoader.cellMolten), + Materials.Empty.getCells(1), + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); - if (!LoaderReference.Forestry) - return; + if (!LoaderReference.Forestry) return; - final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); - FluidContainerRegistry.registerFluidContainer(werkstoff.getMolten(144), werkstoff.get(capsuleMolten), GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + final FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData( + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144), + werkstoff.get(capsuleMolten), + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); + FluidContainerRegistry.registerFluidContainer( + werkstoff.getMolten(144), + werkstoff.get(capsuleMolten), + GT_ModHandler.getModItem("Forestry", "refractoryEmpty", 1)); GT_Utility.addFluidContainerData(emptyData); - GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsuleMolten), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); + GT_Values.RA.addFluidCannerRecipe( + werkstoff.get(capsuleMolten), + GT_Values.NI, + GT_Values.NF, + new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(werkstoff)), 144)); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java index eb8d5ab9f3..135ee00218 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/MultipleMetalLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import com.github.bartimaeusnek.bartworks.util.BWRecipes; @@ -32,15 +34,27 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class MultipleMetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plateDense)) { - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, new ItemStack[]{werkstoff.get(plateDouble)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), 60, 0)); - GregTech_API.registerCover(werkstoff.get(plateDouble), TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), null); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plateDouble), new ItemStack[]{werkstoff.get(dust, 2)}, null, 2, 8); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {werkstoff.get(ingot, 2), GT_Utility.getIntegratedCircuit(2)}, + new ItemStack[] {werkstoff.get(plateDouble)}, + null, + null, + null, + null, + (int) Math.max(werkstoff.getStats().getMass() * 2, 1L), + 60, + 0)); + GregTech_API.registerCover( + werkstoff.get(plateDouble), + TextureFactory.of(werkstoff.getTexSet().mTextures[72], werkstoff.getRGBA(), false), + null); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(plateDouble), new ItemStack[] {werkstoff.get(dust, 2)}, null, 2, 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java index 7700ff74c6..a17efb4e6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/OreLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; @@ -30,16 +32,21 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.SubTag; import gregtech.api.util.GT_ModHandler; -import static gregtech.api.enums.OrePrefixes.*; - public class OreLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - if (werkstoff.hasItemType(ore) && werkstoff.hasItemType(ingot) && !werkstoff.getStats().isBlastFurnace()) - GT_ModHandler.addSmeltingRecipe(WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); + if (werkstoff.hasItemType(ore) + && werkstoff.hasItemType(ingot) + && !werkstoff.getStats().isBlastFurnace()) + GT_ModHandler.addSmeltingRecipe( + WerkstoffLoader.getCorrespondingItemStack(ore, werkstoff), werkstoff.get(ingot)); if (werkstoff.hasItemType(ore)) { - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ore), werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), 16, 10); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(ore), + werkstoff.hasItemType(gem) ? werkstoff.get(gem) : werkstoff.get(crushed), + 16, + 10); GT_ModHandler.addPulverisationRecipe( werkstoff.get(ore), werkstoff.get(crushed, 2), @@ -50,4 +57,4 @@ public class OreLoader implements IWerkstoffRunnable { true); } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java index a3766d9843..fd8d5be39e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/SimpleMetalLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.SideReference; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -39,47 +41,103 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; import net.minecraft.item.ItemStack; -import static gregtech.api.enums.OrePrefixes.*; - public class SimpleMetalLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { if (werkstoff.hasItemType(plate)) { if (werkstoff.hasItemType(gem)) { - GT_Values.RA.addLatheRecipe(werkstoff.get(gem), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(gem)}); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GT_Values.RA.addLatheRecipe( + werkstoff.get(gem), + werkstoff.get(stick), + werkstoff.get(dustSmall, 2), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), + 16); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[] {"s", "X", 'X', werkstoff.get(stickLong) + }); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(gem)}); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(stick, 2), + werkstoff.get(stickLong), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 16); TextureSet texSet = werkstoff.getTexSet(); - ITexture texture = SideReference.Side.Client ? - TextureFactory.of(texSet.mTextures[PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], werkstoff.getRGBA(), false) : - TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); - GregTech_API.registerCover(werkstoff.get(plate),texture,null); + ITexture texture = SideReference.Side.Client + ? TextureFactory.of( + texSet.mTextures[ + PrefixTextureLinker.blockTexMap.getOrDefault(texSet, block.mTextureIndex)], + werkstoff.getRGBA(), + false) + : TextureFactory.of(texSet.mTextures[block.mTextureIndex], werkstoff.getRGBA(), false); + GregTech_API.registerCover(werkstoff.get(plate), texture, null); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(plate), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); return; } - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[]{"s", "X", 'X', werkstoff.get(stickLong)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(stick), GT_Proxy.tBits, new Object[]{"f ", " X", 'X', werkstoff.get(ingot)}); - GT_ModHandler.addCraftingRecipe(werkstoff.get(plate), GT_Proxy.tBits, new Object[]{"h", "X", "X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick, 2), GT_Proxy.tBits, new Object[] {"s", "X", 'X', werkstoff.get(stickLong)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(stick), GT_Proxy.tBits, new Object[] {"f ", " X", 'X', werkstoff.get(ingot)}); + GT_ModHandler.addCraftingRecipe( + werkstoff.get(plate), GT_Proxy.tBits, new Object[] {"h", "X", "X", 'X', werkstoff.get(ingot)}); - GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe(true, new ItemStack[]{werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, new ItemStack[]{werkstoff.get(plate)}, null, null, null, null, (int) Math.max(werkstoff.getStats().getMass(), 1L), 24, 0)); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(ingot, 3), werkstoff.get(plate, 2), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); - GregTech_API.registerCover(werkstoff.get(plate), TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), null); + GT_Recipe.GT_Recipe_Map.sBenderRecipes.add(new BWRecipes.DynamicGTRecipe( + true, + new ItemStack[] {werkstoff.get(ingot), GT_Utility.getIntegratedCircuit(1)}, + new ItemStack[] {werkstoff.get(plate)}, + null, + null, + null, + null, + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 24, + 0)); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(ingot, 3), + werkstoff.get(plate, 2), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 16); + GregTech_API.registerCover( + werkstoff.get(plate), + TextureFactory.of(werkstoff.getTexSet().mTextures[71], werkstoff.getRGBA(), false), + null); - GT_Values.RA.addLatheRecipe(werkstoff.get(ingot), werkstoff.get(stick), werkstoff.get(dustSmall, 2), (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), 16); + GT_Values.RA.addLatheRecipe( + werkstoff.get(ingot), + werkstoff.get(stick), + werkstoff.get(dustSmall, 2), + (int) Math.max(werkstoff.getStats().getMass() * 5L, 1L), + 16); - GT_Values.RA.addForgeHammerRecipe(werkstoff.get(stick, 2), werkstoff.get(stickLong), (int) Math.max(werkstoff.getStats().getMass(), 1L), 16); + GT_Values.RA.addForgeHammerRecipe( + werkstoff.get(stick, 2), + werkstoff.get(stickLong), + (int) Math.max(werkstoff.getStats().getMass(), 1L), + 16); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Plate.get(0), werkstoff.get(plate), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot), ItemList.Shape_Extruder_Rod.get(0), werkstoff.get(stick, 2), (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), 45); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Plate.get(0), + werkstoff.get(plate), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 45); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot), + ItemList.Shape_Extruder_Rod.get(0), + werkstoff.get(stick, 2), + (int) Math.max(werkstoff.getStats().getMass() * 2L, 1L), + 45); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stickLong), new ItemStack[]{werkstoff.get(dust)}, null, 2, 8); - GT_Values.RA.addPulveriserRecipe(werkstoff.get(stick), new ItemStack[]{werkstoff.get(dustSmall, 2)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(ingot), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe(werkstoff.get(plate), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(stickLong), new ItemStack[] {werkstoff.get(dust)}, null, 2, 8); + GT_Values.RA.addPulveriserRecipe( + werkstoff.get(stick), new ItemStack[] {werkstoff.get(dustSmall, 2)}, null, 2, 8); } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java index 647204e041..9744bdf89c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/recipe/ToolLoader.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.recipe; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.enums.Dyes; @@ -35,99 +38,917 @@ import gregtech.common.items.GT_MetaGenerated_Tool_01; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.gtnhGT; -import static gregtech.api.enums.OrePrefixes.*; - public class ToolLoader implements IWerkstoffRunnable { - //GTNH-Specific + // GTNH-Specific public static final short SCREWDRIVER_MV = 152; public static final short SCREWDRIVER_HV = 154; public static final short SOLDERING_IRON_MV = 162; public static final short SOLDERING_IRON_HV = 164; public void run(Werkstoff werkstoff) { - if (werkstoff.getBridgeMaterial().mDurability == 0) - return; + if (werkstoff.getBridgeMaterial().mDurability == 0) return; if (werkstoff.hasItemType(gem)) { if (!werkstoff.getGenerationFeatures().isExtension()) - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', gem.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "XX ", + "XXS", + "XX ", + 'X', + gem.get(werkstoff.getBridgeMaterial()), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] {"GGf", 'G', gem.get(werkstoff.getBridgeMaterial())}); } - if (!werkstoff.hasItemType(plate)) - return; + if (!werkstoff.hasItemType(plate)) return; - //Disable recipe gen with handle Material for GT Materials + // Disable recipe gen with handle Material for GT Materials if (!werkstoff.getGenerationFeatures().isExtension()) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{" fS", " Sh", "W ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"hXW", "XRX", "WXd", 'X', plate.get(werkstoff.getBridgeMaterial()), 'S', plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'R', ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'W', screw.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{toolHeadHammer.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.FILE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P", "P", "S", 'P', plate.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SAW, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), new Object[]{toolHeadSaw.get(werkstoff.getBridgeMaterial()), stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_LV_Lithium.get(1L)}); - + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + " fS", + " Sh", + "W ", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'W', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadWrench, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "hXW", + "XRX", + "WXd", + 'X', + plate.get(werkstoff.getBridgeMaterial()), + 'S', + plate.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'R', + ring.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'W', + screw.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + toolHeadHammer.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.FILE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.MIRRORED + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "P", + "P", + "S", + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SAW, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + new Object[] { + toolHeadSaw.get(werkstoff.getBridgeMaterial()), + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Rubber, + new long[] {100000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "LBf", + "Sd ", + "P ", + 'B', + bolt.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(Materials.AnyRubber), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'L', + ItemList.Battery_RE_LV_Lithium.get(1L) + }); if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.AnyRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SOLDERING_IRON_HV, 1, werkstoff.getBridgeMaterial(), Materials.StyreneButadieneRubber, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"LBf", "Sd ", "P ", 'B', bolt.get(werkstoff.getBridgeMaterial()), 'P', plate.get(Materials.StyreneButadieneRubber), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), 'L', ItemList.Battery_RE_HV_Lithium.get(1L)}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_MV, 1, werkstoff.getBridgeMaterial(), Materials.Rubber, new long[] { + 400000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "LBf", + "Sd ", + "P ", + 'B', + bolt.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(Materials.AnyRubber), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'L', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SOLDERING_IRON_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StyreneButadieneRubber, + new long[] {1600000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "LBf", + "Sd ", + "P ", + 'B', + bolt.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(Materials.StyreneButadieneRubber), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial), + 'L', + ItemList.Battery_RE_HV_Lithium.get(1L) + }); } if (!werkstoff.hasItemType(gem)) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial().mHandleMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"XX ", "XXS", "XX ", 'X', ingot.get(werkstoff.getBridgeMaterial()), 'S', stick.get(werkstoff.getBridgeMaterial().mHandleMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HARDHAMMER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial().mHandleMaterial, + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "XX ", + "XXS", + "XX ", + 'X', + ingot.get(werkstoff.getBridgeMaterial()), + 'S', + stick.get(werkstoff.getBridgeMaterial().mHandleMaterial) + }); } } - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.PLUNGER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"xRR", " SR", "S f", 'S', stick.get(werkstoff.getBridgeMaterial()), 'R', plate.get(Materials.AnyRubber)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "hPd", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCOOP, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SWS", "SSS", "xSh", 'S', stick.get(werkstoff.getBridgeMaterial()), 'W', new ItemStack(Blocks.wool, 1, 32767)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BRANCHCUTTER, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PfP", "PdP", "STS", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial()), 'T', screw.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.KNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"fPh", " S ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, werkstoff.getBridgeMaterial(), werkstoff.getBridgeMaterial(), null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PPf", "PP ", "Sh ", 'S', stick.get(werkstoff.getBridgeMaterial()), 'P', plate.get(werkstoff.getBridgeMaterial())}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Aluminium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"SXd", "GMG", "PBP", 'X', toolHeadWrench.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{100000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{75000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, 1, werkstoff.getBridgeMaterial(), Materials.Steel, new long[]{50000L, 32L, 1L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_LV.get(1L), 'S', screw.get(Materials.Steel), 'P', plate.get(Materials.Steel), 'G', gearGtSmall.get(Materials.Steel), 'B', ItemList.Battery_RE_LV_Sodium.get(1L)}); - - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"II ", "IIh", "II ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.PLUNGER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "xRR", + " SR", + "S f", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'R', + plate.get(Materials.AnyRubber) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"IhI", "III", " I ", 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.CROWBAR, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"hDS", "DSD", "SDf", 'S', stick.get(werkstoff.getBridgeMaterial()), 'D', Dyes.dyeBlue}); + + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WIRECUTTER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PfP", + "hPd", + "STS", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'T', + screw.get(werkstoff.getBridgeMaterial()) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCOOP, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SWS", + "SSS", + "xSh", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'W', + new ItemStack(Blocks.wool, 1, 32767) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.BRANCHCUTTER, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PfP", + "PdP", + "STS", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'T', + screw.get(werkstoff.getBridgeMaterial()) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.KNIFE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "fPh", + " S ", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, + 1, + werkstoff.getBridgeMaterial(), + werkstoff.getBridgeMaterial(), + null), + GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PPf", + "PP ", + "Sh ", + 'S', + stick.get(werkstoff.getBridgeMaterial()), + 'P', + plate.get(werkstoff.getBridgeMaterial()) + }); + + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {100000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {75000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {50000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Sodium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] {400000L, 128L, 2L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Aluminium), + 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] {300000L, 128L, 2L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Aluminium), + 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_MV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Aluminium, + new long[] {200000L, 128L, 2L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Aluminium), + 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] {1600000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] {1200000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.WRENCH_HV, + 1, + werkstoff.getBridgeMaterial(), + Materials.StainlessSteel, + new long[] {800000L, 512L, 3L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "SXd", + "GMG", + "PBP", + 'X', + toolHeadWrench.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {100000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {75000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SCREWDRIVER_LV, + 1, + werkstoff.getBridgeMaterial(), + Materials.Steel, + new long[] {50000L, 32L, 1L, -1L}), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_LV.get(1L), + 'S', + screw.get(Materials.Steel), + 'P', + plate.get(Materials.Steel), + 'G', + gearGtSmall.get(Materials.Steel), + 'B', + ItemList.Battery_RE_LV_Sodium.get(1L) + }); + + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadHammer, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "II ", + "IIh", + "II ", + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'I', + ingot.get(werkstoff.getBridgeMaterial()) + }); if (werkstoff.hasItemType(plateDouble) && werkstoff.hasItemType(cellMolten)) { - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"fPd", "SPS", " P ", 'P', plateDouble.get(werkstoff.getBridgeMaterial()), 'S', screw.get(werkstoff.getBridgeMaterial())}); - GT_Values.RA.addExtruderRecipe(werkstoff.get(ingot, 6), ItemList.Shape_Extruder_Turbine_Blade.get(0), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 2 * 20, 120); - GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Turbine_Blade.get(0), werkstoff.getMolten(864), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() * 20, 120); - GT_Values.RA.addFormingPressRecipe(werkstoff.get(plateDouble, 3), werkstoff.get(screw, 2), werkstoff.get(turbineBlade, 1), (int) werkstoff.getStats().getMass() / 4 * 20, 30); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 4), GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, werkstoff.getBridgeMaterial(), Materials.Magnalium, null), 160, 100); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 8), GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE, 1, werkstoff.getBridgeMaterial(), Materials.Titanium, null), 320, 400); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 12), GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_LARGE, 1, werkstoff.getBridgeMaterial(), Materials.TungstenSteel, null), 640, 1600); - GT_Values.RA.addAssemblerRecipe(werkstoff.get(turbineBlade, 16), GT_OreDictUnificator.get(stickLong, Materials.Americium, 1), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_HUGE, 1, werkstoff.getBridgeMaterial(), Materials.Americium, null), 1280, 6400); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(turbineBlade, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "fPd", + "SPS", + " P ", + 'P', + plateDouble.get(werkstoff.getBridgeMaterial()), + 'S', + screw.get(werkstoff.getBridgeMaterial()) + }); + GT_Values.RA.addExtruderRecipe( + werkstoff.get(ingot, 6), + ItemList.Shape_Extruder_Turbine_Blade.get(0), + werkstoff.get(turbineBlade, 1), + (int) werkstoff.getStats().getMass() / 2 * 20, + 120); + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Turbine_Blade.get(0), + werkstoff.getMolten(864), + werkstoff.get(turbineBlade, 1), + (int) werkstoff.getStats().getMass() * 20, + 120); + GT_Values.RA.addFormingPressRecipe( + werkstoff.get(plateDouble, 3), + werkstoff.get(screw, 2), + werkstoff.get(turbineBlade, 1), + (int) werkstoff.getStats().getMass() / 4 * 20, + 30); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 4), + GT_OreDictUnificator.get(stickLong, Materials.Magnalium, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_SMALL, + 1, + werkstoff.getBridgeMaterial(), + Materials.Magnalium, + null), + 160, + 100); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 8), + GT_OreDictUnificator.get(stickLong, Materials.Titanium, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Titanium, + null), + 320, + 400); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 12), + GT_OreDictUnificator.get(stickLong, Materials.TungstenSteel, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_LARGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.TungstenSteel, + null), + 640, + 1600); + GT_Values.RA.addAssemblerRecipe( + werkstoff.get(turbineBlade, 16), + GT_OreDictUnificator.get(stickLong, Materials.Americium, 1), + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_HUGE, + 1, + werkstoff.getBridgeMaterial(), + Materials.Americium, + null), + 1280, + 6400); } if (!werkstoff.hasItemType(gem)) { - GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), GT_Proxy.tBits, new Object[]{"PP ", "fh ", 'P', plate.get(werkstoff.getBridgeMaterial()), 'I', ingot.get(werkstoff.getBridgeMaterial())}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(toolHeadSaw, werkstoff.getBridgeMaterial(), 1L), + GT_Proxy.tBits, + new Object[] { + "PP ", + "fh ", + 'P', + plate.get(werkstoff.getBridgeMaterial()), + 'I', + ingot.get(werkstoff.getBridgeMaterial()) + }); } if (gtnhGT) { - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{400000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{300000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[]{200000L, 128L, 2L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_MV.get(1L), 'S', screw.get(Materials.Aluminium), 'P', plate.get(Materials.Aluminium), 'G', gearGtSmall.get(Materials.Titanium), 'B', ItemList.Battery_RE_MV_Sodium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1600000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Lithium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{1200000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Cadmium.get(1L)}); - GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[]{800000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"PdX", "MGS", "GBP", 'X', stickLong.get(werkstoff.getBridgeMaterial()), 'M', ItemList.Electric_Motor_HV.get(1L), 'S', screw.get(Materials.StainlessSteel), 'P', plate.get(Materials.StainlessSteel), 'G', gearGtSmall.get(Materials.StainlessSteel), 'B', ItemList.Battery_RE_HV_Sodium.get(1L)}); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { + 400000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Titanium), + 'B', + ItemList.Battery_RE_MV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { + 300000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Titanium), + 'B', + ItemList.Battery_RE_MV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_MV, 1, werkstoff.getBridgeMaterial(), Materials.Aluminium, new long[] { + 200000L, 128L, 2L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_MV.get(1L), + 'S', + screw.get(Materials.Aluminium), + 'P', + plate.get(Materials.Aluminium), + 'G', + gearGtSmall.get(Materials.Titanium), + 'B', + ItemList.Battery_RE_MV_Sodium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { + 1600000L, 512L, 3L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Lithium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { + 1200000L, 512L, 3L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Cadmium.get(1L) + }); + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + SCREWDRIVER_HV, 1, werkstoff.getBridgeMaterial(), Materials.StainlessSteel, new long[] { + 800000L, 512L, 3L, -1L + }), + GT_ModHandler.RecipeBits.DISMANTLEABLE + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PdX", + "MGS", + "GBP", + 'X', + stickLong.get(werkstoff.getBridgeMaterial()), + 'M', + ItemList.Electric_Motor_HV.get(1L), + 'S', + screw.get(Materials.StainlessSteel), + 'P', + plate.get(Materials.StainlessSteel), + 'G', + gearGtSmall.get(Materials.StainlessSteel), + 'B', + ItemList.Battery_RE_HV_Sodium.get(1L) + }); } - // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", 'I', werkstoff.get(ingot)}); + // GT_ModHandler.addCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(16,1, + // werkstoff.getBridgeMaterial(),werkstoff.getBridgeMaterial(),null), + // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", + // "III", " I ", 'I', werkstoff.get(ingot)}); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java index 44c35c8543..3852602d72 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/AssociationLoader.java @@ -34,8 +34,7 @@ public class AssociationLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { for (OrePrefixes prefixes : OrePrefixes.values()) { - if (!werkstoff.hasItemType(prefixes)) - continue; + if (!werkstoff.hasItemType(prefixes)) continue; Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial(); ItemStack stack = WerkstoffLoader.getCorrespondingItemStackUnsafe(prefixes, werkstoff, 1); @@ -46,4 +45,4 @@ public class AssociationLoader implements IWerkstoffRunnable { } } } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java index bd8c441740..292e796e70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/BridgeMaterialsLoader.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; +import static gregtech.api.enums.OrePrefixes.*; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; @@ -33,19 +35,45 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; - -import static gregtech.api.enums.OrePrefixes.*; +import net.minecraft.item.ItemStack; public class BridgeMaterialsLoader implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { - //int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID - Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); + // int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int + // aR, int aG, int aB, int aA, String aName, String aDefaultLocalName, int aFuelType, int aFuelPower, int + // aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int + // aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String + // aCustomID + Materials werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL + ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().isBlastFurnace(), + false, + 0, + 1, + 1, + null); for (OrePrefixes prefixes : values()) { if (!(prefixes == cell && werkstoff.getType().equals(Werkstoff.Types.ELEMENT))) { if (prefixes == dust && werkstoff.getType().equals(Werkstoff.Types.ELEMENT)) { @@ -53,37 +81,80 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { boolean ElementSet = false; for (Element e : Element.values()) { if (e.toString().equals(werkstoff.getToolTip())) { - if (e.mLinkedMaterials.size() > 0) - break; - werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null ? werkstoff.getBridgeMaterial() : Materials.get(werkstoff.getVarName()) != Materials._NULL ? Materials.get(werkstoff.getVarName()) : - new Materials(-1, werkstoff.getTexSet(), werkstoff.getToolSpeed(), werkstoff.getDurability(), werkstoff.getToolQuality(), 0, werkstoff.getRGBA()[0], werkstoff.getRGBA()[1], werkstoff.getRGBA()[2], werkstoff.getRGBA()[3], werkstoff.getVarName(), werkstoff.getDefaultName(), 0, 0, werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().getMeltingPoint(), werkstoff.getStats().isBlastFurnace(), false, 0, 1, 1, null); + if (e.mLinkedMaterials.size() > 0) break; + werkstoffBridgeMaterial = werkstoff.getBridgeMaterial() != null + ? werkstoff.getBridgeMaterial() + : Materials.get(werkstoff.getVarName()) != Materials._NULL + ? Materials.get(werkstoff.getVarName()) + : new Materials( + -1, + werkstoff.getTexSet(), + werkstoff.getToolSpeed(), + werkstoff.getDurability(), + werkstoff.getToolQuality(), + 0, + werkstoff.getRGBA()[0], + werkstoff.getRGBA()[1], + werkstoff.getRGBA()[2], + werkstoff.getRGBA()[3], + werkstoff.getVarName(), + werkstoff.getDefaultName(), + 0, + 0, + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().getMeltingPoint(), + werkstoff.getStats().isBlastFurnace(), + false, + 0, + 1, + 1, + null); werkstoffBridgeMaterial.mElement = e; e.mLinkedMaterials = new ArrayList<>(); e.mLinkedMaterials.add(werkstoffBridgeMaterial); if (werkstoff.hasItemType(dust)) { - GT_OreDictUnificator.addAssociation(dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); - GT_OreDictUnificator.set(dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); + GT_OreDictUnificator.addAssociation( + dust, werkstoffBridgeMaterial, werkstoff.get(dust), false); + GT_OreDictUnificator.set( + dust, werkstoffBridgeMaterial, werkstoff.get(dust), true, true); } ElementSet = true; break; } } - if (!ElementSet) - continue; -// 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(); -// } + if (!ElementSet) continue; + // 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(); + // } if (werkstoff.hasItemType(dust)) { 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.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, new ItemStack[]{werkstoff.get(prefixes)}, new ItemStack[]{scannerOutput}, ItemList.Tool_DataOrb.get(1L), null, null, null, (int) (werkstoffBridgeMaterial.getMass() * 8192L), 30, 0)); - //GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, scannerOutput, null, new FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); + GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( + false, + new BWRecipes.DynamicGTRecipe( + false, + new ItemStack[] {werkstoff.get(prefixes)}, + new ItemStack[] {scannerOutput}, + ItemList.Tool_DataOrb.get(1L), + null, + null, + null, + (int) (werkstoffBridgeMaterial.getMass() * 8192L), + 30, + 0)); + // GT_Recipe.GT_Recipe_Map.sReplicatorFakeRecipes.addFakeRecipe(false, new + // BWRecipes.DynamicGTRecipe(false, null, new ItemStack[]{werkstoff.get(prefixes)}, + // scannerOutput, null, new + // FluidStack[]{Materials.UUMatter.getFluid(werkstoffBridgeMaterial.getMass())}, null, (int) + // (werkstoffBridgeMaterial.getMass() * 512L), 30, 0)); } } } @@ -96,24 +167,36 @@ public class BridgeMaterialsLoader implements IWerkstoffRunnable { } if (werkstoff.hasItemType(WerkstoffLoader.cellMolten)) { - werkstoffBridgeMaterial.mStandardMoltenFluid = werkstoff.getMolten(1).getFluid(); + werkstoffBridgeMaterial.mStandardMoltenFluid = + werkstoff.getMolten(1).getFluid(); } werkstoffBridgeMaterial.mName = werkstoff.getVarName(); werkstoffBridgeMaterial.mDefaultLocalName = werkstoff.getDefaultName(); werkstoffBridgeMaterial.mChemicalFormula = werkstoff.getToolTip(); if ("null".equals(werkstoffBridgeMaterial.mLocalizedName)) // only reload from lang file if not localized already - werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization("Material." + werkstoffBridgeMaterial.mName.toLowerCase(), werkstoffBridgeMaterial.mDefaultLocalName); - if (LoaderReference.Thaumcraft) - werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); + werkstoffBridgeMaterial.mLocalizedName = GT_LanguageManager.addStringLocalization( + "Material." + werkstoffBridgeMaterial.mName.toLowerCase(), + werkstoffBridgeMaterial.mDefaultLocalName); + if (LoaderReference.Thaumcraft) werkstoffBridgeMaterial.mAspects = werkstoff.getGTWrappedTCAspects(); werkstoffBridgeMaterial.mMaterialInto = werkstoffBridgeMaterial; - werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) ? Materials.Blaze : werkstoff.contains(SubTag.MAGICAL) ? Materials.Thaumium : werkstoffBridgeMaterial.mDurability > 5120 ? Materials.TungstenSteel : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; + werkstoffBridgeMaterial.mHandleMaterial = werkstoff.contains(SubTag.BURNING) + ? Materials.Blaze + : werkstoff.contains(SubTag.MAGICAL) + ? Materials.Thaumium + : werkstoffBridgeMaterial.mDurability > 5120 + ? Materials.TungstenSteel + : werkstoffBridgeMaterial.mDurability > 1280 ? Materials.Steel : Materials.Wood; if (werkstoff.getStats().isRadioactive()) { - werkstoffBridgeMaterial.setEnchantmentForArmors(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); - werkstoffBridgeMaterial.setEnchantmentForTools(Enchantment_Radioactivity.INSTANCE, werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForArmors( + Enchantment_Radioactivity.INSTANCE, + werkstoff.getStats().getEnchantmentlvl()); + werkstoffBridgeMaterial.setEnchantmentForTools( + Enchantment_Radioactivity.INSTANCE, + werkstoff.getStats().getEnchantmentlvl()); } werkstoff.setBridgeMaterial(werkstoffBridgeMaterial); - //if (WerkstoffLoader.items.get(prefixes) != null) + // if (WerkstoffLoader.items.get(prefixes) != null) } } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java index 8ffd3ea552..8caecb277c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/werkstoff_loaders/registration/CasingRegistrator.java @@ -22,27 +22,27 @@ package com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.registration; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; + import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.bartimaeusnek.bartworks.system.material.werkstoff_loaders.IWerkstoffRunnable; import gregtech.api.util.GT_OreDictUnificator; import net.minecraft.item.ItemStack; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasing; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.blockCasingAdvanced; - public class CasingRegistrator implements IWerkstoffRunnable { @Override public void run(Werkstoff werkstoff) { GT_OreDictUnificator.addAssociation( - blockCasing, werkstoff.getBridgeMaterial(), + blockCasing, + werkstoff.getBridgeMaterial(), new ItemStack(WerkstoffLoader.BWBlockCasings, 1, werkstoff.getmID()), - false - ); + false); GT_OreDictUnificator.addAssociation( - blockCasingAdvanced, werkstoff.getBridgeMaterial(), + blockCasingAdvanced, + werkstoff.getBridgeMaterial(), new ItemStack(WerkstoffLoader.BWBlockCasingsAdvanced, 1, werkstoff.getmID()), - false - ); + false); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java index 8d4fe889cb..288213d821 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/object/AbstractedStack.java @@ -23,15 +23,14 @@ package com.github.bartimaeusnek.bartworks.system.object; import com.github.bartimaeusnek.bartworks.util.Pair; +import java.io.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.io.*; - public class AbstractedStack implements Serializable { - final Pair<Integer,Short> idDamage; + final Pair<Integer, Short> idDamage; final NBTTagCompound mTag; @Override @@ -67,8 +66,7 @@ public class AbstractedStack implements Serializable { } public AbstractedStack(ItemStack itemStack) { - if (itemStack == null) - throw new UnsupportedOperationException(); + if (itemStack == null) throw new UnsupportedOperationException(); this.idDamage = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); this.mTag = itemStack.getTagCompound(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index afa6aaa98a..9229b08847 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -24,29 +24,26 @@ package com.github.bartimaeusnek.bartworks.system.oredict; import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.item.ItemStack; - import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.item.ItemStack; public class OreDictAdder { private static final ConcurrentHashMap<String, ItemStack> toAddMap = new ConcurrentHashMap<>(); - public static synchronized void addToMap(Pair<String, ItemStack> element){ - OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); + public static synchronized void addToMap(Pair<String, ItemStack> element) { + OreDictAdder.toAddMap.put(element.getKey(), element.getValue()); } @SafeVarargs - public static synchronized void addToMap(Pair<String, ItemStack>... elements){ - for (Pair<String, ItemStack> p : elements) - OreDictAdder.toAddMap.put(p.getKey(),p.getValue()); + public static synchronized void addToMap(Pair<String, ItemStack>... elements) { + for (Pair<String, ItemStack> p : elements) OreDictAdder.toAddMap.put(p.getKey(), p.getValue()); } - public static void addToOreDict(){ - for (Map.Entry<String, ItemStack> entry: OreDictAdder.toAddMap.entrySet()){ - GT_OreDictUnificator.registerOre(entry.getKey(),entry.getValue()); + public static void addToOreDict() { + for (Map.Entry<String, ItemStack> entry : OreDictAdder.toAddMap.entrySet()) { + GT_OreDictUnificator.registerOre(entry.getKey(), entry.getValue()); } } - -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 3e5984df6d..4e8efeeabd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -28,43 +28,45 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; - public class OreDictHandler { - private static final HashMap<String, Pair<Integer,Short>> cache = new HashMap<>(); - private static final HashSet<Pair<Integer,Short>> cacheNonBW = new HashSet<>(); + private static final HashMap<String, Pair<Integer, Short>> cache = new HashMap<>(); + private static final HashSet<Pair<Integer, Short>> cacheNonBW = new HashSet<>(); - public static HashMap<String, Pair<Integer,Short>> getCache() { + public static HashMap<String, Pair<Integer, Short>> getCache() { return OreDictHandler.cache; } - public static HashSet<Pair<Integer,Short>> getNonBWCache(){ + public static HashSet<Pair<Integer, Short>> getNonBWCache() { return OreDictHandler.cacheNonBW; } - public static void adaptCacheForWorld(){ + public static void adaptCacheForWorld() { Set<String> used = new HashSet<>(OreDictHandler.cache.keySet()); OreDictHandler.cache.clear(); OreDictHandler.cacheNonBW.clear(); for (String s : used) { if (!OreDictionary.getOres(s).isEmpty()) { ItemStack tmpstack = OreDictionary.getOres(s).get(0).copy(); - Pair<Integer, Short> p = new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); + Pair<Integer, Short> p = + new Pair<>(Item.getIdFromItem(tmpstack.getItem()), (short) tmpstack.getItemDamage()); OreDictHandler.cache.put(s, p); for (ItemStack tmp : OreDictionary.getOres(s)) { - Pair<Integer, Short> p2 = new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); + Pair<Integer, Short> p2 = + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage()); GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(tmp.getItem()); - if (UI == null) - UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); - if (!UI.modId.equals(MainMod.MOD_ID) && !UI.modId.equals(BartWorksCrossmod.MOD_ID) && !UI.modId.equals("BWCore")) { + if (UI == null) UI = GameRegistry.findUniqueIdentifierFor(Block.getBlockFromItem(tmp.getItem())); + if (!UI.modId.equals(MainMod.MOD_ID) + && !UI.modId.equals(BartWorksCrossmod.MOD_ID) + && !UI.modId.equals("BWCore")) { OreDictHandler.cacheNonBW.add(p2); } } @@ -72,14 +74,20 @@ public class OreDictHandler { } } - public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount){ - if (OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")) != null){ - Pair<Integer,Short> p = OreDictHandler.cache.get(prefixes+elementName.replaceAll(" ","")); - return new ItemStack(Item.getItemById(p.getKey()),amount,p.getValue()); - } else if (!OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).isEmpty()){ - ItemStack tmp = GT_OreDictUnificator.get(OreDictionary.getOres(prefixes+elementName.replaceAll(" ","")).get(0).copy()).copy(); - OreDictHandler.cache.put(prefixes+elementName.replaceAll(" ",""),new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); - tmp.stackSize=amount; + public static ItemStack getItemStack(String elementName, OrePrefixes prefixes, int amount) { + if (OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")) != null) { + Pair<Integer, Short> p = OreDictHandler.cache.get(prefixes + elementName.replaceAll(" ", "")); + return new ItemStack(Item.getItemById(p.getKey()), amount, p.getValue()); + } else if (!OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")) + .isEmpty()) { + ItemStack tmp = GT_OreDictUnificator.get(OreDictionary.getOres(prefixes + elementName.replaceAll(" ", "")) + .get(0) + .copy()) + .copy(); + OreDictHandler.cache.put( + prefixes + elementName.replaceAll(" ", ""), + new Pair<>(Item.getIdFromItem(tmp.getItem()), (short) tmp.getItemDamage())); + tmp.stackSize = amount; return tmp; } return null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index aa1023c9ba..b57e5c8914 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -32,6 +32,10 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; import gregtech.api.world.GT_Worldgen; import gregtech.common.blocks.GT_TileEntity_Ores; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -40,27 +44,35 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - /** * Original GT File Stripped and adjusted to work with this mod */ public abstract class BW_OreLayer extends GT_Worldgen { public static final List<BW_OreLayer> sList = new ArrayList<>(); - public static final ArrayListMultimap<Short,BW_OreLayer> NEIMAP = ArrayListMultimap.create(); + public static final ArrayListMultimap<Short, BW_OreLayer> NEIMAP = ArrayListMultimap.create(); private static final boolean logOregenRoss128 = false; public static int sWeight; public byte bwOres; public int mMinY, mWeight, mDensity, mSize, mMaxY, mPrimaryMeta, mSecondaryMeta, mBetweenMeta, mSporadicMeta; public abstract Block getDefaultBlockToReplace(); + public abstract int[] getDefaultDamageToReplace(); + public abstract String getDimName(); - public BW_OreLayer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + public BW_OreLayer( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + ISubTagContainer top, + ISubTagContainer bottom, + ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, BW_OreLayer.sList, aDefault); this.mMinY = (short) aMinY; this.mMaxY = (short) aMaxY; @@ -68,59 +80,58 @@ public abstract class BW_OreLayer extends GT_Worldgen { this.mDensity = (short) aDensity; this.mSize = (short) Math.max(1, aSize); - if (this.mEnabled) - BW_OreLayer.sWeight += this.mWeight; - - if (top instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b1000); - if (bottom instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0100); - if (between instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0010); - if (sprinkled instanceof Werkstoff) - this.bwOres = (byte) (this.bwOres | 0b0001); - - short aPrimary = top instanceof Materials ? - (short) ((Materials) top).mMetaItemSubID : - top instanceof Werkstoff ? - ((Werkstoff) top).getmID() : - 0; - short aSecondary = bottom instanceof Materials ? - (short) ((Materials) bottom).mMetaItemSubID : - bottom instanceof Werkstoff ? - ((Werkstoff) bottom).getmID() : - 0; - short aBetween = between instanceof Materials ? - (short) ((Materials) between).mMetaItemSubID : - between instanceof Werkstoff ? - ((Werkstoff) between).getmID() : - 0; - short aSporadic = sprinkled instanceof Materials ? - (short) ((Materials) sprinkled).mMetaItemSubID : - sprinkled instanceof Werkstoff ? - ((Werkstoff) sprinkled).getmID() : - 0; + if (this.mEnabled) BW_OreLayer.sWeight += this.mWeight; + + if (top instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b1000); + if (bottom instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0100); + if (between instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0010); + if (sprinkled instanceof Werkstoff) this.bwOres = (byte) (this.bwOres | 0b0001); + + short aPrimary = top instanceof Materials + ? (short) ((Materials) top).mMetaItemSubID + : top instanceof Werkstoff ? ((Werkstoff) top).getmID() : 0; + short aSecondary = bottom instanceof Materials + ? (short) ((Materials) bottom).mMetaItemSubID + : bottom instanceof Werkstoff ? ((Werkstoff) bottom).getmID() : 0; + short aBetween = between instanceof Materials + ? (short) ((Materials) between).mMetaItemSubID + : between instanceof Werkstoff ? ((Werkstoff) between).getmID() : 0; + short aSporadic = sprinkled instanceof Materials + ? (short) ((Materials) sprinkled).mMetaItemSubID + : sprinkled instanceof Werkstoff ? ((Werkstoff) sprinkled).getmID() : 0; this.mPrimaryMeta = aPrimary; this.mSecondaryMeta = aSecondary; this.mBetweenMeta = aBetween; this.mSporadicMeta = aSporadic; - NEIMAP.put((short) this.mPrimaryMeta,this); - NEIMAP.put((short) this.mSecondaryMeta,this); - NEIMAP.put((short) this.mBetweenMeta,this); - NEIMAP.put((short) this.mSporadicMeta,this); + NEIMAP.put((short) this.mPrimaryMeta, this); + NEIMAP.put((short) this.mSecondaryMeta, this); + NEIMAP.put((short) this.mBetweenMeta, this); + NEIMAP.put((short) this.mSporadicMeta, this); } - public List<ItemStack> getStacks(){ + public List<ItemStack> getStacks() { ArrayList<ItemStack> ret = new ArrayList<>(); - ret.add((this.bwOres & 0b1000) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mPrimaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mPrimaryMeta)); - ret.add((this.bwOres & 0b0100) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSecondaryMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSecondaryMeta)); - ret.add((this.bwOres & 0b0010) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mBetweenMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mBetweenMeta)); - ret.add((this.bwOres & 0b0001) != 0 ? new ItemStack(WerkstoffLoader.BWOres,1,this.mSporadicMeta) : new ItemStack ( GregTech_API.sBlockOres1,1,this.mSporadicMeta)); + ret.add( + (this.bwOres & 0b1000) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mPrimaryMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mPrimaryMeta)); + ret.add( + (this.bwOres & 0b0100) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSecondaryMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSecondaryMeta)); + ret.add( + (this.bwOres & 0b0010) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mBetweenMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mBetweenMeta)); + ret.add( + (this.bwOres & 0b0001) != 0 + ? new ItemStack(WerkstoffLoader.BWOres, 1, this.mSporadicMeta) + : new ItemStack(GregTech_API.sBlockOres1, 1, this.mSporadicMeta)); return ret; } - public List<Pair<Integer,Boolean>> getStacksRawData(){ - ArrayList<Pair<Integer,Boolean>> ret = new ArrayList<>(); + public List<Pair<Integer, Boolean>> getStacksRawData() { + ArrayList<Pair<Integer, Boolean>> ret = new ArrayList<>(); ret.add(new Pair<>(this.mPrimaryMeta, (this.bwOres & 0b1000) != 0)); ret.add(new Pair<>(this.mSecondaryMeta, (this.bwOres & 0b0100) != 0)); ret.add(new Pair<>(this.mBetweenMeta, (this.bwOres & 0b0010) != 0)); @@ -129,8 +140,16 @@ public abstract class BW_OreLayer extends GT_Worldgen { } @Override - public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { { - + public boolean executeWorldgen( + World aWorld, + Random aRandom, + String aBiome, + int aDimensionType, + int aChunkX, + int aChunkZ, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + { int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); int cX = aChunkX - aRandom.nextInt(this.mSize); int eX = aChunkX + 16 + aRandom.nextInt(this.mSize); @@ -152,7 +171,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } if (this.mBetweenMeta > 0 && shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ)) { - wasPlaced = this.setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); + wasPlaced = this.setOreBlock( + aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { @@ -164,7 +184,8 @@ public abstract class BW_OreLayer extends GT_Worldgen { } if (this.mSporadicMeta > 0 && (shouldPlace(aRandom, cX, eX, tX, cZ, eZ, tZ))) { - wasPlaced = this.setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); + wasPlaced = this.setOreBlock( + aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } } @@ -178,27 +199,49 @@ public abstract class BW_OreLayer extends GT_Worldgen { } private boolean shouldPlace(Random aRandom, int cX, int eX, int tX, int cZ, int eZ, int tZ) { - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) == 0) - return true; - if (aRandom.nextInt(Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) == 0) - return true; + if (aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) + == 0) return true; + if (aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) + == 0) return true; return false; } public boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean isSmallOre) { - //security stuff to prevent crashes with 2 TileEntites on the same Spot - TileEntity te = aWorld.getTileEntity(aX,aY,aZ); - if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) - return true; + // security stuff to prevent crashes with 2 TileEntites on the same Spot + TileEntity te = aWorld.getTileEntity(aX, aY, aZ); + if (te instanceof BW_MetaGeneratedOreTE || te instanceof GT_TileEntity_Ores) return true; - if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { - return isSmallOre ? BW_MetaGenerated_SmallOres.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()) : BW_MetaGenerated_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, this.getDefaultBlockToReplace(),this.getDefaultDamageToReplace()); + if ((aMetaData == this.mSporadicMeta && (this.bwOres & 0b0001) != 0) + || (aMetaData == this.mBetweenMeta && (this.bwOres & 0b0010) != 0) + || (aMetaData == this.mPrimaryMeta && (this.bwOres & 0b1000) != 0) + || (aMetaData == this.mSecondaryMeta && (this.bwOres & 0b0100) != 0)) { + return isSmallOre + ? BW_MetaGenerated_SmallOres.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()) + : BW_MetaGenerated_Ores.setOreBlock( + aWorld, + aX, + aY, + aZ, + aMetaData, + false, + this.getDefaultBlockToReplace(), + this.getDefaultDamageToReplace()); } return this.setGTOreBlockSpace(aWorld, aX, aY, aZ, aMetaData, this.getDefaultBlockToReplace()); } - public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block){ + public boolean setGTOreBlockSpace(World aWorld, int aX, int aY, int aZ, int aMetaData, Block block) { if (!GT_TileEntity_Ores.setOreBlock(aWorld, aX, aY, aZ, aMetaData, false, false)) { aY = Math.min(aWorld.getActualHeight(), Math.max(aY, 1)); Block tBlock = aWorld.getBlock(aX, aY, aZ); @@ -217,8 +260,7 @@ public abstract class BW_OreLayer extends GT_Worldgen { } return true; } - }else - return true; + } else return true; } @Override @@ -242,6 +284,21 @@ public abstract class BW_OreLayer extends GT_Worldgen { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(37).put(bwOres).putInt(mMinY).putInt(mWeight).putInt(mDensity).putInt(mSize).putInt(mMaxY).putInt(mPrimaryMeta).putInt(mSecondaryMeta).putInt(mBetweenMeta).putInt(mSporadicMeta).array(),0,37,31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(37) + .put(bwOres) + .putInt(mMinY) + .putInt(mWeight) + .putInt(mDensity) + .putInt(mSize) + .putInt(mMaxY) + .putInt(mPrimaryMeta) + .putInt(mSecondaryMeta) + .putInt(mBetweenMeta) + .putInt(mSporadicMeta) + .array(), + 0, + 37, + 31); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 6677e6ab79..47f2a85ae7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -22,30 +22,36 @@ package com.github.bartimaeusnek.bartworks.system.oregen; - import cpw.mods.fml.common.IWorldGenerator; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Log; +import java.util.HashSet; +import java.util.Random; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -import java.util.HashSet; -import java.util.Random; - /** * Original GT File Stripped and adjusted to work with this mod */ public class BW_WordGenerator implements IWorldGenerator { public BW_WordGenerator() { - //GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider - //GameRegistry.registerWorldGenerator(this, 1073741823); + // GT_NH Override... wont be actually registered to force its generation directly in the ChunkProvider + // GameRegistry.registerWorldGenerator(this, 1073741823); } - public synchronized void generate(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { - new BW_WordGenerator.WorldGenContainer(aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider).run(); + public synchronized void generate( + Random aRandom, + int aX, + int aZ, + World aWorld, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { + new BW_WordGenerator.WorldGenContainer( + aX * 16, aZ * 16, aWorld.provider.dimensionId, aWorld, aChunkGenerator, aChunkProvider) + .run(); } public static class WorldGenContainer implements Runnable { @@ -57,7 +63,13 @@ public class BW_WordGenerator implements IWorldGenerator { public int mX; public int mZ; - public WorldGenContainer(int aX, int aZ, int aDimensionType, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { + public WorldGenContainer( + int aX, + int aZ, + int aDimensionType, + World aWorld, + IChunkProvider aChunkGenerator, + IChunkProvider aChunkProvider) { this.mX = aX; this.mZ = aZ; this.mDimensionType = aDimensionType; @@ -66,7 +78,7 @@ public class BW_WordGenerator implements IWorldGenerator { this.mChunkProvider = aChunkProvider; } - //returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square + // returns a coordinate of a center chunk of 3x3 square; the argument belongs to this square public int getVeinCenterCoordinate(int c) { c += c < 0 ? 1 : 3; return c - c % 3 - 2; @@ -93,7 +105,8 @@ public class BW_WordGenerator implements IWorldGenerator { xCenter <<= 4; zCenter <<= 4; ChunkCoordIntPair centerChunk = new ChunkCoordIntPair(xCenter, zCenter); - if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) && this.surroundingChunksLoaded(xCenter, zCenter)) { + if (!BW_WordGenerator.WorldGenContainer.mGenerated.contains(centerChunk) + && this.surroundingChunksLoaded(xCenter, zCenter)) { BW_WordGenerator.WorldGenContainer.mGenerated.add(centerChunk); if ((BW_OreLayer.sWeight > 0) && (BW_OreLayer.sList.size() > 0)) { boolean temp = true; @@ -109,10 +122,17 @@ public class BW_WordGenerator implements IWorldGenerator { boolean placed; int attempts = 0; do { - placed = tWorldGen.executeWorldgen(this.mWorld, random, "", this.mDimensionType, xCenter, zCenter, this.mChunkGenerator, this.mChunkProvider); + placed = tWorldGen.executeWorldgen( + this.mWorld, + random, + "", + this.mDimensionType, + xCenter, + zCenter, + this.mChunkGenerator, + this.mChunkProvider); ++attempts; - } - while ((!placed) && attempts < 25); + } while ((!placed) && attempts < 25); temp = false; break; } catch (Throwable e) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 9e1673dc83..d7135a8d5d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.bartworks.system.oregen; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; +import static gregtech.api.enums.Materials.*; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; @@ -30,19 +34,15 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidRegistry; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -import static gregtech.api.enums.Materials.*; - public class BW_WorldGenRoss128b extends BW_OreLayer { - public Block getDefaultBlockToReplace(){ + public Block getDefaultBlockToReplace() { return Blocks.stone; } @Override public int[] getDefaultDamageToReplace() { - return new int[]{0}; + return new int[] {0}; } @Override @@ -50,27 +50,78 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { return StatCollector.translateToLocal("planet.Ross128b"); } - public BW_WorldGenRoss128b(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + public BW_WorldGenRoss128b( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + ISubTagContainer top, + ISubTagContainer bottom, + ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } public static void initOres() { - new BW_WorldGenRoss128b("ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Thorianit", true, 30, 60, 17, 1, 16, Thorianit, Uraninite, Lepidolite, Spodumene); new BW_WorldGenRoss128b("ore.mix.ross128.carbon", true, 5, 25, 5, 4, 12, Graphite, Diamond, Coal, Graphite); - new BW_WorldGenRoss128b("ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); - new BW_WorldGenRoss128b("ore.mix.ross128.TurmalinAlkali", true, 5, 80, 15, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); - new BW_WorldGenRoss128b("ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit); - new BW_WorldGenRoss128b("ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); - new BW_WorldGenRoss128b("ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); - new BW_WorldGenRoss128b("ore.mix.ross128.Forsterit", true, 20, 90, 50, 2, 32, Forsterit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.Hedenbergit", true, 20, 90, 50, 2, 32, Hedenbergit, Fayalit, DescloiziteCUVO4, DescloiziteZNVO4); - new BW_WorldGenRoss128b("ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + new BW_WorldGenRoss128b( + "ore.mix.ross128.bismuth", true, 5, 80, 30, 1, 16, Bismuthinit, Stibnite, Bismuth, Bismutite); + new BW_WorldGenRoss128b( + "ore.mix.ross128.TurmalinAlkali", + true, + 5, + 80, + 15, + 4, + 48, + Olenit, + FluorBuergerit, + ChromoAluminoPovondrait, + VanadioOxyDravit); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Roquesit", true, 30, 50, 3, 1, 12, Arsenopyrite, Ferberite, Loellingit, Roquesit); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Tungstate", true, 5, 40, 10, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128b( + "ore.mix.ross128.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Forsterit", + true, + 20, + 90, + 50, + 2, + 32, + Forsterit, + Fayalit, + DescloiziteCUVO4, + DescloiziteZNVO4); + new BW_WorldGenRoss128b( + "ore.mix.ross128.Hedenbergit", + true, + 20, + 90, + 50, + 2, + 32, + Hedenbergit, + Fayalit, + DescloiziteCUVO4, + DescloiziteZNVO4); + new BW_WorldGenRoss128b( + "ore.mix.ross128.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); } public static void initundergroundFluids() { String ross128b = StatCollector.translateToLocal("planet.Ross128b"); uo_dimensionList.SetConfigValues(ross128b, ross128b, "veryheavyoil", "liquid_extra_heavy_oil", 0, 625, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); + uo_dimensionList.SetConfigValues( + ross128b, ross128b, "lava", FluidRegistry.getFluidName(FluidRegistry.LAVA), 0, 820, 5, 5); uo_dimensionList.SetConfigValues(ross128b, ross128b, "gas_natural_gas", "gas_natural_gas", 0, 625, 65, 5); } @@ -78,5 +129,4 @@ public class BW_WorldGenRoss128b extends BW_OreLayer { public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aDimensionType == ConfigHandler.ross128BID; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index f0682e53b4..074e1fc6b5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -22,19 +22,30 @@ package com.github.bartimaeusnek.bartworks.system.oregen; +import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; +import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; +import static gregtech.api.enums.Materials.*; + import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.interfaces.ISubTagContainer; import net.minecraft.block.Block; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; -import static com.github.bartimaeusnek.crossmod.galacticraft.GalacticraftProxy.uo_dimensionList; -import static gregtech.api.enums.Materials.*; - -public class BW_WorldGenRoss128ba extends BW_OreLayer { +public class BW_WorldGenRoss128ba extends BW_OreLayer { - public BW_WorldGenRoss128ba(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, ISubTagContainer top, ISubTagContainer bottom, ISubTagContainer between, ISubTagContainer sprinkled) { + public BW_WorldGenRoss128ba( + String aName, + boolean aDefault, + int aMinY, + int aMaxY, + int aWeight, + int aDensity, + int aSize, + ISubTagContainer top, + ISubTagContainer bottom, + ISubTagContainer between, + ISubTagContainer sprinkled) { super(aName, aDefault, aMinY, aMaxY, aWeight, aDensity, aSize, top, bottom, between, sprinkled); } @@ -42,12 +53,12 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { public Block getDefaultBlockToReplace() { return Block.getBlockFromName("GalacticraftCore:tile.moonBlock"); } + @Override - public int[] getDefaultDamageToReplace(){ + public int[] getDefaultDamageToReplace() { int[] ret = new int[12]; for (int i = 0; i < 12; i++) { - if (i != 5 && i != 3) - ret[i] = i; + if (i != 5 && i != 3) ret[i] = i; } return ret; } @@ -58,25 +69,88 @@ public class BW_WorldGenRoss128ba extends BW_OreLayer { } public static void init_Ores() { - new BW_WorldGenRoss128ba("ore.mix.ross128ba.tib", true, 30, 60, 6, 1, 16, Tiberium, Tiberium, NaquadahEnriched, NaquadahEnriched); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.bart", true, 30, 60, 1, 1, 1, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK, BArTiMaEuSNeK); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.TurmalinAlkali", true, 5, 80, 60, 4, 48, Olenit, FluorBuergerit, ChromoAluminoPovondrait, VanadioOxyDravit); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.CopperSulfits", true, 40, 70, 80, 3, 24, Djurleit, Bornite, Wittichenit, Tetrahedrite); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); - new BW_WorldGenRoss128ba("ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.tib", + true, + 30, + 60, + 6, + 1, + 16, + Tiberium, + Tiberium, + NaquadahEnriched, + NaquadahEnriched); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.Tungstate", true, 5, 40, 60, 4, 14, Ferberite, Huebnerit, Loellingit, Scheelite); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.bart", + true, + 30, + 60, + 1, + 1, + 1, + BArTiMaEuSNeK, + BArTiMaEuSNeK, + BArTiMaEuSNeK, + BArTiMaEuSNeK); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.TurmalinAlkali", + true, + 5, + 80, + 60, + 4, + 48, + Olenit, + FluorBuergerit, + ChromoAluminoPovondrait, + VanadioOxyDravit); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.Amethyst", true, 5, 80, 35, 2, 8, Amethyst, Olivine, Prasiolite, Hedenbergit); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.CopperSulfits", + true, + 40, + 70, + 80, + 3, + 24, + Djurleit, + Bornite, + Wittichenit, + Tetrahedrite); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.RedZircon", true, 10, 80, 40, 3, 24, Fayalit, FuchsitAL, RedZircon, FuchsitCR); + new BW_WorldGenRoss128ba( + "ore.mix.ross128ba.Fluorspar", true, 10, 80, 35, 4, 8, Galena, Sphalerite, Fluorspar, Barite); } public static void init_undergroundFluids() { String ross128b = StatCollector.translateToLocal("moon.Ross128ba"); - uo_dimensionList.SetConfigValues(ross128b, ross128b, SaltWater.getFluid(1).getFluid().getName(), SaltWater.getFluid(1).getFluid().getName(), 0, 1250, 40, 5); - uo_dimensionList.SetConfigValues(ross128b, ross128b, Helium_3.getGas(1).getFluid().getName(), Helium_3.getGas(1).getFluid().getName(), 0, 1250, 60, 5); + uo_dimensionList.SetConfigValues( + ross128b, + ross128b, + SaltWater.getFluid(1).getFluid().getName(), + SaltWater.getFluid(1).getFluid().getName(), + 0, + 1250, + 40, + 5); + uo_dimensionList.SetConfigValues( + ross128b, + ross128b, + Helium_3.getGas(1).getFluid().getName(), + Helium_3.getGas(1).getFluid().getName(), + 0, + 1250, + 60, + 5); } @Override public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) { return aDimensionType == ConfigHandler.ross128BAID; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 33c36d270a..3d55084ade 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -24,9 +24,8 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import gregtech.api.GregTech_API; -import net.minecraft.block.Block; - import java.util.Random; +import net.minecraft.block.Block; public class GT_WorldgenUtil { @@ -34,23 +33,23 @@ public class GT_WorldgenUtil { public static final Block GT_TILES = GregTech_API.sBlockMachines; - public static short getGenerator(Random rand,int tier){ + public static short getGenerator(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[0][tier][rand.nextInt(ConfigHandler.metasForTiers[0][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getGenerator(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getGenerator(rand, tier); } - public static short getBuffer(Random rand,int tier){ + public static short getBuffer(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[1][tier][rand.nextInt(ConfigHandler.metasForTiers[1][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getBuffer(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getBuffer(rand, tier); } - public static short getCable(Random rand,int tier){ + public static short getCable(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[2][tier][rand.nextInt(ConfigHandler.metasForTiers[2][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getCable(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getCable(rand, tier); } - public static short getMachine(Random rand,int tier){ + public static short getMachine(Random rand, int tier) { int meta = ConfigHandler.metasForTiers[3][tier][rand.nextInt(ConfigHandler.metasForTiers[3][tier].length)]; - return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getMachine(rand,tier); + return GregTech_API.METATILEENTITIES[meta] != null ? (short) meta : GT_WorldgenUtil.getMachine(rand, tier); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index 29eb79ebdc..7c0fd41935 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.system.worldgen; +import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss; +import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; + import com.github.bartimaeusnek.bartworks.util.Pair; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -31,6 +34,8 @@ import gregtech.api.metatileentity.MetaPipeEntity; import gregtech.api.objects.XSTR; import gregtech.api.threads.GT_Runnable_MachineBlockUpdate; import gregtech.api.util.GT_Utility; +import java.security.SecureRandom; +import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -40,11 +45,6 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ChestGenHooks; -import java.security.SecureRandom; -import java.util.Random; - -import static com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler.maxTierRoss; -import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; @SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { @@ -85,11 +85,10 @@ public abstract class MapGenRuins extends WorldGenerator { int[] statBlocks = new int[4]; - protected void setRandomBlockWAirChance(World worldObj, int x, int y, int z, Random rand, int airchance, Pair<Block, Integer>... blocks) { - if (rand.nextInt(100) > airchance) - this.setRandomBlock(worldObj, x, y, z, rand, blocks); - else - this.setBlock(worldObj, x, y, z, Blocks.air, 0); + protected void setRandomBlockWAirChance( + World worldObj, int x, int y, int z, Random rand, int airchance, Pair<Block, Integer>... blocks) { + if (rand.nextInt(100) > airchance) this.setRandomBlock(worldObj, x, y, z, rand, blocks); + else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } protected void setRandomBlock(World worldObj, int x, int y, int z, Random rand, Pair<Block, Integer>... blocks) { @@ -115,7 +114,13 @@ public abstract class MapGenRuins extends WorldGenerator { } if (isEnabled) throw new IllegalStateException("Machine Block Runnable needs to be disabled while creating world!"); - this.setBlockAndNotifyAdequately(worldObj, x, y, z, GT_WorldgenUtil.GT_TILES, GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); + this.setBlockAndNotifyAdequately( + worldObj, + x, + y, + z, + GT_WorldgenUtil.GT_TILES, + GregTech_API.METATILEENTITIES[meta].getTileEntityBaseType()); TileEntity tile = worldObj.getTileEntity(x, y, z); ((IGregTechTileEntity) tile).setInitialValuesAsNBT(null, (short) meta); return tile; @@ -130,15 +135,13 @@ public abstract class MapGenRuins extends WorldGenerator { protected void setGTMachineBlockWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { if (rand.nextInt(100) > airchance) { this.setGTMachineBlock(worldObj, x, y, z, meta); - } else - this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } protected void setGTCablekWChance(World worldObj, int x, int y, int z, Random rand, int airchance, int meta) { if (rand.nextInt(100) > airchance) { this.setGTCable(worldObj, x, y, z, meta); - } else - this.setBlock(worldObj, x, y, z, Blocks.air, 0); + } else this.setBlock(worldObj, x, y, z, Blocks.air, 0); } protected void setGTMachine(World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { @@ -158,7 +161,16 @@ public abstract class MapGenRuins extends WorldGenerator { } } - private void checkTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing, int depth) { + private void checkTile( + BaseMetaTileEntity BTE, + World worldObj, + int x, + int y, + int z, + int meta, + String ownerName, + byte facing, + int depth) { if (depth < 25) { if (BTE.getMetaTileID() != meta || worldObj.getTileEntity(x, y, z) != BTE || BTE.isInvalid()) { redoTile(BTE, worldObj, x, y, z, meta, ownerName, facing); @@ -170,7 +182,8 @@ public abstract class MapGenRuins extends WorldGenerator { } } - private void redoTile(BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { + private void redoTile( + BaseMetaTileEntity BTE, World worldObj, int x, int y, int z, int meta, String ownerName, byte facing) { reSetGTTileEntity(BTE, worldObj, x, y, z, meta); BTE = (BaseMetaTileEntity) worldObj.getTileEntity(x, y, z); BTE.setOwnerName(ownerName); @@ -217,11 +230,11 @@ public abstract class MapGenRuins extends WorldGenerator { } } - this.setFloorBlocks(new int[]{0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); - this.setWallBlocks(new int[]{0, 1, 2, 1, 1}, Blocks.stonebrick); - this.setRoofBlocks(new int[]{9}, Blocks.log); - this.setMiscBlocks(new int[]{1}, Blocks.log); - this.statBlocks = new int[]{rand.nextInt(this.ToBuildWith[0].length)}; + this.setFloorBlocks(new int[] {0, 0, 0}, Blocks.brick_block, Blocks.double_stone_slab, Blocks.stonebrick); + this.setWallBlocks(new int[] {0, 1, 2, 1, 1}, Blocks.stonebrick); + this.setRoofBlocks(new int[] {9}, Blocks.log); + this.setMiscBlocks(new int[] {1}, Blocks.log); + this.statBlocks = new int[] {rand.nextInt(this.ToBuildWith[0].length)}; int colored = rand.nextInt(15); int tier = secureRandom.nextInt(maxTierRoss); boolean useColor = rand.nextBoolean(); @@ -239,25 +252,40 @@ public abstract class MapGenRuins extends WorldGenerator { this.setBlock(worldObj, x + dx, y + 0, z + dz, floor.getKey(), floor.getValue()); } else if (dy > 0 && dy < 4) { if (Math.abs(dx) == 5 && Math.abs(dz) == 5) { - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 5, this.ToBuildWith[3][0]); } else if ((dx == 0) && dz == -5 && (dy == 1 || dy == 2)) { - if (dy == 1) - this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); - if (dy == 2) - this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); + if (dy == 1) this.setBlock(worldObj, x + dx, y + 1, z + -5, Blocks.iron_door, 1); + if (dy == 2) this.setBlock(worldObj, x + dx, y + 2, z + dz, Blocks.iron_door, 8); } else if (Math.abs(dx) == 5 && Math.abs(dz) < 5 || Math.abs(dz) == 5 && Math.abs(dx) < 5) { - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); if (dy == 2) { if (rand.nextInt(100) < 12) if (useColor) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 2, z + dz, rand, 25, new Pair<>(Blocks.stained_glass_pane, colored)); + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + 2, + z + dz, + rand, + 25, + new Pair<>(Blocks.stained_glass_pane, colored)); else - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, new Pair<>(Blocks.glass_pane, 0)); + this.setRandomBlockWAirChance( + worldObj, + x + dx, + y + dy, + z + dz, + rand, + 25, + new Pair<>(Blocks.glass_pane, 0)); } } if (dy == 3 && Math.abs(dx) == 6) { - this.setRandomBlockWAirChance(worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 3, z + dz, rand, 25, this.ToBuildWith[2]); } if (dy == 1) { @@ -268,13 +296,24 @@ public abstract class MapGenRuins extends WorldGenerator { this.setBlock(worldObj, x + -3, y + dy, z + dz, Blocks.chest, 5); IInventory chest = (IInventory) worldObj.getTileEntity(x + dx, y + dy, z + dz); if (chest != null) { - WeightedRandomChestContent.generateChestContents(secureRandom, ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), chest, ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); + WeightedRandomChestContent.generateChestContents( + secureRandom, + ChestGenHooks.getItems(PYRAMID_JUNGLE_CHEST, rand), + chest, + ChestGenHooks.getCount(PYRAMID_JUNGLE_CHEST, rand)); } } if (dx == 4 && dz == 4) { short meta = GT_WorldgenUtil.getGenerator(secureRandom, tier); - this.setGTMachine(worldObj, x + dx, y + dy, z + dz, meta, owner, tier > 0 ? (byte) 4 : (byte) 2); + this.setGTMachine( + worldObj, + x + dx, + y + dy, + z + dz, + meta, + owner, + tier > 0 ? (byte) 4 : (byte) 2); } else if (dx == 3 && dz == 4) { if (tier > 0) { short meta = GT_WorldgenUtil.getBuffer(secureRandom, tier); @@ -294,34 +333,42 @@ public abstract class MapGenRuins extends WorldGenerator { lastset = true; } else { lastset = rand.nextBoolean(); - if (lastset) - treeinaRow++; + if (lastset) treeinaRow++; } } } } else if (dy == 4) { if (Math.abs(dx) == 5) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 4, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 5) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 5) { if (Math.abs(dx) == 4) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 5, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 4) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 6) { if (Math.abs(dx) == 3) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 6, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 3) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 7) { if (Math.abs(dx) == 2) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 7, z + dz, rand, 25, this.ToBuildWith[2]); else if (Math.abs(dz) == 5 && Math.abs(dx) < 2) - this.setRandomBlockWAirChance(worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + dy, z + dz, rand, 25, this.ToBuildWith[1]); } else if (dy == 8) { if (Math.abs(dx) == 1 || Math.abs(dx) == 0) - this.setRandomBlockWAirChance(worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); + this.setRandomBlockWAirChance( + worldObj, x + dx, y + 8, z + dz, rand, 25, this.ToBuildWith[2]); } } } @@ -341,15 +388,12 @@ public abstract class MapGenRuins extends WorldGenerator { lastset = true; } else { lastset = rand.nextBoolean(); - if (lastset) - treeinaRow++; + if (lastset) treeinaRow++; } - } else - break tosetloop; + } else break tosetloop; } } return true; } } - -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 4e3b6ffc4a..7f9150f0dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -22,6 +22,9 @@ package com.github.bartimaeusnek.bartworks.util; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; +import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; + import com.github.bartimaeusnek.bartworks.MainMod; import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; import gregtech.api.GregTech_API; @@ -34,6 +37,8 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import ic2.core.item.ItemFluidCell; +import java.util.*; +import javax.annotation.Nonnegative; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; @@ -41,12 +46,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnegative; -import java.util.*; - -import static com.github.bartimaeusnek.bartworks.util.BW_Util.calculateSv; -import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte; - public class BWRecipes { public static final BWRecipes instance = new BWRecipes(); @@ -61,36 +60,67 @@ public class BWRecipes { StatCollector.translateToLocal("tile.biolab.name"), null, "gregtech:textures/gui/basicmachines/BW.GUI.BioLab", - 6, 2, 1, 1, 1, - "", 1, "", true, false //special handler - ); + 6, + 2, + 1, + 1, + 1, + "", + 1, + "", + true, + false // special handler + ); private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( new HashSet<>(50), "bw.recipe.BacteriaVat", StatCollector.translateToLocal("tile.biovat.name"), null, "gregtech:textures/gui/basicmachines/Default", - 6, 2, 0, 1, 1, - " Sievert: ", 1, " Sv", true, false //special handler - ); + 6, + 2, + 0, + 1, + 1, + " Sievert: ", + 1, + " Sv", + true, + false // special handler + ); private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( new HashSet<>(10), "bw.fuels.acidgens", StatCollector.translateToLocal("tile.acidgenerator.name"), null, "gregtech:textures/gui/basicmachines/Default", - 1, 1, 1, 1, 1, - "EU generated: ", 1000, "", false, true - ); + 1, + 1, + 1, + 1, + 1, + "EU generated: ", + 1000, + "", + false, + true); private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( new HashSet<>(60), "bw.recipe.cal", "Circuit Assembly Line", null, "gregtech:textures/gui/basicmachines/Default", - 6, 6, 1, 1, 1, - "", 1, "", true, true //special handler - ); + 6, + 6, + 1, + 1, + 1, + "", + 1, + "", + true, + true // special handler + ); /** * @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine @@ -108,71 +138,270 @@ public class BWRecipes { default: return null; } - } - public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipe( + ItemStack[] aInputs, + ItemStack aOutput, + ItemStack aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } - public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeIncubation( + ItemStack aInput, + BioCulture aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + new ItemStack[] {BioItemList.getPetriDish(null), aInput}, + new ItemStack[] {BioItemList.getPetriDish(aOutput)}, + null, + aChances, + aFluidInputs, + new FluidStack[] {GT_Values.NF}, + aDuration, + aEUt, + aSpecialValue)) + != null; } - public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeIncubation( + ItemStack aInput, + BioCulture aOutput, + int[] aChances, + FluidStack aFluidInputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + new ItemStack[] {BioItemList.getPetriDish(null), aInput}, + new ItemStack[] {BioItemList.getPetriDish(aOutput)}, + null, + aChances, + new FluidStack[] {aFluidInputs}, + new FluidStack[] {GT_Values.NF}, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeDNAExtraction( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[0], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipePCRThermoclycling( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[1], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipePlasmidSynthesis( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[2], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeTransformation( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[3], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null; + public boolean addBioLabRecipeClonalCellularSynthesis( + ItemStack[] aInputs, + ItemStack aOutput, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + return sBiolab.addRecipe(new DynamicGTRecipe( + true, + aInputs, + new ItemStack[] {aOutput}, + BioItemList.mBioLabParts[4], + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue)) + != null; } @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative byte glasTier) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + ItemStack[] aOutputs, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + @Nonnegative byte glasTier) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 6; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + aOutputs, + null, + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture aCulture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + @Nonnegative int aDuration, + @Nonnegative int aEUt, + @Nonnegative int aSv, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; - if (aSv >= 83 || aSv == 61 || aSv == 43) - aSievert += aSv; + if (aSv >= 83 || aSv == 61 || aSv == 43) aSievert += aSv; aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture aCulture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -183,21 +412,60 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } @Deprecated - public boolean addBacterialVatRecipe(ItemStack[] aInputs, ItemStack[] aOutputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + ItemStack[] aOutputs, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); aSievert = aSievert << 1; aSievert = aSievert | (exactSv ? 1 : 0); aSievert = aSievert << 6; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + aOutputs, + null, + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture culture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + int aSpecialValue, + boolean exactSv) { int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) aSievert += calculateSv(material); @@ -206,27 +474,82 @@ public class BWRecipes { aSievert = aSievert << 2; aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } /** * Adds a Vat recipe without Rad requirements but with Glas requirements */ - public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) { + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture culture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + byte glasTier) { int aSievert = 0; aSievert = aSievert | glasTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } /** * Adds a Vat recipe without Rad or Glas requirements */ - public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) { - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null; + public boolean addBacterialVatRecipe( + ItemStack[] aInputs, + FluidStack[] aFluidInputs, + BioCulture culture, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt) { + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + false, + aInputs, + null, + BioItemList.getPetriDish(culture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + 0)) + != null; } - - public boolean addTrimmedBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) { + public boolean addTrimmedBacterialVatRecipe( + ItemStack[] aInputs, + BioCulture aCulture, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + Materials material, + @Nonnegative int glasTier, + int aSpecialValue, + boolean exactSv) { byte gTier = (byte) glasTier; int aSievert = 0; if (material.getProtons() >= 83 || material.getProtons() == 61 || material.getProtons() == 43) @@ -237,13 +560,45 @@ public class BWRecipes { aSievert = aSievert | specialToByte(aSpecialValue); aSievert = aSievert << 4; aSievert = aSievert | gTier; - return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null; + return sBacteriaVat.addRecipe(new BacteriaVatRecipe( + true, + aInputs, + null, + BioItemList.getPetriDish(aCulture), + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSievert)) + != null; } public static class DynamicGTRecipe extends GT_Recipe { - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue, GT_Recipe originalRecipe) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + public DynamicGTRecipe( + boolean aOptimize, + ItemStack[] aInputs, + ItemStack[] aOutputs, + Object aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue, + GT_Recipe originalRecipe) { + super( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); if (originalRecipe != null) { this.owners = new ArrayList<>(originalRecipe.owners); this.stackTraces = new ArrayList<>(originalRecipe.stackTraces); @@ -251,16 +606,66 @@ public class BWRecipes { } } - public DynamicGTRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - this(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue, null); + public DynamicGTRecipe( + boolean aOptimize, + ItemStack[] aInputs, + ItemStack[] aOutputs, + Object aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + this( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue, + null); } - } public static class BW_Recipe_Map_LiquidFuel extends GT_Recipe.GT_Recipe_Map_Fuel { - public BW_Recipe_Map_LiquidFuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public BW_Recipe_Map_LiquidFuel( + Collection<GT_Recipe> aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } public GT_Recipe addLiquidFuel(Materials M, int burn) { @@ -268,51 +673,108 @@ public class BWRecipes { } public GT_Recipe addMoltenFuel(Materials M, int burn) { - return super.addFuel(ItemFluidCell.getUniversalFluidCell(M.getMolten(144L)), Ic2Items.FluidCell.copy(), burn); + return super.addFuel( + ItemFluidCell.getUniversalFluidCell(M.getMolten(144L)), Ic2Items.FluidCell.copy(), burn); } public GT_Recipe addLiquidFuel(FluidStack fluidStack, int burn) { return super.addFuel(ItemFluidCell.getUniversalFluidCell(fluidStack), Ic2Items.FluidCell.copy(), burn); } - } public static class BacteriaVatRecipe extends GT_Recipe { - public BacteriaVatRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) { - super(aOptimize, aInputs, aOutputs, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); + public BacteriaVatRecipe( + boolean aOptimize, + ItemStack[] aInputs, + ItemStack[] aOutputs, + ItemStack aSpecialItems, + int[] aChances, + FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, + int aDuration, + int aEUt, + int aSpecialValue) { + super( + aOptimize, + aInputs, + aOutputs, + aSpecialItems, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aSpecialValue); } - } public static class BacteriaVatRecipeMap extends BWRecipes.SpecialObjectSensitiveMap { - public BacteriaVatRecipeMap(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public BacteriaVatRecipeMap( + Collection<GT_Recipe> aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } - protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { + protected GT_Recipe addRecipe( + GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) { aRecipe.mHidden = aHidden; aRecipe.mFakeRecipe = aFakeRecipe; - GT_Recipe isthere = this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); + GT_Recipe isthere = + this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs); - if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) { + if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids + && aRecipe.mInputs.length < this.mMinimalInputItems) { return null; } else { - return aCheckForCollisions && isthere != null && BW_Util.areStacksEqualOrNull((ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) ? null : this.add(aRecipe); + return aCheckForCollisions + && isthere != null + && BW_Util.areStacksEqualOrNull( + (ItemStack) isthere.mSpecialItems, (ItemStack) aRecipe.mSpecialItems) + ? null + : this.add(aRecipe); } } public GT_Recipe addRecipe(GT_Recipe aRecipe, boolean VanillaGT) { - if (VanillaGT) - return addRecipe(aRecipe, true, false, false); - else - return addRecipe(aRecipe); + if (VanillaGT) return addRecipe(aRecipe, true, false, false); + else return addRecipe(aRecipe); } public GT_Recipe addRecipe(GT_Recipe aRecipe) { - if (aRecipe.mInputs.length > 0 && GT_Utility.areStacksEqual(aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) + if (aRecipe.mInputs.length > 0 + && GT_Utility.areStacksEqual( + aRecipe.mInputs[aRecipe.mInputs.length - 1], GT_Utility.getIntegratedCircuit(32767))) return aRecipe; else { ItemStack[] nu1 = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1); @@ -326,21 +788,49 @@ public class BWRecipes { nu[nu.length - 1] = GT_Utility.getIntegratedCircuit(i); i++; aRecipe.mInputs = nu; - if (i > 24) - i = 1; - if (i == 9 + nu.length) - return null; - } - while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null); + if (i > 24) i = 1; + if (i == 9 + nu.length) return null; + } while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) + != null); } return this.addRecipe(aRecipe, false, false, false); } } - public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map{ - - public SpecialObjectSensitiveMap(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public static class SpecialObjectSensitiveMap extends GT_Recipe.GT_Recipe_Map { + + public SpecialObjectSensitiveMap( + Collection<GT_Recipe> aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } /** @@ -356,12 +846,22 @@ public class BWRecipes { * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + public GT_Recipe findRecipe( + IHasWorldObjectAndCoords aTileEntity, + GT_Recipe aRecipe, + boolean aNotUnificated, + boolean aDontCheckStackSizes, + long aVoltage, + FluidStack[] aFluids, + ItemStack aSpecialSlot, + ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 + // Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in + // their Machines to select Sub Recipes. if (GregTech_API.sPostloadFinished) { if (mMinimalInputFluids > 0) { if (aFluids == null) return null; @@ -382,7 +882,10 @@ public class BWRecipes { // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) - if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) + if (!aRecipe.mFakeRecipe + && aRecipe.mCanBeBuffered + && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull((ItemStack) aRecipe.mSpecialItems, aSpecialSlot)) return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. @@ -392,23 +895,34 @@ public class BWRecipes { Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } - // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. + // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that + // Map too. if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) { Collection<GT_Recipe> tRecipes = mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) - return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; + if (tRecipes != null) + for (GT_Recipe tRecipe : tRecipes) + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) + return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null; } // And nothing has been found. @@ -419,17 +933,17 @@ public class BWRecipes { public static class BWNBTDependantCraftingRecipe implements IRecipe { ItemStack result; - Map<Character, ItemStack> charToStackMap = new HashMap<>(9,1); + Map<Character, ItemStack> charToStackMap = new HashMap<>(9, 1); String[] shape; @SuppressWarnings({"SuspiciousSystemArraycopy"}) public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) { this.result = result; this.shape = new String[3]; - System.arraycopy(recipe,0, this.shape,0,3); + System.arraycopy(recipe, 0, this.shape, 0, 3); this.charToStackMap.put(' ', null); - for (int i = 3; i < recipe.length; i+=2) { - this.charToStackMap.put((char)recipe[i],((ItemStack)recipe[i+1]).copy()); + for (int i = 3; i < recipe.length; i += 2) { + this.charToStackMap.put((char) recipe[i], ((ItemStack) recipe[i + 1]).copy()); } } @@ -441,8 +955,7 @@ public class BWRecipes { BWRecipes.BWNBTDependantCraftingRecipe that = (BWRecipes.BWNBTDependantCraftingRecipe) o; if (!Objects.equals(this.result, that.result)) return false; - if (!Objects.equals(this.charToStackMap, that.charToStackMap)) - return false; + if (!Objects.equals(this.charToStackMap, that.charToStackMap)) return false; // Probably incorrect - comparing Object[] arrays with Arrays.equals return Arrays.equals(this.shape, that.shape); } @@ -459,10 +972,9 @@ public class BWRecipes { public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) { for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { - ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y,x); + ItemStack toCheck = p_77569_1_.getStackInRowAndColumn(y, x); ItemStack ref = this.charToStackMap.get(this.shape[x].toCharArray()[y]); - if (!BW_Util.areStacksEqualOrNull(toCheck,ref)) - return false; + if (!BW_Util.areStacksEqualOrNull(toCheck, ref)) return false; } } return true; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 6956c68233..94a6f5c558 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -24,29 +24,25 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; - import java.util.Arrays; + @SuppressWarnings("unused") public class BW_ColorUtil { - private BW_ColorUtil(){} + private BW_ColorUtil() {} - public static byte getDarknessFromColor (short[] rgba, int index){ + public static byte getDarknessFromColor(short[] rgba, int index) { int g = rgba[index]; - if (g >= 0 && g < 64) - return 0; - else if (g >= 64 && g < 160) - return 1; - else if (g >= 160 && g < 223) - return 2; - else if (g >= 233 && g <= 255) - return 3; + if (g >= 0 && g < 64) return 0; + else if (g >= 64 && g < 160) return 1; + else if (g >= 160 && g < 223) return 2; + else if (g >= 233 && g <= 255) return 3; return 4; } - public static Dyes getDyeFromColor(short[] rgba){ - rgba=correctCorlorArray(rgba); - if (isGrayScale(rgba,2)){ - switch (getDarknessFromColor(rgba,0)) { + public static Dyes getDyeFromColor(short[] rgba) { + rgba = correctCorlorArray(rgba); + if (isGrayScale(rgba, 2)) { + switch (getDarknessFromColor(rgba, 0)) { case 0: return Dyes.dyeBlack; case 1: @@ -58,25 +54,23 @@ public class BW_ColorUtil { } } else { short[] tmp = roundColor(rgba, 2); - if (isRedScale(tmp)){ + if (isRedScale(tmp)) { if (isPurpleScale(tmp)) { switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: - if (rgba[3] - 50 > rgba[0]) - return Dyes.dyePurple; + if (rgba[3] - 50 > rgba[0]) return Dyes.dyePurple; else return Dyes.dyeRed; case 2: case 3: - if (rgba[3] - 50 > rgba[0]) - return Dyes.dyeMagenta; - else if (rgba[0] > 200 && rgba[2] > 140) - return Dyes.dyePink; - else if (rgba[0] > rgba[1]+rgba[1]/10 && rgba[0] > rgba[2]+rgba[2]/10 && rgba[1]>>4 == rgba[2]>>4 && rgba[1]+50 > rgba[0]) { + if (rgba[3] - 50 > rgba[0]) return Dyes.dyeMagenta; + else if (rgba[0] > 200 && rgba[2] > 140) return Dyes.dyePink; + else if (rgba[0] > rgba[1] + rgba[1] / 10 + && rgba[0] > rgba[2] + rgba[2] / 10 + && rgba[1] >> 4 == rgba[2] >> 4 + && rgba[1] + 50 > rgba[0]) { return Dyes.dyeBrown; - } - else - return Dyes.dyeRed; + } else return Dyes.dyeRed; case 4: return Dyes._NULL; } @@ -87,27 +81,25 @@ public class BW_ColorUtil { case 1: return Dyes.dyeBrown; case 2: - case 3:{ - if (rgba[0]>>5 > rgba[1]>>5) - return Dyes.dyeOrange; - else - return Dyes.dyeYellow; + case 3: { + if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; + else return Dyes.dyeYellow; } case 4: return Dyes._NULL; } return Dyes.dyePink; - } else if (isGrenScale(tmp)){ + } else if (isGrenScale(tmp)) { if (isCyanScale(tmp)) { - if (rgba[2]+40 < rgba[1]) - switch (getDarknessFromColor(rgba,0)) { - case 0: - case 1: - return Dyes.dyeGreen; - case 2: - case 3: - return Dyes.dyeLime; - } + if (rgba[2] + 40 < rgba[1]) + switch (getDarknessFromColor(rgba, 0)) { + case 0: + case 1: + return Dyes.dyeGreen; + case 2: + case 3: + return Dyes.dyeLime; + } return Dyes.dyeCyan; } if (isYellowScale(tmp)) @@ -116,14 +108,12 @@ public class BW_ColorUtil { case 1: return Dyes.dyeBrown; case 2: - case 3:{ - if (rgba[0]>>5 > rgba[1]>>5) - return Dyes.dyeOrange; - else - return Dyes.dyeYellow; + case 3: { + if (rgba[0] >> 5 > rgba[1] >> 5) return Dyes.dyeOrange; + else return Dyes.dyeYellow; } } - switch (getDarknessFromColor(rgba,0)) { + switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: return Dyes.dyeGreen; @@ -131,7 +121,7 @@ public class BW_ColorUtil { case 3: return Dyes.dyeLime; } - } else if (isBlueScale(tmp)){ + } else if (isBlueScale(tmp)) { if (isPurpleScale(tmp)) { switch (getDarknessFromColor(rgba, 0)) { case 0: @@ -141,11 +131,10 @@ public class BW_ColorUtil { case 3: return Dyes.dyeMagenta; } - } - else if (isCyanScale(tmp)){ + } else if (isCyanScale(tmp)) { return Dyes.dyeCyan; } - switch (getDarknessFromColor(rgba,0)) { + switch (getDarknessFromColor(rgba, 0)) { case 0: case 1: return Dyes.dyeBlue; @@ -158,81 +147,73 @@ public class BW_ColorUtil { return Dyes._NULL; } - public static boolean isCyanScale(short[] rgba){ + public static boolean isCyanScale(short[] rgba) { return !isRedScale(rgba); } - public static boolean isPurpleScale(short[] rgba){ + public static boolean isPurpleScale(short[] rgba) { return !isGrenScale(rgba); } - public static boolean isYellowScale(short[] rgba){ - return !isBlueScale(rgba); + public static boolean isYellowScale(short[] rgba) { + return !isBlueScale(rgba); } - public static boolean isBlueScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return (rgba[2]*2) >= (rgba[1]+rgba[0]); + public static boolean isBlueScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return (rgba[2] * 2) >= (rgba[1] + rgba[0]); } - public static boolean isGrenScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return (rgba[1]*2) >= (rgba[0]+rgba[2]); + public static boolean isGrenScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return (rgba[1] * 2) >= (rgba[0] + rgba[2]); } - public static boolean isRedScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return (rgba[0]*2) >= (rgba[1]+rgba[2]); + public static boolean isRedScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return (rgba[0] * 2) >= (rgba[1] + rgba[2]); } - public static boolean isGrayScale(short[] rgba, int magin){ - rgba=correctCorlorArray(rgba); - return rgba[0]>>magin==rgba[1]>>magin && rgba[1]>>magin==rgba[2]>>magin; + public static boolean isGrayScale(short[] rgba, int magin) { + rgba = correctCorlorArray(rgba); + return rgba[0] >> magin == rgba[1] >> magin && rgba[1] >> magin == rgba[2] >> magin; } - public static short[] roundColor(short[] rgba, int magin){ - short[]tmp = Arrays.copyOf(rgba,4); - tmp[0] = (short) (rgba[0]>>magin); - tmp[1] = (short) (rgba[1]>>magin); - tmp[2] = (short) (rgba[2]>>magin); + public static short[] roundColor(short[] rgba, int magin) { + short[] tmp = Arrays.copyOf(rgba, 4); + tmp[0] = (short) (rgba[0] >> magin); + tmp[1] = (short) (rgba[1] >> magin); + tmp[2] = (short) (rgba[2] >> magin); return tmp; } - public static boolean isGrayScale(short[] rgba){ - rgba=correctCorlorArray(rgba); - return rgba[0]==rgba[1] && rgba[1] == rgba[2]; + public static boolean isGrayScale(short[] rgba) { + rgba = correctCorlorArray(rgba); + return rgba[0] == rgba[1] && rgba[1] == rgba[2]; } - public static short[] correctCorlorArray(short[] rgba){ + public static short[] correctCorlorArray(short[] rgba) { if (rgba.length > 4) { - rgba = Arrays.copyOfRange(rgba, 0,4); + rgba = Arrays.copyOfRange(rgba, 0, 4); } if (rgba.length < 4) { short[] tmp = Arrays.copyOf(rgba, 4); - Arrays.fill(tmp,rgba.length,4, (short) 0); + Arrays.fill(tmp, rgba.length, 4, (short) 0); rgba = tmp; } - if (rgba[0] > 255) - rgba[0] = 255; - if (rgba[1] > 255) - rgba[1] = 255; - if (rgba[2] > 255) - rgba[2] = 255; - if (rgba[3] > 255) - rgba[3] = 255; - if (rgba[0] < 0) - rgba[0] = 0; - if (rgba[1] < 0) - rgba[1] = 0; - if (rgba[2] < 0) - rgba[2] = 0; - if (rgba[3] < 0) - rgba[3] = 0; + if (rgba[0] > 255) rgba[0] = 255; + if (rgba[1] > 255) rgba[1] = 255; + if (rgba[2] > 255) rgba[2] = 255; + if (rgba[3] > 255) rgba[3] = 255; + if (rgba[0] < 0) rgba[0] = 0; + if (rgba[1] < 0) rgba[1] = 0; + if (rgba[2] < 0) rgba[2] = 0; + if (rgba[3] < 0) rgba[3] = 0; return rgba; } public static short[] splitColorToRBGArray(int rgb) { - return new short[]{(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; + return new short[] {(short) ((rgb >> 16) & 0xFF), (short) ((rgb >> 8) & 0xFF), (short) (rgb & 0xFF)}; } public static int getColorFromRGBArray(short[] color) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java index 2d0bff05ff..42b8ae5e13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Tooltip_Reference.java @@ -22,12 +22,11 @@ package com.github.bartimaeusnek.bartworks.util; -import net.minecraft.util.StatCollector; +import static net.minecraft.util.EnumChatFormatting.*; import java.util.function.Function; import java.util.function.Supplier; - -import static net.minecraft.util.EnumChatFormatting.*; +import net.minecraft.util.StatCollector; public class BW_Tooltip_Reference { public static final String BW_NO_RESET = ChatColorHelper.DARKGREEN + "BartWorks"; @@ -35,17 +34,22 @@ public class BW_Tooltip_Reference { public static final String BW = BW_NO_RESET + GRAY; public static final String TT = TT_NO_RESET + GRAY; - public static final Supplier<String> ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; - public static final Supplier<String> ADDED_BY_BARTWORKS = () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; - public static final Function<String, String> ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); + public static final Supplier<String> ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = + () -> StatCollector.translateToLocal("tooltip.bw.1.name") + " " + BW; + public static final Supplier<String> ADDED_BY_BARTWORKS = + () -> StatCollector.translateToLocal("tooltip.bw.0.name") + " " + BW; + public static final Function<String, String> ADDED_VIA_BARTWORKS = + owner -> String.format(StatCollector.translateToLocal("tooltip.bw.via.name"), owner); public static final String MULTIBLOCK_ADDED_BY_BARTWORKS = BW; - public static final Function<String, String> MULTIBLOCK_ADDED_VIA_BARTWORKS = owner -> String.format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); - public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(GREEN + "bartimaeusnek"); + public static final Function<String, String> MULTIBLOCK_ADDED_VIA_BARTWORKS = + owner -> String.format(StatCollector.translateToLocal("tooltip.bw.mb_via.name"), owner); + public static final String MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS = + MULTIBLOCK_ADDED_VIA_BARTWORKS.apply(GREEN + "bartimaeusnek"); - public static final String ADV_STR_CHECK = "Uses an advanced "+ TT +" structure check, due to "+ BW; - public static final String TT_BLUEPRINT = "To see the structure, use a "+ TT + " Blueprint on the Controller!"; + public static final String ADV_STR_CHECK = "Uses an advanced " + TT + " structure check, due to " + BW; + public static final String TT_BLUEPRINT = "To see the structure, use a " + TT + " Blueprint on the Controller!"; - public static String[] getTranslatedBrandedTooltip(String key){ + public static String[] getTranslatedBrandedTooltip(String key) { String[] dsc = StatCollector.translateToLocal(key).split(";"); String[] fdsc = new String[dsc.length + 1]; System.arraycopy(dsc, 0, fdsc, 0, dsc.length); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index b0ca12b5f2..365c79d496 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.bartworks.util; +import static gregtech.api.enums.GT_Values.*; + import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.MainMod; @@ -40,6 +42,15 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.ItemData; import gregtech.api.util.*; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.Nonnegative; +import javax.annotation.Nonnull; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.enchantment.Enchantment; @@ -59,31 +70,17 @@ import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import org.apache.commons.lang3.reflect.FieldUtils; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.util.*; -import java.util.function.BiConsumer; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static gregtech.api.enums.GT_Values.*; - -@SuppressWarnings({"unused","RedundantSuppression"}) +@SuppressWarnings({"unused", "RedundantSuppression"}) public class BW_Util { public static final int STANDART = 0; public static final int LOWGRAVITY = -100; public static final int CLEANROOM = -200; - public static String translateGTItemStack(ItemStack itemStack){ - if (!GT_Utility.isStackValid(itemStack)) - return "Not a Valid ItemStack:"+itemStack; + public static String translateGTItemStack(ItemStack itemStack) { + if (!GT_Utility.isStackValid(itemStack)) return "Not a Valid ItemStack:" + itemStack; String ret = GT_LanguageManager.getTranslation(GT_LanguageManager.getTranslateableItemStackName(itemStack)); - if (!ret.contains("%material")) - return ret; + if (!ret.contains("%material")) return ret; String matname = ""; if (BW_Util.checkStackAndPrefix(itemStack)) matname = GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial.mDefaultLocalName; @@ -95,12 +92,12 @@ public class BW_Util { array[index] = value; } - public static Object get2DCoordFrom1DArray(int indexX, int indexY, int sizeY, Object[] array){ + public static Object get2DCoordFrom1DArray(int indexX, int indexY, int sizeY, Object[] array) { int index = indexX * sizeY + indexY; return array[index]; } - public static GT_Recipe copyAndSetTierToNewRecipe(GT_Recipe recipe, byte tier){ + public static GT_Recipe copyAndSetTierToNewRecipe(GT_Recipe recipe, byte tier) { byte oldTier = GT_Utility.getTier(recipe.mEUt); int newTime = recipe.mDuration; int newVoltage = recipe.mEUt; @@ -116,83 +113,163 @@ public class BW_Util { return recipe; } - public static String subscriptNumbers(String b){ + public static String subscriptNumbers(String b) { char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '₀'; continue; - case '1': nu[i] = '₁'; continue; - case '2': nu[i] = '₂'; continue; - case '3': nu[i] = '₃'; continue; - case '4': nu[i] = '₄'; continue; - case '5': nu[i] = '₅'; continue; - case '6': nu[i] = '₆'; continue; - case '7': nu[i] = '₇'; continue; - case '8': nu[i] = '₈'; continue; - case '9': nu[i] = '₉'; continue; - default: nu[i] = chars[i]; + switch (chars[i]) { + case '0': + nu[i] = '₀'; + continue; + case '1': + nu[i] = '₁'; + continue; + case '2': + nu[i] = '₂'; + continue; + case '3': + nu[i] = '₃'; + continue; + case '4': + nu[i] = '₄'; + continue; + case '5': + nu[i] = '₅'; + continue; + case '6': + nu[i] = '₆'; + continue; + case '7': + nu[i] = '₇'; + continue; + case '8': + nu[i] = '₈'; + continue; + case '9': + nu[i] = '₉'; + continue; + default: + nu[i] = chars[i]; } } return new String(nu); } - public static String subscriptNumber(Number b){ - char[] chars = Long.toString(b.longValue()).toCharArray(); + public static String subscriptNumber(Number b) { + char[] chars = Long.toString(b.longValue()).toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '₀'; continue; - case '1': nu[i] = '₁'; continue; - case '2': nu[i] = '₂'; continue; - case '3': nu[i] = '₃'; continue; - case '4': nu[i] = '₄'; continue; - case '5': nu[i] = '₅'; continue; - case '6': nu[i] = '₆'; continue; - case '7': nu[i] = '₇'; continue; - case '8': nu[i] = '₈'; continue; - case '9': nu[i] = '₉'; + switch (chars[i]) { + case '0': + nu[i] = '₀'; + continue; + case '1': + nu[i] = '₁'; + continue; + case '2': + nu[i] = '₂'; + continue; + case '3': + nu[i] = '₃'; + continue; + case '4': + nu[i] = '₄'; + continue; + case '5': + nu[i] = '₅'; + continue; + case '6': + nu[i] = '₆'; + continue; + case '7': + nu[i] = '₇'; + continue; + case '8': + nu[i] = '₈'; + continue; + case '9': + nu[i] = '₉'; } } return new String(nu); } - public static String superscriptNumbers(String b){ + public static String superscriptNumbers(String b) { char[] chars = b.toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '⁰'; continue; - case '1': nu[i] = '¹'; continue; - case '2': nu[i] = '²'; continue; - case '3': nu[i] = '³'; continue; - case '4': nu[i] = '⁴'; continue; - case '5': nu[i] = '⁵'; continue; - case '6': nu[i] = '⁶'; continue; - case '7': nu[i] = '⁷'; continue; - case '8': nu[i] = '⁸'; continue; - case '9': nu[i] = '⁹'; continue; - default: nu[i] = chars[i]; + switch (chars[i]) { + case '0': + nu[i] = '⁰'; + continue; + case '1': + nu[i] = '¹'; + continue; + case '2': + nu[i] = '²'; + continue; + case '3': + nu[i] = '³'; + continue; + case '4': + nu[i] = '⁴'; + continue; + case '5': + nu[i] = '⁵'; + continue; + case '6': + nu[i] = '⁶'; + continue; + case '7': + nu[i] = '⁷'; + continue; + case '8': + nu[i] = '⁸'; + continue; + case '9': + nu[i] = '⁹'; + continue; + default: + nu[i] = chars[i]; } } return new String(nu); } - public static String superscriptNumber(Number b){ - char[] chars = Long.toString(b.longValue()).toCharArray(); + public static String superscriptNumber(Number b) { + char[] chars = Long.toString(b.longValue()).toCharArray(); char[] nu = new char[chars.length]; for (int i = 0; i < chars.length; i++) { - switch (chars[i]){ - case '0': nu[i] = '⁰'; continue; - case '1': nu[i] = '¹'; continue; - case '2': nu[i] = '²'; continue; - case '3': nu[i] = '³'; continue; - case '4': nu[i] = '⁴'; continue; - case '5': nu[i] = '⁵'; continue; - case '6': nu[i] = '⁶'; continue; - case '7': nu[i] = '⁷'; continue; - case '8': nu[i] = '⁸'; continue; - case '9': nu[i] = '⁹'; + switch (chars[i]) { + case '0': + nu[i] = '⁰'; + continue; + case '1': + nu[i] = '¹'; + continue; + case '2': + nu[i] = '²'; + continue; + case '3': + nu[i] = '³'; + continue; + case '4': + nu[i] = '⁴'; + continue; + case '5': + nu[i] = '⁵'; + continue; + case '6': + nu[i] = '⁶'; + continue; + case '7': + nu[i] = '⁷'; + continue; + case '8': + nu[i] = '⁸'; + continue; + case '9': + nu[i] = '⁹'; } } return new String(nu); @@ -200,61 +277,71 @@ public class BW_Util { public static byte specialToByte(int aSpecialValue) { byte special = 0; - if (aSpecialValue == (LOWGRAVITY)) - special = 1; - else if (aSpecialValue == (CLEANROOM)) - special = 2; - else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) - special = 3; + if (aSpecialValue == (LOWGRAVITY)) special = 1; + else if (aSpecialValue == (CLEANROOM)) special = 2; + else if (aSpecialValue == (LOWGRAVITY | CLEANROOM)) special = 3; return special; } - public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { + public static boolean addBlockToMachine( + int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); + return block == Blocks.air + ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block); } - public static boolean addBlockToMachine(int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { + public static boolean addBlockToMachine( + int x, int y, int z, int offsetsize, IGregTechTileEntity aBaseMetaTileEntity, Block block, int damage) { byte dmg = (byte) damage; int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offsetsize; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offsetsize; - return block == Blocks.air ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; + return block == Blocks.air + ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) + && aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) == dmg; } public static int calculateSv(Materials materials) { for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) { - if (pair.getMaterials().equals(materials)) - return pair.getSievert(); + if (pair.getMaterials().equals(materials)) return pair.getSievert(); } - return (int) (materials.getProtons() == 43L ? (materials.equals(Materials.NaquadahEnriched) ? 140 : materials.equals(Materials.Naquadria) ? 150 : materials.equals(Materials.Naquadah) ? 130 : 43) : materials.getProtons()); + return (int) + (materials.getProtons() == 43L + ? (materials.equals(Materials.NaquadahEnriched) + ? 140 + : materials.equals(Materials.Naquadria) + ? 150 + : materials.equals(Materials.Naquadah) ? 130 : 43) + : materials.getProtons()); } public static ItemStack setStackSize(ItemStack stack, int size) { - if (stack != null) - stack.stackSize = size; + if (stack != null) stack.stackSize = size; return stack; } public static boolean checkStackAndPrefix(ItemStack itemStack) { - return itemStack != null && GT_OreDictUnificator.getAssociation(itemStack) != null && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; + return itemStack != null + && GT_OreDictUnificator.getAssociation(itemStack) != null + && GT_OreDictUnificator.getAssociation(itemStack).mPrefix != null + && GT_OreDictUnificator.getAssociation(itemStack).mMaterial != null + && GT_OreDictUnificator.getAssociation(itemStack).mMaterial.mMaterial != null; } - public static Map<ItemStack, ItemStack[]> getInputsFromOutput(Collection<GT_Recipe> gt_recipes, ItemStack... inputs) { + public static Map<ItemStack, ItemStack[]> getInputsFromOutput( + Collection<GT_Recipe> gt_recipes, ItemStack... inputs) { return gt_recipes.stream() - .filter(ar -> - Arrays.stream(inputs) - .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) + .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutputs[0]))) .collect(Collectors.toMap(k -> k.mOutputs[0], k -> k.mInputs)); } public static Map<ItemStack, ItemStack[]> getAsslineInputsFromOutputs(ItemStack... inputs) { return GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.stream() - .filter(ar -> - Arrays.stream(inputs) - .anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput))) + .filter(ar -> Arrays.stream(inputs).anyMatch(st -> GT_Utility.areStacksEqual(st, ar.mOutput))) .collect(Collectors.toMap(k -> k.mOutput, k -> k.mInputs)); } @@ -296,17 +383,13 @@ public class BW_Util { @SuppressWarnings({"unchecked"}) public static <T> T[] copyAndRemoveNulls(T[] input, Class<T> clazz) { - List<T> ret = Arrays.stream(input) - .filter(Objects::nonNull) - .collect(Collectors.toList()); + List<T> ret = Arrays.stream(input).filter(Objects::nonNull).collect(Collectors.toList()); - if (ret.size() <= 0) - return (T[]) Array.newInstance(clazz, 0); + if (ret.size() <= 0) return (T[]) Array.newInstance(clazz, 0); T[] retArr = (T[]) Array.newInstance(clazz, ret.size()); - for (int i = 0; i < ret.size(); i++) - retArr[i] = ret.get(i); + for (int i = 0; i < ret.size(); i++) retArr[i] = ret.get(i); return retArr; } @@ -316,30 +399,29 @@ public class BW_Util { } public static long getTierVoltage(int tier) { - return getTierVoltage((byte)tier); + return getTierVoltage((byte) tier); } public static long getTierVoltage(byte tier) { return 8L << (2 * tier); } - public static byte getTier(long voltage){ - if(voltage <= Integer.MAX_VALUE - 7) - return GT_Utility.getTier(voltage); + public static byte getTier(long voltage) { + if (voltage <= Integer.MAX_VALUE - 7) return GT_Utility.getTier(voltage); byte t = 0; - while(voltage > 8L) { + while (voltage > 8L) { voltage >>= 2; t++; } return t; } - public static String getTierName(byte tier){ - if(VN.length - 1 <= tier) return "MAX+"; + public static String getTierName(byte tier) { + if (VN.length - 1 <= tier) return "MAX+"; else return VN[tier]; } - public static String getTierNameFromVoltage(long voltage){ + public static String getTierNameFromVoltage(long voltage) { return getTierName(getTier(voltage)); } @@ -352,12 +434,9 @@ public class BW_Util { } public static byte getByteFromRarity(EnumRarity rarity) { - if (rarity.equals(EnumRarity.uncommon)) - return 1; - else if (rarity.equals(EnumRarity.epic)) - return 2; - else if (rarity.equals(EnumRarity.rare)) - return 3; + if (rarity.equals(EnumRarity.uncommon)) return 1; + else if (rarity.equals(EnumRarity.epic)) return 2; + else if (rarity.equals(EnumRarity.rare)) return 3; return 0; } @@ -404,21 +483,37 @@ public class BW_Util { * @param aDuration - recipe Duration * @param mAmperage - should be 1 ? */ - public static void calculateOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { + public static void calculateOverclockedNessMulti( + @Nonnegative int aEUt, + @Nonnegative int aDuration, + @Nonnegative int mAmperage, + @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base) { calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, false); } - public static void calculatePerfectOverclockedNessMulti(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base) { + public static void calculatePerfectOverclockedNessMulti( + @Nonnegative int aEUt, + @Nonnegative int aDuration, + @Nonnegative int mAmperage, + @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base) { calculateOverclockednessMultiInternal(aEUt, aDuration, mAmperage, maxInputVoltage, base, true); } - private static void calculateOverclockednessMultiInternal(@Nonnegative int aEUt, @Nonnegative int aDuration, @Nonnegative int mAmperage, @Nonnegative long maxInputVoltage, @Nonnull GT_MetaTileEntity_MultiBlockBase base, @Nonnull boolean perfectOC){ + private static void calculateOverclockednessMultiInternal( + @Nonnegative int aEUt, + @Nonnegative int aDuration, + @Nonnegative int mAmperage, + @Nonnegative long maxInputVoltage, + @Nonnull GT_MetaTileEntity_MultiBlockBase base, + @Nonnull boolean perfectOC) { byte mTier = (byte) Math.max(0, GT_Utility.getTier(maxInputVoltage)); if (mTier == 0) { - //Long time calculation + // Long time calculation long xMaxProgresstime = ((long) aDuration) << 1; if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - //make impossible if too long + // make impossible if too long base.mEUt = Integer.MAX_VALUE - 1; base.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { @@ -426,27 +521,29 @@ public class BW_Util { base.mMaxProgresstime = (int) xMaxProgresstime; } } else { - //Long EUt calculation + // Long EUt calculation long xEUt = aEUt; - //Isnt too low EUt check? + // Isnt too low EUt check? long tempEUt = Math.max(xEUt, V[1]); base.mMaxProgresstime = aDuration; while (tempEUt <= V[mTier - 1] * mAmperage) { - tempEUt <<= 2;//this actually controls overclocking - //xEUt *= 4;//this is effect of everclocking - base.mMaxProgresstime >>= perfectOC ? 2 : 1;//this is effect of overclocking - xEUt = base.mMaxProgresstime <= 0 ? xEUt >> 1 : xEUt << 2;//U know, if the time is less than 1 tick make the machine use less power + tempEUt <<= 2; // this actually controls overclocking + // xEUt *= 4;//this is effect of everclocking + base.mMaxProgresstime >>= perfectOC ? 2 : 1; // this is effect of overclocking + xEUt = base.mMaxProgresstime <= 0 + ? xEUt >> 1 + : xEUt << 2; // U know, if the time is less than 1 tick make the machine use less power } - while (xEUt > maxInputVoltage && xEUt >= aEUt){ - //downclock one notch until we are good again, we have overshot. + while (xEUt > maxInputVoltage && xEUt >= aEUt) { + // downclock one notch until we are good again, we have overshot. xEUt >>= 2; base.mMaxProgresstime <<= perfectOC ? 2 : 1; } - if (xEUt < aEUt){ + if (xEUt < aEUt) { xEUt <<= 2; base.mMaxProgresstime >>= perfectOC ? 2 : 1; } @@ -456,10 +553,8 @@ public class BW_Util { base.mMaxProgresstime = Integer.MAX_VALUE - 1; } else { base.mEUt = (int) xEUt; - if (base.mEUt == 0) - base.mEUt = 1; - if (base.mMaxProgresstime <= 0) - base.mMaxProgresstime = 1;//set time to 1 tick + if (base.mEUt == 0) base.mEUt = 1; + if (base.mMaxProgresstime <= 0) base.mMaxProgresstime = 1; // set time to 1 tick } } } @@ -478,17 +573,17 @@ public class BW_Util { return rVoltage * rAmperage; } - public static FluidStack[] getFluidsFromInputHatches(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ + public static FluidStack[] getFluidsFromInputHatches(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity) { ArrayList<FluidStack> tmp = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches){ + for (GT_MetaTileEntity_Hatch_Input fip : aBaseMetaTileEntity.mInputHatches) { tmp.add(fip.getFluid()); } return tmp.toArray(new FluidStack[0]); } - public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity){ + public static ItemStack[] getItemsFromInputBusses(GT_MetaTileEntity_MultiBlockBase aBaseMetaTileEntity) { ArrayList<ItemStack> tmp = new ArrayList<>(); - for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses){ + for (GT_MetaTileEntity_Hatch_InputBus fip : aBaseMetaTileEntity.mInputBusses) { tmp.addAll(Arrays.asList(fip.mInventory)); } return tmp.toArray(new ItemStack[0]); @@ -507,24 +602,125 @@ public class BW_Util { } } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, insideCheck, inside, dmginside, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean insideCheck, + Block inside, + int dmginside, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + false, + insideCheck, + inside, + dmginside, + aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, false, aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + controllerLayer, + false, + aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, freeCorners, false, block, dmg, true, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + boolean freeCorners, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + controllerLayer, + freeCorners, + false, + block, + dmg, + true, + aBaseCasingIndex); } - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean insideCheck, Block inside, int dmginside, int aBaseCasingIndex) { - return BW_Util.check_layer(aBaseMetaTileEntity, radius, yLevel, height, block, dmg, offset, controllerLayer, false, insideCheck, inside, dmginside, true, aBaseCasingIndex); + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + boolean insideCheck, + Block inside, + int dmginside, + int aBaseCasingIndex) { + return BW_Util.check_layer( + aBaseMetaTileEntity, + radius, + yLevel, + height, + block, + dmg, + offset, + controllerLayer, + false, + insideCheck, + inside, + dmginside, + true, + aBaseCasingIndex); } /** @@ -542,40 +738,113 @@ public class BW_Util { * @param aBaseCasingIndex the Index for the hatches texture * @return if the layer check was completed */ - public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) { + public static boolean check_layer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + Block block, + int dmg, + int offset, + boolean controllerLayer, + boolean freeCorners, + boolean insideCheck, + Block inside, + int dmginside, + boolean allowHatches, + int aBaseCasingIndex) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { - if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) - continue; - if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) - continue; + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; boolean b = Math.abs(x) < radius && Math.abs(z) != radius; if (insideCheck && b) { - if (! (inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) ) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) { - if (!(allowHatches && ( - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) - ))) { + if (!(inside.equals(Blocks.air) + ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) + : aBaseMetaTileEntity + .getBlockOffset(xDir + x, y, zDir + z) + .equals(inside)) + && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside + || dmginside > (-1))) { + if (!(allowHatches + && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addDynamoToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addEnergyInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addMaintenanceToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addMufflerToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) + aBaseMetaTileEntity.getMetaTileEntity()) + .addOutputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex)))) { return false; } } } - if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { - if (!(allowHatches && ( - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) || - ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) - ))) { + if (!b + && !aBaseMetaTileEntity + .getBlockOffset(xDir + x, y, zDir + z) + .equals(block) + && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) { + if (!(allowHatches + && (((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addDynamoToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addEnergyInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addMaintenanceToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addMufflerToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addInputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex) + || ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()) + .addOutputToMachineList( + aBaseMetaTileEntity.getIGregTechTileEntityOffset( + xDir + x, y, zDir + z), + aBaseCasingIndex)))) { return false; } } @@ -585,20 +854,25 @@ public class BW_Util { return true; } - public static List<Byte> getMetasFromLayer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck) { + public static List<Byte> getMetasFromLayer( + IGregTechTileEntity aBaseMetaTileEntity, + int radius, + int yLevel, + int height, + int offset, + boolean controllerLayer, + boolean freeCorners, + boolean insideCheck) { ArrayList<Byte> ret = new ArrayList<>(); int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset; for (int x = -radius; x <= radius; x++) { for (int y = yLevel; y < height; y++) { for (int z = -radius; z <= radius; z++) { - if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) - continue; - if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) - continue; + if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius)))) continue; + if (controllerLayer && (xDir + x == 0 && zDir + z == 0)) continue; final boolean inside = Math.abs(x) < radius && Math.abs(z) != radius; - if (insideCheck && inside) - ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); + if (insideCheck && inside) ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); if (!inside) { ret.add(aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z)); } @@ -609,18 +883,29 @@ public class BW_Util { } public static byte getCircuitTierFromOreDictName(String name) { - switch (name){ - case "circuitPrimitive": return 0; - case "circuitBasic": return 1; - case "circuitGood": return 2; - case "circuitAdvanced": return 3; - case "circuitData": return 4; - case "circuitElite": return 5; - case "circuitMaster": return 6; - case "circuitUltimate": return 7; - case "circuitSuperconductor": return 8; - case "circuitInfinite": return 9; - case "circuitBio": return 10; + switch (name) { + case "circuitPrimitive": + return 0; + case "circuitBasic": + return 1; + case "circuitGood": + return 2; + case "circuitAdvanced": + return 3; + case "circuitData": + return 4; + case "circuitElite": + return 5; + case "circuitMaster": + return 6; + case "circuitUltimate": + return 7; + case "circuitSuperconductor": + return 8; + case "circuitInfinite": + return 9; + case "circuitBio": + return 10; case "circuitNano": case "circuitOptical": return 11; @@ -632,7 +917,8 @@ public class BW_Util { return 13; case "circuitTranscendent": return 14; - default: return -1; + default: + return -1; } } @@ -663,43 +949,39 @@ public class BW_Util { public static byte calculateGlassTier(@Nonnull Block block, @Nonnegative byte meta) { byte boroTier = BorosilicateGlass.getTier(block, meta); - if (boroTier != -1) - return boroTier; + if (boroTier != -1) return boroTier; - if (block.getUnlocalizedName().equals("blockAlloyGlass")) - return 4; + if (block.getUnlocalizedName().equals("blockAlloyGlass")) return 4; - if (block.equals(Blocks.glass)) - return 3; + if (block.equals(Blocks.glass)) return 3; - for (BioVatLogicAdder.BlockMetaPair B : BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) + for (BioVatLogicAdder.BlockMetaPair B : + BioVatLogicAdder.BioVatGlass.getGlassMap().keySet()) if (B.getBlock().equals(block) && B.getaByte().equals(meta)) return BioVatLogicAdder.BioVatGlass.getGlassMap().get(B); - if (block.getMaterial().equals(Material.glass)) - return 3; + if (block.getMaterial().equals(Material.glass)) return 3; return 0; } - public static <T> IStructureElement<T> ofGlassTiered(byte mintier, byte maxtier, byte notset, BiConsumer<T, Byte> setter, Function<T, Byte> getter, int aDots){ + public static <T> IStructureElement<T> ofGlassTiered( + byte mintier, byte maxtier, byte notset, BiConsumer<T, Byte> setter, Function<T, Byte> getter, int aDots) { return new IStructureElement<T>() { - private final IStructureElement<T> placementDelegate = BorosilicateGlass.ofBoroGlass(notset, mintier, maxtier, setter, getter); + private final IStructureElement<T> placementDelegate = + BorosilicateGlass.ofBoroGlass(notset, mintier, maxtier, setter, getter); + @Override public boolean check(T te, World world, int x, int y, int z) { - if(world.isAirBlock(x, y, z)) - return false; - byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); - if(glasstier == 0) // is not a glass ? - return false; - if(glasstier == notset) - return false; - if(glasstier < mintier) - return false; - if(glasstier > maxtier) - return false; - if(getter.apply(te) == notset) - setter.accept(te, glasstier); + if (world.isAirBlock(x, y, z)) return false; + byte glasstier = + BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + if (glasstier == 0) // is not a glass ? + return false; + if (glasstier == notset) return false; + if (glasstier < mintier) return false; + if (glasstier > maxtier) return false; + if (getter.apply(te) == notset) setter.accept(te, glasstier); return getter.apply(te) == glasstier; } @@ -715,21 +997,30 @@ public class BW_Util { } @Override - public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) { + public PlaceResult survivalPlaceBlock( + T t, + World world, + int x, + int y, + int z, + ItemStack trigger, + IItemSource s, + EntityPlayerMP actor, + Consumer<IChatComponent> chatter) { return placementDelegate.survivalPlaceBlock(t, world, x, y, z, trigger, s, actor, chatter); } }; } - public static <T> IStructureElement<T> ofGlassTieredMixed(byte mintier, byte maxtier, int aDots){ - return new IStructureElementNoPlacement<T>(){ + public static <T> IStructureElement<T> ofGlassTieredMixed(byte mintier, byte maxtier, int aDots) { + return new IStructureElementNoPlacement<T>() { @Override public boolean check(T te, World world, int x, int y, int z) { - if(world.isAirBlock(x, y, z)) - return false; - byte glasstier = BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte)world.getBlockMetadata(x, y, z)); - if(glasstier == 0) // is not a glass ? - return false; + if (world.isAirBlock(x, y, z)) return false; + byte glasstier = + BW_Util.calculateGlassTier(world.getBlock(x, y, z), (byte) world.getBlockMetadata(x, y, z)); + if (glasstier == 0) // is not a glass ? + return false; return glasstier >= mintier && glasstier <= maxtier; } @@ -741,27 +1032,60 @@ public class BW_Util { }; } - - private static Field sBufferedRecipeList; @SuppressWarnings("unchecked") - public static List<IRecipe> getGTBufferedRecipeList() throws SecurityException, IllegalArgumentException, IllegalAccessException{ + public static List<IRecipe> getGTBufferedRecipeList() + throws SecurityException, IllegalArgumentException, IllegalAccessException { if (sBufferedRecipeList == null) { - sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class,"sBufferRecipeList",true); + sBufferedRecipeList = FieldUtils.getDeclaredField(GT_ModHandler.class, "sBufferRecipeList", true); } if (sBufferedRecipeList == null) { - sBufferedRecipeList = FieldUtils.getField(GT_ModHandler.class,"sBufferRecipeList",true); + sBufferedRecipeList = FieldUtils.getField(GT_ModHandler.class, "sBufferRecipeList", true); } return (List<IRecipe>) sBufferedRecipeList.get(null); } public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { - return createGTCraftingRecipe(aResult, new Enchantment[0], new int[0], (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, aRecipe); + return createGTCraftingRecipe( + aResult, + new Enchantment[0], + new int[0], + (aBitMask & GT_ModHandler.RecipeBits.MIRRORED) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.BUFFERED) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.KEEPNBT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DISMANTLEABLE) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.NOT_REMOVABLE) == 0L, + (aBitMask & GT_ModHandler.RecipeBits.REVERSIBLE) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_RECIPES_IF_SAME_NBT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DELETE_ALL_OTHER_NATIVE_RECIPES) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS) == 0L, + (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_THERE_IS_ANOTHER_RECIPE_FOR_IT) != 0L, + (aBitMask & GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL) != 0L, + aRecipe); } - @SuppressWarnings({"rawtypes","unchecked"}) - public static ShapedOreRecipe createGTCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { + @SuppressWarnings({"rawtypes", "unchecked"}) + public static ShapedOreRecipe createGTCraftingRecipe( + ItemStack aResult, + Enchantment[] aEnchantmentsAdded, + int[] aEnchantmentLevelsAdded, + boolean aMirrored, + boolean aBuffered, + boolean aKeepNBT, + boolean aDismantleable, + boolean aRemovable, + boolean aReversible, + boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, + boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, + boolean aOnlyAddIfResultIsNotNull, + Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return null; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -770,12 +1094,13 @@ public class BW_Util { boolean tThereWasARecipe = false; for (byte i = 0; i < aRecipe.length; i++) { - if (aRecipe[i] instanceof IItemContainer) - aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); - else if (aRecipe[i] instanceof Enum) - aRecipe[i] = ((Enum) aRecipe[i]).name(); - else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String || aRecipe[i] instanceof Character)) - aRecipe[i] = aRecipe[i].toString(); + if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); + else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); + else if (!(aRecipe[i] == null + || aRecipe[i] instanceof ItemStack + || aRecipe[i] instanceof ItemData + || aRecipe[i] instanceof String + || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); } try { @@ -869,7 +1194,8 @@ public class BW_Util { for (; idx < aRecipe.length; idx += 2) { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { - GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + (aResult == null ? "null" : aResult.getDisplayName())); + GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return null; @@ -899,10 +1225,8 @@ public class BW_Util { break; } ItemStack tStack = GT_OreDictUnificator.getFirstOre(in, 1); - if (tStack == null) - tRemoveRecipe = false; - else - tItemStackMap.put(chr, tStack); + if (tStack == null) tRemoveRecipe = false; + else tItemStackMap.put(chr, tStack); aRecipe[idx + 1] = in.toString(); } else if (in instanceof String) { if (in.equals(OreDictNames.craftingChest.toString())) @@ -949,17 +1273,28 @@ public class BW_Util { if (aResult == null || aResult.stackSize <= 0) return null; - if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) - tThereWasARecipe = GT_ModHandler.removeRecipeByOutput(aResult, !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, aRemoveAllOtherShapedsWithSameOutput, aRemoveAllOtherNativeRecipes) || tThereWasARecipe; + if (aRemoveAllOthersWithSameOutput + || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT + || aRemoveAllOtherShapedsWithSameOutput + || aRemoveAllOtherNativeRecipes) + tThereWasARecipe = GT_ModHandler.removeRecipeByOutput( + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) + || tThereWasARecipe; if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) { - ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList(); - int tList_sS=tList.size(); + ArrayList<IRecipe> tList = + (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList(); + int tList_sS = tList.size(); for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) { IRecipe tRecipe = tList.get(i); - if (GT_ModHandler.sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue; + if (GT_ModHandler.sSpecialRecipeClasses.contains( + tRecipe.getClass().getName())) continue; if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) { - tList.remove(i--); tList_sS=tList.size(); + tList.remove(i--); + tList_sS = tList.size(); tThereWasARecipe = true; } } @@ -970,7 +1305,15 @@ public class BW_Util { GT_Utility.updateItemStack(aResult); - return new GT_Shaped_Recipe(GT_Utility.copy(aResult), aDismantleable, aRemovable, aKeepNBT, aEnchantmentsAdded, aEnchantmentLevelsAdded, aRecipe).setMirrored(aMirrored); + return new GT_Shaped_Recipe( + GT_Utility.copy(aResult), + aDismantleable, + aRemovable, + aKeepNBT, + aEnchantmentsAdded, + aEnchantmentLevelsAdded, + aRecipe) + .setMirrored(aMirrored); } public static void shortSleep(long nanos) { @@ -979,10 +1322,9 @@ public class BW_Util { long end; do { end = System.nanoTime(); - } while(start + nanos >= end); + } while (start + nanos >= end); } catch (Exception e) { MainMod.LOGGER.catching(e); } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index 5d728b8d2a..16a4d38e30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -22,30 +22,29 @@ package com.github.bartimaeusnek.bartworks.util; - import gregtech.api.interfaces.IColorModulationContainer; import gregtech.api.util.GT_LanguageManager; -import net.minecraft.item.EnumRarity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; - import java.awt.*; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; +import net.minecraft.item.EnumRarity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; public class BioCulture extends BioData implements IColorModulationContainer { public static final ArrayList<BioCulture> BIO_CULTURE_ARRAY_LIST = new ArrayList<>(); - public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture(Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); //fallback NULL culture, also Blue =) + public static final BioCulture NULLCULTURE = BioCulture.createAndRegisterBioCulture( + Color.BLUE, "", BioPlasmid.NULLPLASMID, BioDNA.NULLDNA, false); // fallback NULL culture, also Blue =) public String getLocalisedName() { return GT_LanguageManager.getTranslation(this.getName()); } public void setLocalisedName(String localisedName) { - GT_LanguageManager.addStringLocalization(this.getName(),localisedName); + GT_LanguageManager.addStringLocalization(this.getName(), localisedName); } Color color; @@ -54,7 +53,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { boolean bBreedable; Fluid mFluid; - protected BioCulture(Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, boolean bBreedable) { + protected BioCulture( + Color color, String name, int ID, BioPlasmid plasmid, BioDNA dDNA, EnumRarity rarity, boolean bBreedable) { super(name, ID, rarity); this.color = color; this.plasmid = plasmid; @@ -69,37 +69,39 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.dDNA = dDNA; } - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, rarity, breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } - public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { - BioCulture ret = new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, dna.getRarity(), breedable); + public static BioCulture createAndRegisterBioCulture( + Color color, String name, BioPlasmid plasmid, BioDNA dna, boolean breedable) { + BioCulture ret = + new BioCulture(color, name, BIO_CULTURE_ARRAY_LIST.size(), plasmid, dna, dna.getRarity(), breedable); BIO_CULTURE_ARRAY_LIST.add(ret); return ret; } public static NBTTagCompound getNBTTagFromCulture(BioCulture bioCulture) { - if (bioCulture == null) - return new NBTTagCompound(); + if (bioCulture == null) return new NBTTagCompound(); NBTTagCompound ret = new NBTTagCompound(); ret.setString("Name", bioCulture.name); - //ret.setInteger("ID", bioCulture.ID); - ret.setIntArray("Color", new int[]{bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); + // ret.setInteger("ID", bioCulture.ID); + ret.setIntArray( + "Color", + new int[] {bioCulture.color.getRed(), bioCulture.color.getGreen(), bioCulture.color.getBlue()}); ret.setTag("Plasmid", BioData.getNBTTagFromBioData(BioData.convertBioPlasmidToBioData(bioCulture.plasmid))); ret.setTag("DNA", BioData.getNBTTagFromBioData(BioData.convertBioDNAToBioData(bioCulture.dDNA))); ret.setBoolean("Breedable", bioCulture.bBreedable); ret.setByte("Rarety", BW_Util.getByteFromRarity(bioCulture.rarity)); - if (bioCulture.bBreedable) - ret.setString("Fluid", bioCulture.getFluid().getName()); + if (bioCulture.bBreedable) ret.setString("Fluid", bioCulture.getFluid().getName()); return ret; } public static BioCulture getBioCultureFromNBTTag(NBTTagCompound tag) { - if (tag == null || tag.getIntArray("Color").length == 0) - return null; + if (tag == null || tag.getIntArray("Color").length == 0) return null; BioCulture ret = getBioCulture(tag.getString("Name")); if (ret == null) @@ -109,28 +111,21 @@ public class BioCulture extends BioData implements IColorModulationContainer { BioPlasmid.convertDataToPlasmid(getBioDataFromNBTTag(tag.getCompoundTag("Plasmid"))), BioDNA.convertDataToDNA(getBioDataFromNBTTag(tag.getCompoundTag("DNA"))), BW_Util.getRarityFromByte(tag.getByte("Rarety")), - tag.getBoolean("Breedable") - ); - if (ret.bBreedable) - ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); - if (ret.getFluidNotSet()) //should never happen, but better safe than sorry - ret.setbBreedable(false); + tag.getBoolean("Breedable")); + if (ret.bBreedable) ret.setFluid(FluidRegistry.getFluid(tag.getString("Fluid"))); + if (ret.getFluidNotSet()) // should never happen, but better safe than sorry + ret.setbBreedable(false); return ret; } public static BioCulture getBioCulture(String Name) { - if (Name == null || Name.isEmpty()) - return null; - for (BioCulture b : BIO_CULTURE_ARRAY_LIST) - if (b.name.equals(Name)) - return b; + if (Name == null || Name.isEmpty()) return null; + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.name.equals(Name)) return b; return null; } public static BioCulture getBioCulture(BioDNA DNA) { - for (BioCulture b : BIO_CULTURE_ARRAY_LIST) - if (b.getdDNA().equals(DNA)) - return b; + for (BioCulture b : BIO_CULTURE_ARRAY_LIST) if (b.getdDNA().equals(DNA)) return b; return null; } @@ -157,7 +152,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public int getColorRGB() { - return BW_ColorUtil.getColorFromRGBArray(new int[]{this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); + return BW_ColorUtil.getColorFromRGBArray( + new int[] {this.color.getRed(), this.color.getGreen(), this.color.getBlue()}); } public Color getColor() { @@ -168,26 +164,26 @@ public class BioCulture extends BioData implements IColorModulationContainer { this.color = color; } -// public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, BioDNA dDNA,EnumRarity rarity){ -// BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); -// BIO_CULTURE_ARRAY_LIST.add(ret); -// return ret; -// } + // public static BioCulture createAndRegisterBioCulture(Color color, String name, long ID, BioPlasmid plasmid, + // BioDNA dDNA,EnumRarity rarity){ + // BioCulture ret =new BioCulture(color,name,ID,plasmid,dDNA,rarity); + // BIO_CULTURE_ARRAY_LIST.add(ret); + // return ret; + // } public BioPlasmid getPlasmid() { return this.plasmid; } public BioCulture setPlasmid(BioPlasmid plasmid) { - return checkForExisting(new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); + return checkForExisting( + new BioCulture(this.color, this.name, this.ID, plasmid, this.dDNA, this.rarity, this.bBreedable)); } private BioCulture checkForExisting(BioCulture culture) { - if (culture == null) - return null; + if (culture == null) return null; for (BioCulture bc : BioCulture.BIO_CULTURE_ARRAY_LIST) - if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) - return bc; + if (culture.getdDNA().equals(bc.getdDNA()) && culture.getPlasmid().equals(bc.getPlasmid())) return bc; return culture; } @@ -201,7 +197,8 @@ public class BioCulture extends BioData implements IColorModulationContainer { } public BioCulture setdDNA(BioDNA dDNA) { - return checkForExisting(new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); + return checkForExisting( + new BioCulture(this.color, this.name, this.ID, this.plasmid, dDNA, this.rarity, this.bBreedable)); } public BioCulture setdDNAUnsafe(BioDNA dDNA) { @@ -215,20 +212,36 @@ public class BioCulture extends BioData implements IColorModulationContainer { if (o == null || this.getClass() != o.getClass()) return false; if (!super.equals(o)) return false; BioCulture culture = (BioCulture) o; - return this.isBreedable() == culture.isBreedable() && - Objects.equals(this.getColor(), culture.getColor()) && - Objects.equals(this.getPlasmid(), culture.getPlasmid()) && - Objects.equals(this.getdDNA(), culture.getdDNA()) && - Objects.equals(this.mFluid, culture.mFluid); + return this.isBreedable() == culture.isBreedable() + && Objects.equals(this.getColor(), culture.getColor()) + && Objects.equals(this.getPlasmid(), culture.getPlasmid()) + && Objects.equals(this.getdDNA(), culture.getdDNA()) + && Objects.equals(this.mFluid, culture.mFluid); } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(17).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)).putInt(this.getColorRGB()).putInt(this.getPlasmid().ID).putInt(this.getdDNA().ID).put((byte) (isBreedable() ? 1 : 0)).array(), 0, 17, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(17) + .putInt(MurmurHash3.murmurhash3_x86_32( + this.getName(), 0, this.getName().length(), 31)) + .putInt(this.getColorRGB()) + .putInt(this.getPlasmid().ID) + .putInt(this.getdDNA().ID) + .put((byte) (isBreedable() ? 1 : 0)) + .array(), + 0, + 17, + 31); } @Override public short[] getRGBA() { - return new short[]{(short) getColor().getRed(), (short) getColor().getGreen(), (short) getColor().getBlue(), (short) getColor().getAlpha()}; + return new short[] { + (short) getColor().getRed(), + (short) getColor().getGreen(), + (short) getColor().getBlue(), + (short) getColor().getAlpha() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 7bb8e427cb..91606cf6ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -55,11 +55,6 @@ public class BioDNA extends BioData { @Override public String toString() { - return "BioDNA{" + - "name='" + name + '\'' + - ", ID=" + ID + - '}'; + return "BioDNA{" + "name='" + name + '\'' + ", ID=" + ID + '}'; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index b64e508abd..98b1f0ecea 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -22,12 +22,11 @@ package com.github.bartimaeusnek.bartworks.util; -import net.minecraft.item.EnumRarity; -import net.minecraft.nbt.NBTTagCompound; - import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Objects; +import net.minecraft.item.EnumRarity; +import net.minecraft.nbt.NBTTagCompound; public class BioData { public static final ArrayList<BioData> BIO_DATA_ARRAY_LIST = new ArrayList<>(); @@ -86,22 +85,19 @@ public class BioData { NBTTagCompound ret = new NBTTagCompound(); ret.setByte("Rarity", BW_Util.getByteFromRarity(bioData.rarity)); ret.setString("Name", bioData.name); - //ret.setInteger("ID", bioData.ID); buggy when load Order changes + // ret.setInteger("ID", bioData.ID); buggy when load Order changes ret.setInteger("Chance", bioData.chance); ret.setInteger("Tier", bioData.tier); return ret; } public static BioData getBioDataFromNBTTag(NBTTagCompound tag) { - if (tag == null) - return null; + if (tag == null) return null; return getBioDataFromName(tag.getString("Name")); } public static BioData getBioDataFromName(String Name) { - for (BioData bd : BIO_DATA_ARRAY_LIST) - if (bd.name.equals(Name)) - return bd; + for (BioData bd : BIO_DATA_ARRAY_LIST) if (bd.name.equals(Name)) return bd; return null; } @@ -110,16 +106,26 @@ public class BioData { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BioData bioData = (BioData) o; - return this.getID() == bioData.getID() || ( - this.getChance() == bioData.getChance() && - this.getTier() == bioData.getTier() && - Objects.equals(this.getName(), bioData.getName()) && - this.getRarity() == bioData.getRarity()); + return this.getID() == bioData.getID() + || (this.getChance() == bioData.getChance() + && this.getTier() == bioData.getTier() + && Objects.equals(this.getName(), bioData.getName()) + && this.getRarity() == bioData.getRarity()); } @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(13).putInt(MurmurHash3.murmurhash3_x86_32(this.getName(), 0, this.getName().length(), 31)).put(BW_Util.getByteFromRarity(this.getRarity())).putInt(this.getChance()).putInt(this.getTier()).array(), 0, 13, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(13) + .putInt(MurmurHash3.murmurhash3_x86_32( + this.getName(), 0, this.getName().length(), 31)) + .put(BW_Util.getByteFromRarity(this.getRarity())) + .putInt(this.getChance()) + .putInt(this.getTier()) + .array(), + 0, + 13, + 31); } public int getTier() { @@ -132,10 +138,7 @@ public class BioData { @Override public String toString() { - return "BioData{" + - "name='" + name + '\'' + - ", ID=" + ID + - '}'; + return "BioData{" + "name='" + name + '\'' + ", ID=" + ID + '}'; } public EnumRarity getRarity() { @@ -170,5 +173,4 @@ public class BioData { public int getID() { return this.ID; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 9cadce5239..8cdf435da6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -55,11 +55,6 @@ public class BioPlasmid extends BioData { @Override public String toString() { - return "BioPlasmid{" + - "name='" + name + '\'' + - ", ID=" + ID + - '}'; + return "BioPlasmid{" + "name='" + name + '\'' + ", ID=" + ID + '}'; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java index 44ac709b9f..c1885b1272 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/CachedReflectionUtils.java @@ -1,10 +1,9 @@ package com.github.bartimaeusnek.bartworks.util; -import org.apache.commons.lang3.reflect.FieldUtils; - import java.lang.reflect.Field; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.apache.commons.lang3.reflect.FieldUtils; public class CachedReflectionUtils { private static final ClassValue<Map<String, Field>> fields = new ConcurrentMapClassValue(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 0e8c18f93c..988c9b1610 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -23,13 +23,12 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import java.util.HashSet; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -import java.util.HashSet; - public class ConnectedBlocksChecker { public final HashSet<Coords> hashset = new HashSet<>(2048); @@ -39,24 +38,17 @@ public class ConnectedBlocksChecker { World w = DimensionManager.getWorld(C.wID); int x = C.x, y = C.y, z = C.z; - if (w.getBlock(x + 1, y, z).equals(b)) - ret = (byte) (ret | 0b000100); + if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x - 1, y, z).equals(b)) - ret = (byte) (ret | 0b001000); + if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x, y, z + 1).equals(b)) - ret = (byte) (ret | 0b010000); + if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x, y, z - 1).equals(b)) - ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); - - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); + if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); + if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); return ret; } @@ -88,7 +80,6 @@ public class ConnectedBlocksChecker { ret += get_connected(w, x, y, z - 1, b); } - if (((sides | 0b111110) == 0b111111) && !hashset.contains(new Coords(x, y + 1, z, wID))) { ret++; ret += get_connected(w, x, y + 1, z, b); @@ -107,28 +98,21 @@ public class ConnectedBlocksChecker { byte ret = 0; int wID = w.provider.dimensionId; - if (hashset.contains(new Coords(x, y, z, wID))) - return ret; + if (hashset.contains(new Coords(x, y, z, wID))) return ret; hashset.add(new Coords(x, y, z, wID)); - if (w.getBlock(x + 1, y, z).equals(b)) - ret = (byte) (ret | 0b000100); + if (w.getBlock(x + 1, y, z).equals(b)) ret = (byte) (ret | 0b000100); - if (w.getBlock(x - 1, y, z).equals(b)) - ret = (byte) (ret | 0b001000); + if (w.getBlock(x - 1, y, z).equals(b)) ret = (byte) (ret | 0b001000); - if (w.getBlock(x, y, z + 1).equals(b)) - ret = (byte) (ret | 0b010000); + if (w.getBlock(x, y, z + 1).equals(b)) ret = (byte) (ret | 0b010000); - if (w.getBlock(x, y, z - 1).equals(b)) - ret = (byte) (ret | 0b100000); + if (w.getBlock(x, y, z - 1).equals(b)) ret = (byte) (ret | 0b100000); - if (w.getBlock(x, y + 1, z).equals(b)) - ret = (byte) (ret | 0b000001); + if (w.getBlock(x, y + 1, z).equals(b)) ret = (byte) (ret | 0b000001); - if (w.getBlock(x, y - 1, z).equals(b)) - ret = (byte) (ret | 0b000010); + if (w.getBlock(x, y - 1, z).equals(b)) ret = (byte) (ret | 0b000010); return ret; } @@ -144,55 +128,48 @@ public class ConnectedBlocksChecker { t = w.getTileEntity(C.x, C.y + 1, C.z); if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y - 1, C.z); if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x + 1, C.y, C.z); if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x - 1, C.y, C.z); if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z + 1); if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z - 1); if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } } else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) - return true; + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) + && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; } } return false; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index 8282b132ee..e794b21a0c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -23,14 +23,12 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - import java.util.HashSet; import java.util.LinkedList; import java.util.Queue; - +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; /** * This implementation is for some reason slower than the Recursive Check.... @@ -42,35 +40,41 @@ public class ConnectedBlocksCheckerIteration { public final HashSet<Coords> checked = new HashSet<>(4096); private final Queue<Coords> kwoe = new LinkedList<>(); - public long get_connected(World w, int x, int y, int z, Block b){ - kwoe.add(new Coords(x,y,z,w.provider.dimensionId)); - hashset.add(new Coords(x,y,z,w.provider.dimensionId)); - while (!kwoe.isEmpty()){ + public long get_connected(World w, int x, int y, int z, Block b) { + kwoe.add(new Coords(x, y, z, w.provider.dimensionId)); + hashset.add(new Coords(x, y, z, w.provider.dimensionId)); + while (!kwoe.isEmpty()) { Coords tocheck = kwoe.poll(); int wID = w.provider.dimensionId; checked.add(tocheck); Coords c; - if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x + 1, tocheck.y, tocheck.z, wID)) + && w.getBlock(tocheck.x + 1, tocheck.y, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x - 1, tocheck.y, tocheck.z, wID)) + && w.getBlock(tocheck.x - 1, tocheck.y, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z + 1, wID)) + && w.getBlock(tocheck.x, tocheck.y, tocheck.z + 1).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y, tocheck.z - 1, wID)) + && w.getBlock(tocheck.x, tocheck.y, tocheck.z - 1).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y + 1, tocheck.z, wID)) + && w.getBlock(tocheck.x, tocheck.y + 1, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } - if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { + if (!checked.contains(c = new Coords(tocheck.x, tocheck.y - 1, tocheck.z, wID)) + && w.getBlock(tocheck.x, tocheck.y - 1, tocheck.z).equals(b)) { kwoe.add(c); hashset.add(c); } @@ -89,55 +93,48 @@ public class ConnectedBlocksCheckerIteration { t = w.getTileEntity(C.x, C.y + 1, C.z); if (t != null && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y - 1, C.z); if (t != null && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x + 1, C.y, C.z); if (t != null && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x - 1, C.y, C.z); if (t != null && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z + 1); if (t != null && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } t = w.getTileEntity(C.x, C.y, C.z - 1); if (t != null && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) { if (t instanceof IGregTechTileEntity) - if (((IGregTechTileEntity) t).getMetaTileID() == n) - return true; + if (((IGregTechTileEntity) t).getMetaTileID() == n) return true; } } else { - if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) - return true; - if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) - return true; + if (n == w.getBlockMetadata(C.x, C.y + 1, C.z) + && !new Coords(C.x, C.y + 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y - 1, C.z) + && !new Coords(C.x, C.y - 1, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x + 1, C.y, C.z) + && !new Coords(C.x + 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x - 1, C.y, C.z) + && !new Coords(C.x - 1, C.y, C.z, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z + 1) + && !new Coords(C.x, C.y, C.z + 1, wID).equals(Controller)) return true; + if (n == w.getBlockMetadata(C.x, C.y, C.z - 1) + && !new Coords(C.x, C.y, C.z - 1, wID).equals(Controller)) return true; } } return false; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index ef213ea16b..403f4bbf3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -62,15 +62,10 @@ public class Coords { @Override public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || this.getClass() != o.getClass()) - return false; + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; Coords coords = (Coords) o; - return this.x == coords.x && - this.y == coords.y && - this.z == coords.z && - this.wID == coords.wID; + return this.x == coords.x && this.y == coords.y && this.z == coords.z && this.wID == coords.wID; } @Override diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java index d18eb37eca..f4198466f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/EnumUtils.java @@ -27,42 +27,69 @@ import gregtech.api.enums.OrePrefixes; import net.minecraftforge.common.util.EnumHelper; public class EnumUtils { - private EnumUtils() { - } + private EnumUtils() {} - public static OrePrefixes addNewOrePrefix(String enumName, String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, - boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, - boolean aIsContainer, boolean aDontUnificateActively, boolean aIsUsedForBlocks, - boolean aAllowNormalRecycling, boolean aGenerateDefaultItem, boolean aIsEnchantable, - boolean aIsUsedForOreProcessing, int aMaterialGenerationBits, long aMaterialAmount, - int aDefaultStackSize, int aTextureindex) { - return EnumHelper.addEnum(OrePrefixes.class, enumName, 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[]{ - aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, - aIsUnificatable, aIsMaterialBased, aIsSelfReferencing, - aIsContainer, aDontUnificateActively, aIsUsedForBlocks, - aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, - aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount, - aDefaultStackSize, aTextureindex - }); + public static OrePrefixes addNewOrePrefix( + String enumName, + String aRegularLocalName, + String aLocalizedMaterialPre, + String aLocalizedMaterialPost, + boolean aIsUnificatable, + boolean aIsMaterialBased, + boolean aIsSelfReferencing, + boolean aIsContainer, + boolean aDontUnificateActively, + boolean aIsUsedForBlocks, + boolean aAllowNormalRecycling, + boolean aGenerateDefaultItem, + boolean aIsEnchantable, + boolean aIsUsedForOreProcessing, + int aMaterialGenerationBits, + long aMaterialAmount, + int aDefaultStackSize, + int aTextureindex) { + return EnumHelper.addEnum( + OrePrefixes.class, + enumName, + 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[] { + aRegularLocalName, aLocalizedMaterialPre, aLocalizedMaterialPost, + aIsUnificatable, aIsMaterialBased, aIsSelfReferencing, + aIsContainer, aDontUnificateActively, aIsUsedForBlocks, + aAllowNormalRecycling, aGenerateDefaultItem, aIsEnchantable, + aIsUsedForOreProcessing, aMaterialGenerationBits, aMaterialAmount, + aDefaultStackSize, aTextureindex + }); } - public static Element createNewElement(String enumName, long aProtons, long aNeutrons, long aAdditionalMass, - long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope) { - return EnumHelper.addEnum(Element.class, enumName, new Class[]{ - long.class, long.class, long.class, - long.class, String.class, String.class, - boolean.class - }, new Object[]{ - aProtons, aNeutrons, aAdditionalMass, - aHalfLifeSeconds, aDecayTo, aName, - aIsIsotope - }); + public static Element createNewElement( + String enumName, + long aProtons, + long aNeutrons, + long aAdditionalMass, + long aHalfLifeSeconds, + String aDecayTo, + String aName, + boolean aIsIsotope) { + return EnumHelper.addEnum( + Element.class, + enumName, + new Class[] { + long.class, long.class, long.class, + long.class, String.class, String.class, + boolean.class + }, + new Object[] { + aProtons, aNeutrons, aAdditionalMass, + aHalfLifeSeconds, aDecayTo, aName, + aIsIsotope + }); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java index 0cf02af8fa..7a3fa2c3ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MathUtils.java @@ -28,52 +28,44 @@ package com.github.bartimaeusnek.bartworks.util; @SuppressWarnings("unused") public class MathUtils { - public static long floorLong(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (long) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (long) x; long xi = (long) x; return x < xi ? xi - 1 : xi; } public static long ceilLong(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (long) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (long) x; long xi = (long) x; return x > xi ? xi + 1 : xi; } public static int floorInt(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (int) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (int) x; int xi = (int) x; return x < xi ? xi - 1 : xi; } public static int ceilInt(float x) { - if (Float.isInfinite(x) || Float.isNaN(x)) - return (int) x; + if (Float.isInfinite(x) || Float.isNaN(x)) return (int) x; int xi = (int) x; return x > xi ? xi + 1 : xi; } public static int ceilInt(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return (int) x; + if (Double.isInfinite(x) || Double.isNaN(x)) return (int) x; int xi = (int) x; return x > xi ? xi + 1 : xi; } public static double floor(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return x; + if (Double.isInfinite(x) || Double.isNaN(x)) return x; int xi = (int) x; return x < xi ? xi - 1 : xi; } public static double ceil(double x) { - if (Double.isInfinite(x) || Double.isNaN(x)) - return x; + if (Double.isInfinite(x) || Double.isNaN(x)) return x; int xi = (int) x; return x > xi ? xi + 1 : xi; } @@ -108,20 +100,20 @@ public class MathUtils { return (val.compareTo(min) < 0) ? min : (val.compareTo(max) > 0) ? max : val; } - public static int wrap(int input, int bound){ - return (((input % bound)+bound) % bound); + public static int wrap(int input, int bound) { + return (((input % bound) + bound) % bound); } - public static long wrap(long input, long bound){ - return (((input % bound)+bound) % bound); + public static long wrap(long input, long bound) { + return (((input % bound) + bound) % bound); } - public static double wrap(double input, double bound){ - return (((input % bound)+bound) % bound); + public static double wrap(double input, double bound) { + return (((input % bound) + bound) % bound); } - public static float wrap(float input, float bound){ - return (((input % bound)+bound) % bound); + public static float wrap(float input, float bound) { + return (((input % bound) + bound) % bound); } public static float tanh(float x) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java index 95588a4cf2..7b7a0d75f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MegaUtils.java @@ -28,8 +28,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB public class MegaUtils { public static boolean drainEnergyMegaVanilla(GT_MetaTileEntity_MultiBlockBase multiBlockBase, long aEU) { - if (aEU <= 0) - return true; + if (aEU <= 0) return true; long allTheEu = 0; int hatches = 0; @@ -39,8 +38,7 @@ public class MegaUtils { hatches++; } - if (allTheEu < aEU) - return false; + if (allTheEu < aEU) return false; long euperhatch = aEU / hatches; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java index cbb10fa312..dec3a8eb42 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/MurmurHash3.java @@ -20,7 +20,6 @@ */ package com.github.bartimaeusnek.bartworks.util; - public final class MurmurHash3 { public static final int fmix32(int h) { @@ -45,14 +44,14 @@ public final class MurmurHash3 { * Gets a long from a byte buffer in little endian byte order. */ public static final long getLongLittleEndian(byte[] buf, int offset) { - return ((long) buf[offset + 7] << 56) // no mask needed + return ((long) buf[offset + 7] << 56) // no mask needed | ((buf[offset + 6] & 0xffL) << 48) | ((buf[offset + 5] & 0xffL) << 40) | ((buf[offset + 4] & 0xffL) << 32) | ((buf[offset + 3] & 0xffL) << 24) | ((buf[offset + 2] & 0xffL) << 16) | ((buf[offset + 1] & 0xffL) << 8) - | ((buf[offset] & 0xffL)); // no shift needed + | ((buf[offset] & 0xffL)); // no shift needed } /** @@ -64,17 +63,18 @@ public final class MurmurHash3 { final int c2 = 0x1b873593; int h1 = seed; - int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block + int roundedEnd = offset + (len & 0xfffffffc); // round down to 4 byte block for (int i = offset; i < roundedEnd; i += 4) { // little endian load order - int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24); + int k1 = + (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16) | (data[i + 3] << 24); k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); h1 = h1 * 5 + 0xe6546b64; } @@ -91,7 +91,7 @@ public final class MurmurHash3 { case 1: k1 |= (data[roundedEnd] & 0xff); k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; } @@ -127,8 +127,7 @@ public final class MurmurHash3 { int k2 = 0; int shift = 0; int bits = 0; - int nBytes = 0; // length in UTF8 bytes - + int nBytes = 0; // length in UTF8 bytes while (pos < end) { int code = data.charAt(pos++); @@ -137,37 +136,33 @@ public final class MurmurHash3 { bits = 8; /*** - // optimized ascii implementation (currently slower!!! code size?) - if (shift == 24) { - k1 = k1 | (code << 24); - - k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); - k1 *= c2; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); - h1 = h1*5+0xe6546b64; - - shift = 0; - nBytes += 4; - k1 = 0; - } else { - k1 |= code << shift; - shift += 8; - } - continue; + * // optimized ascii implementation (currently slower!!! code size?) + * if (shift == 24) { + * k1 = k1 | (code << 24); + * + * k1 *= c1; + * k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + * k1 *= c2; + * + * h1 ^= k1; + * h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + * h1 = h1*5+0xe6546b64; + * + * shift = 0; + * nBytes += 4; + * k1 = 0; + * } else { + * k1 |= code << shift; + * shift += 8; + * } + * continue; ***/ - } else if (code < 0x800) { - k2 = (0xC0 | (code >> 6)) - | ((0x80 | (code & 0x3F)) << 8); + k2 = (0xC0 | (code >> 6)) | ((0x80 | (code & 0x3F)) << 8); bits = 16; } else if (code < 0xD800 || code > 0xDFFF || pos >= end) { // we check for pos>=end to encode an unpaired surrogate as 3 bytes. - k2 = (0xE0 | (code >> 12)) - | ((0x80 | ((code >> 6) & 0x3F)) << 8) - | ((0x80 | (code & 0x3F)) << 16); + k2 = (0xE0 | (code >> 12)) | ((0x80 | ((code >> 6) & 0x3F)) << 8) | ((0x80 | (code & 0x3F)) << 16); bits = 24; } else { // surrogate pair @@ -181,7 +176,6 @@ public final class MurmurHash3 { bits = 32; } - k1 |= k2 << shift; // int used_bits = 32 - shift; // how many bits of k2 were used in k1. @@ -192,30 +186,29 @@ public final class MurmurHash3 { // mix after we have a complete word k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); + h1 = (h1 << 13) | (h1 >>> 19); // ROTL32(h1,13); h1 = h1 * 5 + 0xe6546b64; shift -= 32; // unfortunately, java won't let you shift 32 bits off, so we need to check for 0 if (shift != 0) { - k1 = k2 >>> (bits - shift); // bits used == bits - newshift + k1 = k2 >>> (bits - shift); // bits used == bits - newshift } else { k1 = 0; } nBytes += 4; } - } // inner // handle tail if (shift > 0) { nBytes += shift >> 3; k1 *= c1; - k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); + k1 = (k1 << 15) | (k1 >>> 17); // ROTL32(k1,15); k1 *= c2; h1 ^= k1; } @@ -245,7 +238,7 @@ public final class MurmurHash3 { final long c1 = 0x87c37b91114253d5L; final long c2 = 0x4cf5ad432745937fL; - int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block + int roundedEnd = offset + (len & 0xFFFFFFF0); // round down to 16 byte block for (int i = offset; i < roundedEnd; i += 16) { long k1 = getLongLittleEndian(key, i); long k2 = getLongLittleEndian(key, i + 8); @@ -309,7 +302,7 @@ public final class MurmurHash3 { h1 ^= k1; } - //---------- + // ---------- // finalization h1 ^= len; @@ -335,5 +328,4 @@ public final class MurmurHash3 { public long val1; public long val2; } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index 3e27fe94c3..e5f9c42bf7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -25,7 +25,6 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; import com.github.bartimaeusnek.bartworks.API.INoiseGen; import com.github.bartimaeusnek.bartworks.util.MathUtils; import gregtech.api.objects.XSTR; - import java.util.Random; public class BartsNoise implements INoiseGen { @@ -44,13 +43,20 @@ public class BartsNoise implements INoiseGen { long seed; Random random; - public enum NoiseColor{ - Red(-1),Pink(-0.5),White(0),Blue(0.5),Violet(1); + public enum NoiseColor { + Red(-1), + Pink(-0.5), + White(0), + Blue(0.5), + Violet(1); + NoiseColor(double num) { - this.ampl=num; + this.ampl = num; } + double ampl; - public BartsNoise getColoredNoise(){ + + public BartsNoise getColoredNoise() { BartsNoise noise = new BartsNoise(); noise.setAmplitude(this.ampl); return noise; @@ -81,104 +87,101 @@ public class BartsNoise implements INoiseGen { this.amplitude = this.random.nextGaussian(); } - public BartsNoise copy(){ - return new BartsNoise(this.octaves,this.frequency,this.amplitude,this.seed); - } - public BartsNoise copy(long seed){ - return new BartsNoise(this.octaves,this.frequency,this.amplitude,seed); - } -// public static void main(String[] args) throws IOException { -// -// BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); -//// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); -//// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); -// -// noiseGen1.setUsePhase(false); -//// noiseGen2.setUsePhase(false); -//// noiseGen3.setUsePhase(false); -// -// -// BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); -// -// for (int chunkX = 0; chunkX < 40; chunkX++) { -// for (int chunkZ = 0; chunkZ < 40; chunkZ++) { -// for (int x = 0; x < 16; ++x) { -// for (int z = 0; z < 16; ++z) { -// double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; -//// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; -//// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); -//// d3 *= 2; -// double yDev; -//// if (d3 < 0.0D) { -//// yDev = d; -//// } else if (d3 > 1.0D) { -//// yDev = d2; -//// } else { -// yDev = d*4; -//// } -// yDev=wrap(yDev,1); -// image.setRGB(x + chunkX * 16,z + chunkZ * 16,new Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); -// } -// } -// } -// } -// File file = new File("myimage.png"); -// ImageIO.write(image, "png", file); -//// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); -//// redNoise.setOctaves(1); -//// redNoise.setFrequency(0.05F); -//// for (int i = 40; i < 50; i++) { -//// String line = ""; -//// for (int j = 0; j < 10; j++) { -//// double num = (redNoise.getNoise(i,j)-0.5D); -//// line += num+","; -//// } -//// System.out.println(line); -//// } -// } - - public double getCosNoise(double x, double y){ + public BartsNoise copy() { + return new BartsNoise(this.octaves, this.frequency, this.amplitude, this.seed); + } + + public BartsNoise copy(long seed) { + return new BartsNoise(this.octaves, this.frequency, this.amplitude, seed); + } + // public static void main(String[] args) throws IOException { + // + // BartsNoise noiseGen1 = new BartsNoise(2,0.005F,1D,System.nanoTime()); + //// BartsNoise noiseGen2 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); + //// BartsNoise noiseGen3 = new BartsNoise(1,0.002F,-1D,System.nanoTime()); + // + // noiseGen1.setUsePhase(false); + //// noiseGen2.setUsePhase(false); + //// noiseGen3.setUsePhase(false); + // + // + // BufferedImage image = new BufferedImage(640, 640, BufferedImage.TYPE_INT_RGB); + // + // for (int chunkX = 0; chunkX < 40; chunkX++) { + // for (int chunkZ = 0; chunkZ < 40; chunkZ++) { + // for (int x = 0; x < 16; ++x) { + // for (int z = 0; z < 16; ++z) { + // double d = noiseGen1.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; + //// double d2 = noiseGen2.getNoise(x + chunkX * 16, z + chunkZ * 16) * 2D; + //// double d3 = (noiseGen3.getNoise(x + chunkX * 16, z + chunkZ * 16) - 0.5D); + //// d3 *= 2; + // double yDev; + //// if (d3 < 0.0D) { + //// yDev = d; + //// } else if (d3 > 1.0D) { + //// yDev = d2; + //// } else { + // yDev = d*4; + //// } + // yDev=wrap(yDev,1); + // image.setRGB(x + chunkX * 16,z + chunkZ * 16,new + // Color((float)(1f*yDev),(float)(1f*yDev),(float)(1f*yDev)).getRGB()); + // } + // } + // } + // } + // File file = new File("myimage.png"); + // ImageIO.write(image, "png", file); + //// BartsNoise redNoise = NoiseColor.Blue.getColoredNoise(); + //// redNoise.setOctaves(1); + //// redNoise.setFrequency(0.05F); + //// for (int i = 40; i < 50; i++) { + //// String line = ""; + //// for (int j = 0; j < 10; j++) { + //// double num = (redNoise.getNoise(i,j)-0.5D); + //// line += num+","; + //// } + //// System.out.println(line); + //// } + // } + + public double getCosNoise(double x, double y) { double pr = x * this.frequency; double r1 = Math.cos(pr); - if (r1 < 0) - r1 = Math.abs(r1); + if (r1 < 0) r1 = Math.abs(r1); double result = Math.pow(r1, this.amplitude); double pr2 = y * this.frequency; double r2 = Math.cos(pr2); - if (r2 < 0) - r2 = Math.abs(r2); + if (r2 < 0) r2 = Math.abs(r2); double result2 = Math.pow(r2, this.amplitude); result *= result2; - if (result == Double.POSITIVE_INFINITY) - result = Double.MAX_VALUE; - if (result == Double.NEGATIVE_INFINITY) - result = Double.MIN_VALUE; - return MathUtils.wrap(result,1D); + if (result == Double.POSITIVE_INFINITY) result = Double.MAX_VALUE; + if (result == Double.NEGATIVE_INFINITY) result = Double.MIN_VALUE; + return MathUtils.wrap(result, 1D); } - - double getNonOctavedNoise(double x, double y){ - double phase = SimplexNoise.noise( Math.pow(x*this.frequency,this.amplitude),Math.pow(y*this.frequency,this.amplitude)); - return MathUtils.wrap(phase,1); - + double getNonOctavedNoise(double x, double y) { + double phase = SimplexNoise.noise( + Math.pow(x * this.frequency, this.amplitude), Math.pow(y * this.frequency, this.amplitude)); + return MathUtils.wrap(phase, 1); } - public double getNeighbouringNoise(int x, int y){ - return (this.getNoiseSingle(x-1,y-1)+ - this.getNoiseSingle(x,y-1) + - this.getNoiseSingle(x-1,y) + - this.getNoiseSingle(x+1,y) + - this.getNoiseSingle(x,y+1) + - this.getNoiseSingle(x+1,y+1) + - this.getNoiseSingle(x-1,y+1)+ - this.getNoiseSingle(x+1,y-1) - )/8; + public double getNeighbouringNoise(int x, int y) { + return (this.getNoiseSingle(x - 1, y - 1) + + this.getNoiseSingle(x, y - 1) + + this.getNoiseSingle(x - 1, y) + + this.getNoiseSingle(x + 1, y) + + this.getNoiseSingle(x, y + 1) + + this.getNoiseSingle(x + 1, y + 1) + + this.getNoiseSingle(x - 1, y + 1) + + this.getNoiseSingle(x + 1, y - 1)) + / 8; } - public double getNoiseSingle(int x, int y){ + public double getNoiseSingle(int x, int y) { double result = 0; for (double i = 1; i <= this.octaves; i++) { - result += 1d/i * this.getNonOctavedNoise(i * x, i * y); + result += 1d / i * this.getNonOctavedNoise(i * x, i * y); } return result; } @@ -187,20 +190,20 @@ public class BartsNoise implements INoiseGen { public double getNoise(int x, int y) { double result = 0; for (double i = 1; i <= this.octaves; i++) { - result += 1d/i * this.getNonOctavedNoise(i * x, y); + result += 1d / i * this.getNonOctavedNoise(i * x, y); } - //result = (this.getNeighbouringNoise(x,y)+result)/2; - return MathUtils.wrap(result,1D); + // result = (this.getNeighbouringNoise(x,y)+result)/2; + return MathUtils.wrap(result, 1D); } @Override public double[][] getNoiseForRegion(int xStart, int zStart, int xEnd, int zEnd) { -// double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; -// for (int i = xStart; i < xEnd; i++) { -// for (int j = zStart; j < zEnd; j++) { -// results -// } -// } + // double[][] results = new double[Math.abs(xEnd)-Math.abs(xStart)][Math.abs(zEnd)-Math.abs(zStart)]; + // for (int i = xStart; i < xEnd; i++) { + // for (int j = zStart; j < zEnd; j++) { + // results + // } + // } return new double[0][0]; } @@ -221,6 +224,6 @@ public class BartsNoise implements INoiseGen { @Override public void setSeed(long seed) { - this.seed=seed; + this.seed = seed; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index 9c9e9ebd8d..427cf5919e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -18,341 +18,418 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; import com.github.bartimaeusnek.bartworks.util.MathUtils; -public class SimplexNoise { // Simplex noise in 2D, 3D and 4D - private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), - new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), - new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; +public class SimplexNoise { // Simplex noise in 2D, 3D and 4D + private static Grad[] grad3 = { + new Grad(1, 1, 0), new Grad(-1, 1, 0), new Grad(1, -1, 0), new Grad(-1, -1, 0), + new Grad(1, 0, 1), new Grad(-1, 0, 1), new Grad(1, 0, -1), new Grad(-1, 0, -1), + new Grad(0, 1, 1), new Grad(0, -1, 1), new Grad(0, 1, -1), new Grad(0, -1, -1) + }; - private static Grad[] grad4 = {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), - new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), - new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), - new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), - new Grad(1,1,0,1),new Grad(1,1,0,-1),new Grad(1,-1,0,1),new Grad(1,-1,0,-1), - new Grad(-1,1,0,1),new Grad(-1,1,0,-1),new Grad(-1,-1,0,1),new Grad(-1,-1,0,-1), - new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), - new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; + private static Grad[] grad4 = { + new Grad(0, 1, 1, 1), + new Grad(0, 1, 1, -1), + new Grad(0, 1, -1, 1), + new Grad(0, 1, -1, -1), + new Grad(0, -1, 1, 1), + new Grad(0, -1, 1, -1), + new Grad(0, -1, -1, 1), + new Grad(0, -1, -1, -1), + new Grad(1, 0, 1, 1), + new Grad(1, 0, 1, -1), + new Grad(1, 0, -1, 1), + new Grad(1, 0, -1, -1), + new Grad(-1, 0, 1, 1), + new Grad(-1, 0, 1, -1), + new Grad(-1, 0, -1, 1), + new Grad(-1, 0, -1, -1), + new Grad(1, 1, 0, 1), + new Grad(1, 1, 0, -1), + new Grad(1, -1, 0, 1), + new Grad(1, -1, 0, -1), + new Grad(-1, 1, 0, 1), + new Grad(-1, 1, 0, -1), + new Grad(-1, -1, 0, 1), + new Grad(-1, -1, 0, -1), + new Grad(1, 1, 1, 0), + new Grad(1, 1, -1, 0), + new Grad(1, -1, 1, 0), + new Grad(1, -1, -1, 0), + new Grad(-1, 1, 1, 0), + new Grad(-1, 1, -1, 0), + new Grad(-1, -1, 1, 0), + new Grad(-1, -1, -1, 0) + }; - private static short[] p = {151,160,137,91,90,15, - 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, - 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, - 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, - 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, - 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, - 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, - 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, - 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, - 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, - 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, - 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, - 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; - // To remove the need for index wrapping, double the permutation table length - private static short[] perm = new short[512]; - private static short[] permMod12 = new short[512]; - static { - for(int i=0; i<512; i++) - { - perm[i]=p[i & 255]; - permMod12[i] = (short)(perm[i] % 12); - } - } - - // Skewing and unskewing factors for 2, 3, and 4 dimensions - private static final double F2 = 0.5*(Math.sqrt(3.0)-1.0); - private static final double G2 = (3.0-Math.sqrt(3.0))/6.0; - private static final double F3 = 1.0/3.0; - private static final double G3 = 1.0/6.0; - private static final double F4 = (Math.sqrt(5.0)-1.0)/4.0; - private static final double G4 = (5.0-Math.sqrt(5.0))/20.0; - - // This method is a *lot* faster than using (int)Math.floor(x) - private static int fastfloor(double x) { - return MathUtils.floorInt(x); - } - - private static double dot(Grad g, double x, double y) { - return g.x*x + g.y*y; } - - private static double dot(Grad g, double x, double y, double z) { - return g.x*x + g.y*y + g.z*z; } + private static short[] p = { + 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, + 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, + 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, + 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, + 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, + 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, + 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, + 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, + 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, + 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, + 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 + }; + // To remove the need for index wrapping, double the permutation table length + private static short[] perm = new short[512]; + private static short[] permMod12 = new short[512]; - private static double dot(Grad g, double x, double y, double z, double w) { - return g.x*x + g.y*y + g.z*z + g.w*w; } - - - // 2D simplex noise - public static double noise(double xin, double yin) { - double n0, n1, n2; // Noise contributions from the three corners - // Skew the input space to determine which simplex cell we're in - double s = (xin+yin)*F2; // Hairy factor for 2D - int i = fastfloor(xin+s); - int j = fastfloor(yin+s); - double t = (i+j)*G2; - double X0 = i-t; // Unskew the cell origin back to (x,y) space - double Y0 = j-t; - double x0 = xin-X0; // The x,y distances from the cell origin - double y0 = yin-Y0; - // For the 2D case, the simplex shape is an equilateral triangle. - // Determine which simplex we are in. - int i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords - if(x0>y0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1) - else {i1=0; j1=1;} // upper triangle, YX order: (0,0)->(0,1)->(1,1) - // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and - // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where - // c = (3-sqrt(3))/6 - double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords - double y1 = y0 - j1 + G2; - double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords - double y2 = y0 - 1.0 + 2.0 * G2; - // Work out the hashed gradient indices of the three simplex corners - int ii = i & 255; - int jj = j & 255; - int gi0 = permMod12[ii+perm[jj]]; - int gi1 = permMod12[ii+i1+perm[jj+j1]]; - int gi2 = permMod12[ii+1+perm[jj+1]]; - // Calculate the contribution from the three corners - double t0 = 0.5 - x0*x0-y0*y0; - if(t0<0) n0 = 0.0; - else { - t0 *= t0; - n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient - } - double t1 = 0.5 - x1*x1-y1*y1; - if(t1<0) n1 = 0.0; - else { - t1 *= t1; - n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + static { + for (int i = 0; i < 512; i++) { + perm[i] = p[i & 255]; + permMod12[i] = (short) (perm[i] % 12); + } } - double t2 = 0.5 - x2*x2-y2*y2; - if(t2<0) n2 = 0.0; - else { - t2 *= t2; - n2 = t2 * t2 * dot(grad3[gi2], x2, y2); - } - // Add contributions from each corner to get the final noise value. - // The result is scaled to return values in the interval [-1,1]. - return 70.0 * (n0 + n1 + n2); - } + // Skewing and unskewing factors for 2, 3, and 4 dimensions + private static final double F2 = 0.5 * (Math.sqrt(3.0) - 1.0); + private static final double G2 = (3.0 - Math.sqrt(3.0)) / 6.0; + private static final double F3 = 1.0 / 3.0; + private static final double G3 = 1.0 / 6.0; + private static final double F4 = (Math.sqrt(5.0) - 1.0) / 4.0; + private static final double G4 = (5.0 - Math.sqrt(5.0)) / 20.0; - // 3D simplex noise - public static double noise(double xin, double yin, double zin) { - double n0, n1, n2, n3; // Noise contributions from the four corners - // Skew the input space to determine which simplex cell we're in - double s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D - int i = fastfloor(xin+s); - int j = fastfloor(yin+s); - int k = fastfloor(zin+s); - double t = (i+j+k)*G3; - double X0 = i-t; // Unskew the cell origin back to (x,y,z) space - double Y0 = j-t; - double Z0 = k-t; - double x0 = xin-X0; // The x,y,z distances from the cell origin - double y0 = yin-Y0; - double z0 = zin-Z0; - // For the 3D case, the simplex shape is a slightly irregular tetrahedron. - // Determine which simplex we are in. - int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords - int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords - if(x0>=y0) { - if(y0>=z0) - { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order - else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order - else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order - } - else { // x0<y0 - if(y0<z0) { i1=0; j1=0; k1=1; i2=0; j2=1; k2=1; } // Z Y X order - else if(x0<z0) { i1=0; j1=1; k1=0; i2=0; j2=1; k2=1; } // Y Z X order - else { i1=0; j1=1; k1=0; i2=1; j2=1; k2=0; } // Y X Z order + // This method is a *lot* faster than using (int)Math.floor(x) + private static int fastfloor(double x) { + return MathUtils.floorInt(x); } - // A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), - // a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and - // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where - // c = 1/6. - double x1 = x0 - i1 + G3; // Offsets for second corner in (x,y,z) coords - double y1 = y0 - j1 + G3; - double z1 = z0 - k1 + G3; - double x2 = x0 - i2 + 2.0*G3; // Offsets for third corner in (x,y,z) coords - double y2 = y0 - j2 + 2.0*G3; - double z2 = z0 - k2 + 2.0*G3; - double x3 = x0 - 1.0 + 3.0*G3; // Offsets for last corner in (x,y,z) coords - double y3 = y0 - 1.0 + 3.0*G3; - double z3 = z0 - 1.0 + 3.0*G3; - // Work out the hashed gradient indices of the four simplex corners - int ii = i & 255; - int jj = j & 255; - int kk = k & 255; - int gi0 = permMod12[ii+perm[jj+perm[kk]]]; - int gi1 = permMod12[ii+i1+perm[jj+j1+perm[kk+k1]]]; - int gi2 = permMod12[ii+i2+perm[jj+j2+perm[kk+k2]]]; - int gi3 = permMod12[ii+1+perm[jj+1+perm[kk+1]]]; - // Calculate the contribution from the four corners - double t0 = 0.6 - x0*x0 - y0*y0 - z0*z0; - if(t0<0) n0 = 0.0; - else { - t0 *= t0; - n0 = t0 * t0 * dot(grad3[gi0], x0, y0, z0); + + private static double dot(Grad g, double x, double y) { + return g.x * x + g.y * y; } - double t1 = 0.6 - x1*x1 - y1*y1 - z1*z1; - if(t1<0) n1 = 0.0; - else { - t1 *= t1; - n1 = t1 * t1 * dot(grad3[gi1], x1, y1, z1); + + private static double dot(Grad g, double x, double y, double z) { + return g.x * x + g.y * y + g.z * z; } - double t2 = 0.6 - x2*x2 - y2*y2 - z2*z2; - if(t2<0) n2 = 0.0; - else { - t2 *= t2; - n2 = t2 * t2 * dot(grad3[gi2], x2, y2, z2); + + private static double dot(Grad g, double x, double y, double z, double w) { + return g.x * x + g.y * y + g.z * z + g.w * w; } - double t3 = 0.6 - x3*x3 - y3*y3 - z3*z3; - if(t3<0) n3 = 0.0; - else { - t3 *= t3; - n3 = t3 * t3 * dot(grad3[gi3], x3, y3, z3); + + // 2D simplex noise + public static double noise(double xin, double yin) { + double n0, n1, n2; // Noise contributions from the three corners + // Skew the input space to determine which simplex cell we're in + double s = (xin + yin) * F2; // Hairy factor for 2D + int i = fastfloor(xin + s); + int j = fastfloor(yin + s); + double t = (i + j) * G2; + double X0 = i - t; // Unskew the cell origin back to (x,y) space + double Y0 = j - t; + double x0 = xin - X0; // The x,y distances from the cell origin + double y0 = yin - Y0; + // For the 2D case, the simplex shape is an equilateral triangle. + // Determine which simplex we are in. + int i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords + if (x0 > y0) { + i1 = 1; + j1 = 0; + } // lower triangle, XY order: (0,0)->(1,0)->(1,1) + else { + i1 = 0; + j1 = 1; + } // upper triangle, YX order: (0,0)->(0,1)->(1,1) + // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and + // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where + // c = (3-sqrt(3))/6 + double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords + double y1 = y0 - j1 + G2; + double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords + double y2 = y0 - 1.0 + 2.0 * G2; + // Work out the hashed gradient indices of the three simplex corners + int ii = i & 255; + int jj = j & 255; + int gi0 = permMod12[ii + perm[jj]]; + int gi1 = permMod12[ii + i1 + perm[jj + j1]]; + int gi2 = permMod12[ii + 1 + perm[jj + 1]]; + // Calculate the contribution from the three corners + double t0 = 0.5 - x0 * x0 - y0 * y0; + if (t0 < 0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient + } + double t1 = 0.5 - x1 * x1 - y1 * y1; + if (t1 < 0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + } + double t2 = 0.5 - x2 * x2 - y2 * y2; + if (t2 < 0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to return values in the interval [-1,1]. + return 70.0 * (n0 + n1 + n2); } - // Add contributions from each corner to get the final noise value. - // The result is scaled to stay just inside [-1,1] - return 32.0*(n0 + n1 + n2 + n3); - } + // 3D simplex noise + public static double noise(double xin, double yin, double zin) { + double n0, n1, n2, n3; // Noise contributions from the four corners + // Skew the input space to determine which simplex cell we're in + double s = (xin + yin + zin) * F3; // Very nice and simple skew factor for 3D + int i = fastfloor(xin + s); + int j = fastfloor(yin + s); + int k = fastfloor(zin + s); + double t = (i + j + k) * G3; + double X0 = i - t; // Unskew the cell origin back to (x,y,z) space + double Y0 = j - t; + double Z0 = k - t; + double x0 = xin - X0; // The x,y,z distances from the cell origin + double y0 = yin - Y0; + double z0 = zin - Z0; + // For the 3D case, the simplex shape is a slightly irregular tetrahedron. + // Determine which simplex we are in. + int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords + int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords + if (x0 >= y0) { + if (y0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; + } // X Y Z order + else if (x0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 0; + k2 = 1; + } // X Z Y order + else { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 1; + j2 = 0; + k2 = 1; + } // Z X Y order + } else { // x0<y0 + if (y0 < z0) { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 0; + j2 = 1; + k2 = 1; + } // Z Y X order + else if (x0 < z0) { + i1 = 0; + j1 = 1; + k1 = 0; + i2 = 0; + j2 = 1; + k2 = 1; + } // Y Z X order + else { + i1 = 0; + j1 = 1; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; + } // Y X Z order + } + // A step of (1,0,0) in (i,j,k) means a step of (1-c,-c,-c) in (x,y,z), + // a step of (0,1,0) in (i,j,k) means a step of (-c,1-c,-c) in (x,y,z), and + // a step of (0,0,1) in (i,j,k) means a step of (-c,-c,1-c) in (x,y,z), where + // c = 1/6. + double x1 = x0 - i1 + G3; // Offsets for second corner in (x,y,z) coords + double y1 = y0 - j1 + G3; + double z1 = z0 - k1 + G3; + double x2 = x0 - i2 + 2.0 * G3; // Offsets for third corner in (x,y,z) coords + double y2 = y0 - j2 + 2.0 * G3; + double z2 = z0 - k2 + 2.0 * G3; + double x3 = x0 - 1.0 + 3.0 * G3; // Offsets for last corner in (x,y,z) coords + double y3 = y0 - 1.0 + 3.0 * G3; + double z3 = z0 - 1.0 + 3.0 * G3; + // Work out the hashed gradient indices of the four simplex corners + int ii = i & 255; + int jj = j & 255; + int kk = k & 255; + int gi0 = permMod12[ii + perm[jj + perm[kk]]]; + int gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]]; + int gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]]; + int gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]]; + // Calculate the contribution from the four corners + double t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0; + if (t0 < 0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0, z0); + } + double t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1; + if (t1 < 0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1, z1); + } + double t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2; + if (t2 < 0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2, z2); + } + double t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3; + if (t3 < 0) n3 = 0.0; + else { + t3 *= t3; + n3 = t3 * t3 * dot(grad3[gi3], x3, y3, z3); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to stay just inside [-1,1] + return 32.0 * (n0 + n1 + n2 + n3); + } - // 4D simplex noise, better simplex rank ordering method 2012-03-09 - public static double noise(double x, double y, double z, double w) { + // 4D simplex noise, better simplex rank ordering method 2012-03-09 + public static double noise(double x, double y, double z, double w) { - double n0, n1, n2, n3, n4; // Noise contributions from the five corners - // Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in - double s = (x + y + z + w) * F4; // Factor for 4D skewing - int i = fastfloor(x + s); - int j = fastfloor(y + s); - int k = fastfloor(z + s); - int l = fastfloor(w + s); - double t = (i + j + k + l) * G4; // Factor for 4D unskewing - double X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space - double Y0 = j - t; - double Z0 = k - t; - double W0 = l - t; - double x0 = x - X0; // The x,y,z,w distances from the cell origin - double y0 = y - Y0; - double z0 = z - Z0; - double w0 = w - W0; - // For the 4D case, the simplex is a 4D shape I won't even try to describe. - // To find out which of the 24 possible simplices we're in, we need to - // determine the magnitude ordering of x0, y0, z0 and w0. - // Six pair-wise comparisons are performed between each possible pair - // of the four coordinates, and the results are used to rank the numbers. - int rankx = 0; - int ranky = 0; - int rankz = 0; - int rankw = 0; - if(x0 > y0) rankx++; else ranky++; - if(x0 > z0) rankx++; else rankz++; - if(x0 > w0) rankx++; else rankw++; - if(y0 > z0) ranky++; else rankz++; - if(y0 > w0) ranky++; else rankw++; - if(z0 > w0) rankz++; else rankw++; - int i1, j1, k1, l1; // The integer offsets for the second simplex corner - int i2, j2, k2, l2; // The integer offsets for the third simplex corner - int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner - // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. - // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w - // impossible. Only the 24 indices which have non-zero entries make any sense. - // We use a thresholding to set the coordinates in turn from the largest magnitude. - // Rank 3 denotes the largest coordinate. - i1 = rankx >= 3 ? 1 : 0; - j1 = ranky >= 3 ? 1 : 0; - k1 = rankz >= 3 ? 1 : 0; - l1 = rankw >= 3 ? 1 : 0; - // Rank 2 denotes the second largest coordinate. - i2 = rankx >= 2 ? 1 : 0; - j2 = ranky >= 2 ? 1 : 0; - k2 = rankz >= 2 ? 1 : 0; - l2 = rankw >= 2 ? 1 : 0; - // Rank 1 denotes the second smallest coordinate. - i3 = rankx >= 1 ? 1 : 0; - j3 = ranky >= 1 ? 1 : 0; - k3 = rankz >= 1 ? 1 : 0; - l3 = rankw >= 1 ? 1 : 0; - // The fifth corner has all coordinate offsets = 1, so no need to compute that. - double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords - double y1 = y0 - j1 + G4; - double z1 = z0 - k1 + G4; - double w1 = w0 - l1 + G4; - double x2 = x0 - i2 + 2.0*G4; // Offsets for third corner in (x,y,z,w) coords - double y2 = y0 - j2 + 2.0*G4; - double z2 = z0 - k2 + 2.0*G4; - double w2 = w0 - l2 + 2.0*G4; - double x3 = x0 - i3 + 3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords - double y3 = y0 - j3 + 3.0*G4; - double z3 = z0 - k3 + 3.0*G4; - double w3 = w0 - l3 + 3.0*G4; - double x4 = x0 - 1.0 + 4.0*G4; // Offsets for last corner in (x,y,z,w) coords - double y4 = y0 - 1.0 + 4.0*G4; - double z4 = z0 - 1.0 + 4.0*G4; - double w4 = w0 - 1.0 + 4.0*G4; - // Work out the hashed gradient indices of the five simplex corners - int ii = i & 255; - int jj = j & 255; - int kk = k & 255; - int ll = l & 255; - int gi0 = perm[ii+perm[jj+perm[kk+perm[ll]]]] % 32; - int gi1 = perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]] % 32; - int gi2 = perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]] % 32; - int gi3 = perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]] % 32; - int gi4 = perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]] % 32; - // Calculate the contribution from the five corners - double t0 = 0.6 - x0*x0 - y0*y0 - z0*z0 - w0*w0; - if(t0<0) n0 = 0.0; - else { - t0 *= t0; - n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); - } - double t1 = 0.6 - x1*x1 - y1*y1 - z1*z1 - w1*w1; - if(t1<0) n1 = 0.0; - else { - t1 *= t1; - n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + double n0, n1, n2, n3, n4; // Noise contributions from the five corners + // Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in + double s = (x + y + z + w) * F4; // Factor for 4D skewing + int i = fastfloor(x + s); + int j = fastfloor(y + s); + int k = fastfloor(z + s); + int l = fastfloor(w + s); + double t = (i + j + k + l) * G4; // Factor for 4D unskewing + double X0 = i - t; // Unskew the cell origin back to (x,y,z,w) space + double Y0 = j - t; + double Z0 = k - t; + double W0 = l - t; + double x0 = x - X0; // The x,y,z,w distances from the cell origin + double y0 = y - Y0; + double z0 = z - Z0; + double w0 = w - W0; + // For the 4D case, the simplex is a 4D shape I won't even try to describe. + // To find out which of the 24 possible simplices we're in, we need to + // determine the magnitude ordering of x0, y0, z0 and w0. + // Six pair-wise comparisons are performed between each possible pair + // of the four coordinates, and the results are used to rank the numbers. + int rankx = 0; + int ranky = 0; + int rankz = 0; + int rankw = 0; + if (x0 > y0) rankx++; + else ranky++; + if (x0 > z0) rankx++; + else rankz++; + if (x0 > w0) rankx++; + else rankw++; + if (y0 > z0) ranky++; + else rankz++; + if (y0 > w0) ranky++; + else rankw++; + if (z0 > w0) rankz++; + else rankw++; + int i1, j1, k1, l1; // The integer offsets for the second simplex corner + int i2, j2, k2, l2; // The integer offsets for the third simplex corner + int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner + // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. + // Many values of c will never occur, since e.g. x>y>z>w makes x<z, y<w and x<w + // impossible. Only the 24 indices which have non-zero entries make any sense. + // We use a thresholding to set the coordinates in turn from the largest magnitude. + // Rank 3 denotes the largest coordinate. + i1 = rankx >= 3 ? 1 : 0; + j1 = ranky >= 3 ? 1 : 0; + k1 = rankz >= 3 ? 1 : 0; + l1 = rankw >= 3 ? 1 : 0; + // Rank 2 denotes the second largest coordinate. + i2 = rankx >= 2 ? 1 : 0; + j2 = ranky >= 2 ? 1 : 0; + k2 = rankz >= 2 ? 1 : 0; + l2 = rankw >= 2 ? 1 : 0; + // Rank 1 denotes the second smallest coordinate. + i3 = rankx >= 1 ? 1 : 0; + j3 = ranky >= 1 ? 1 : 0; + k3 = rankz >= 1 ? 1 : 0; + l3 = rankw >= 1 ? 1 : 0; + // The fifth corner has all coordinate offsets = 1, so no need to compute that. + double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords + double y1 = y0 - j1 + G4; + double z1 = z0 - k1 + G4; + double w1 = w0 - l1 + G4; + double x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords + double y2 = y0 - j2 + 2.0 * G4; + double z2 = z0 - k2 + 2.0 * G4; + double w2 = w0 - l2 + 2.0 * G4; + double x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords + double y3 = y0 - j3 + 3.0 * G4; + double z3 = z0 - k3 + 3.0 * G4; + double w3 = w0 - l3 + 3.0 * G4; + double x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords + double y4 = y0 - 1.0 + 4.0 * G4; + double z4 = z0 - 1.0 + 4.0 * G4; + double w4 = w0 - 1.0 + 4.0 * G4; + // Work out the hashed gradient indices of the five simplex corners + int ii = i & 255; + int jj = j & 255; + int kk = k & 255; + int ll = l & 255; + int gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32; + int gi1 = perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32; + int gi2 = perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32; + int gi3 = perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32; + int gi4 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32; + // Calculate the contribution from the five corners + double t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; + if (t0 < 0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); + } + double t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1; + if (t1 < 0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + } + double t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2; + if (t2 < 0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); + } + double t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3; + if (t3 < 0) n3 = 0.0; + else { + t3 *= t3; + n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); + } + double t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4; + if (t4 < 0) n4 = 0.0; + else { + t4 *= t4; + n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); + } + // Sum up and scale the result to cover the range [-1,1] + return 27.0 * (n0 + n1 + n2 + n3 + n4); } - double t2 = 0.6 - x2*x2 - y2*y2 - z2*z2 - w2*w2; - if(t2<0) n2 = 0.0; - else { - t2 *= t2; - n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); - } - double t3 = 0.6 - x3*x3 - y3*y3 - z3*z3 - w3*w3; - if(t3<0) n3 = 0.0; - else { - t3 *= t3; - n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); - } - double t4 = 0.6 - x4*x4 - y4*y4 - z4*z4 - w4*w4; - if(t4<0) n4 = 0.0; - else { - t4 *= t4; - n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); - } - // Sum up and scale the result to cover the range [-1,1] - return 27.0 * (n0 + n1 + n2 + n3 + n4); - } - // Inner class to speed upp gradient computations - // (array access is a lot slower than member access) - private static class Grad - { - double x, y, z, w; + // Inner class to speed upp gradient computations + // (array access is a lot slower than member access) + private static class Grad { + double x, y, z, w; - Grad(double x, double y, double z) - { - this.x = x; - this.y = y; - this.z = z; - } + Grad(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } - Grad(double x, double y, double z, double w) - { - this.x = x; - this.y = y; - this.z = z; - this.w = w; + Grad(double x, double y, double z, double w) { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java index 3ea9983d80..2ccc22d1dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashMap.java @@ -27,7 +27,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -public class NonNullWrappedHashMap<K,V> extends HashMap<K,V> { +public class NonNullWrappedHashMap<K, V> extends HashMap<K, V> { private V defaultValue; @@ -57,6 +57,7 @@ public class NonNullWrappedHashMap<K,V> extends HashMap<K,V> { @Override public V getOrDefault(Object key, V defaultValue) { - return Objects.requireNonNull(Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); + return Objects.requireNonNull( + Optional.ofNullable(super.getOrDefault(key, defaultValue)).orElse(this.defaultValue)); } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java index f7ed76278e..cb677be388 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NonNullWrappedHashSet.java @@ -45,16 +45,14 @@ public class NonNullWrappedHashSet<E> extends HashSet<E> { } public boolean add(E e) { - if (e != null) - return super.add(e); + if (e != null) return super.add(e); return false; } public boolean addAll(Collection<? extends E> c) { boolean wasChanged = false; for (E element : c) { - if (element != null) - wasChanged |= this.add(element); + if (element != null) wasChanged |= this.add(element); } return wasChanged; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index a64793676c..0ebb5a4c37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -30,7 +30,6 @@ import java.util.Map; public class Pair<A, B> implements Map.Entry<A, B> { Object[] pair = new Object[2]; - public Pair(Object[] pair) { this.pair = pair; } @@ -53,7 +52,14 @@ public class Pair<A, B> implements Map.Entry<A, B> { @Override public int hashCode() { - return MurmurHash3.murmurhash3_x86_32(ByteBuffer.allocate(8).putInt(pair[0].hashCode()).putInt(pair[1].hashCode()).array(), 0, 8, 31); + return MurmurHash3.murmurhash3_x86_32( + ByteBuffer.allocate(8) + .putInt(pair[0].hashCode()) + .putInt(pair[1].hashCode()) + .array(), + 0, + 8, + 31); } @Override @@ -72,11 +78,11 @@ public class Pair<A, B> implements Map.Entry<A, B> { return (B) pair[1]; } - public Pair<A,B> copyWithNewValue(B value){ - return new Pair<>((A)this.pair[0],value); + public Pair<A, B> copyWithNewValue(B value) { + return new Pair<>((A) this.pair[0], value); } - public Pair<A,B> replaceValue(B value){ + public Pair<A, B> replaceValue(B value) { this.setValue(value); return this; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java index 50f5f4f685..daa9994053 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/RecipeFinderForParallel.java @@ -3,19 +3,17 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; /** * Handle the parallel more efficient. * * @author GlodBlock */ - public class RecipeFinderForParallel { /** @@ -29,7 +27,8 @@ public class RecipeFinderForParallel { * @param aMaxParallel The max parallel that it can reach * @return The parallel that it can reach */ - public static int handleParallelRecipe(GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { + public static int handleParallelRecipe( + GT_Recipe aRecipe, FluidStack[] aFluidInputs, ItemStack[] aItemStacks, int aMaxParallel) { if (aFluidInputs == null) aFluidInputs = new FluidStack[0]; if (aItemStacks == null) aItemStacks = new ItemStack[0]; HashMap<Integer, Integer> tCompressedFluidInput = compressFluid(aFluidInputs); @@ -39,7 +38,8 @@ public class RecipeFinderForParallel { int tCurrentPara = aMaxParallel; for (int tFluid : tCompressedFluidRecipe.keySet()) { if (tCompressedFluidInput.containsKey(tFluid) && tCompressedFluidRecipe.get(tFluid) != 0) { - tCurrentPara = Math.min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); + tCurrentPara = + Math.min(tCurrentPara, tCompressedFluidInput.get(tFluid) / tCompressedFluidRecipe.get(tFluid)); } } for (int tItem : tCompressedItemRecipe.keySet()) { @@ -52,8 +52,7 @@ public class RecipeFinderForParallel { } } tCurrentPara = Math.min(tCurrentPara, tCountWildcard / tCompressedItemRecipe.get(tItem)); - } - else if (tCompressedItemRecipe.get(tItem) != 0) { + } else if (tCompressedItemRecipe.get(tItem) != 0) { /*OreDict Stuff*/ int tCountOre = 0; ItemStack tRealRecipe = GT_Utility.intToStack(tItem); @@ -81,9 +80,9 @@ public class RecipeFinderForParallel { if (tFluid.amount >= tCompressedFluidRecipe.get(tFluid.getFluidID())) { tFluid.amount -= tCompressedFluidRecipe.get(tFluid.getFluidID()); tCompressedFluidRecipe.remove(tFluid.getFluidID()); - } - else { - tCompressedFluidRecipe.put(tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); + } else { + tCompressedFluidRecipe.put( + tFluid.getFluidID(), tCompressedFluidRecipe.get(tFluid.getFluidID()) - tFluid.amount); tFluid.amount = 0; } } @@ -91,7 +90,7 @@ public class RecipeFinderForParallel { /*OreDict Stuff*/ /*Wildcard Stuff*/ - for (Iterator<Integer> i = tCompressedItemRecipe.keySet().iterator(); i.hasNext();) { + for (Iterator<Integer> i = tCompressedItemRecipe.keySet().iterator(); i.hasNext(); ) { int tItem = i.next(); if (tItem >> 16 == Short.MAX_VALUE) { for (ItemStack tInputItem : aItemStacks) { @@ -101,15 +100,13 @@ public class RecipeFinderForParallel { tInputItem.stackSize -= tCompressedItemRecipe.get(tItem); i.remove(); break; - } - else { + } else { tCompressedItemRecipe.put(tItem, tCompressedItemRecipe.get(tItem) - tInputItem.stackSize); tInputItem.stackSize = 0; } } } - } - else { + } else { ItemStack tRealRecipe = GT_Utility.intToStack(tItem); int tTargetAmount = tCompressedItemRecipe.get(tItem); for (ItemStack input : aItemStacks) { @@ -140,8 +137,7 @@ public class RecipeFinderForParallel { public static Pair<ArrayList<FluidStack>, ArrayList<ItemStack>> getMultiOutput(GT_Recipe aRecipe, int aPall) { ArrayList<FluidStack> tFluidList = new ArrayList<>(); ArrayList<ItemStack> tItemList = new ArrayList<>(); - if (aRecipe == null) - return new Pair<>(tFluidList, tItemList); + if (aRecipe == null) return new Pair<>(tFluidList, tItemList); if (aRecipe.mFluidOutputs != null && aRecipe.mFluidOutputs.length > 0) { for (FluidStack tFluid : aRecipe.mFluidOutputs) { if (tFluid != null && tFluid.amount > 0) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java index 9083ee468f..b1d1bac0d1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/StreamUtils.java @@ -23,15 +23,14 @@ package com.github.bartimaeusnek.bartworks.util; import gregtech.api.util.GT_Recipe; - import java.util.Optional; import java.util.function.Predicate; public class StreamUtils { - private StreamUtils(){} + private StreamUtils() {} public static Predicate<GT_Recipe.GT_Recipe_Map> filterVisualMaps() { - return gt_recipe_map -> { + return gt_recipe_map -> { Optional<GT_Recipe> op = gt_recipe_map.mRecipeList.stream().findAny(); return op.isPresent() && !op.get().mFakeRecipe; }; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java index 4529aa5202..22e2a4e719 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityList.java @@ -22,9 +22,8 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; -import org.apache.commons.lang3.NotImplementedException; - import java.util.*; +import org.apache.commons.lang3.NotImplementedException; @SuppressWarnings("ALL") public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { @@ -37,18 +36,15 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { return new AccessPriorityList(); } - public AccessPriorityList() { - } + public AccessPriorityList() {} @Override public void addFirst(E t) { final AccessPriorityListNode<E> first = head; final AccessPriorityListNode<E> newNode = new AccessPriorityListNode<>(null, t, first); head = newNode; - if (first == null) - tail = newNode; - else - first.setBefore(newNode); + if (first == null) tail = newNode; + else first.setBefore(newNode); size++; } @@ -57,10 +53,8 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { final AccessPriorityListNode<E> last = tail; final AccessPriorityListNode<E> newNode = new AccessPriorityListNode<>(last, t, null); tail = newNode; - if (last == null) - head = newNode; - else - last.setNext(newNode); + if (last == null) head = newNode; + else last.setNext(newNode); size++; } @@ -162,7 +156,6 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { return new AccessPriorityListIterators.AccessPriorityListNodeIterator<>(head); } - @Override public Iterator<E> descendingIterator() { return new AccessPriorityListIterators.AccessPriorityListReverseIterator<>(tail); @@ -172,8 +165,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { public Object[] toArray() { Object[] ret = new Object[size]; int index = 0; - for (Iterator<E> it = iterator(); it.hasNext(); index++) - ret[index] = it.next(); + for (Iterator<E> it = iterator(); it.hasNext(); index++) ret[index] = it.next(); return ret; } @@ -181,8 +173,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { public <T> T[] toArray(T[] a) { T[] ret = (T[]) new Object[size]; int index = 0; - for (Iterator<T> it = (Iterator<T>) iterator(); it.hasNext(); index++) - ret[index] = it.next(); + for (Iterator<T> it = (Iterator<T>) iterator(); it.hasNext(); index++) ret[index] = it.next(); return ret; } @@ -193,8 +184,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { } private void moveNodeUp(AccessPriorityListNode<E> node) { - if (node == head || node.getBefore() == null) - return; + if (node == head || node.getBefore() == null) return; final AccessPriorityListNode<E> before = node.getBefore(); final AccessPriorityListNode<E> beforeBefore = before.getBefore(); final AccessPriorityListNode<E> next = node.getNext(); @@ -204,10 +194,8 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { node.setBefore(beforeBefore); // <0,1,2> <1,2,3> N<0,3,4> <3,4,5> - if (beforeBefore != null) - beforeBefore.setNext(node); - else - head = node; + if (beforeBefore != null) beforeBefore.setNext(node); + else head = node; // <0,1,3> <1,2,3> N<0,3,4> <3,4,5> before.setBefore(node); @@ -216,10 +204,8 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { before.setNext(next); // <0,1,3> <3,2,4> N<0,3,4> <3,4,5> - if (next != null) - next.setBefore(before); - else - tail = before; + if (next != null) next.setBefore(before); + else tail = before; // <0,1,3> N<0,3,4> <3,2,4> <2,4,5> node.setNext(before); @@ -229,13 +215,11 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { AccessPriorityListNode<E> getNode(int index) { if (index <= (size / 2)) { AccessPriorityListNode<E> x = head; - for (int i = 0; i < index; i++) - x = x.getNext(); + for (int i = 0; i < index; i++) x = x.getNext(); return x; } else { AccessPriorityListNode<E> x = tail; - for (int i = size - 1; i > index; i--) - x = x.getBefore(); + for (int i = size - 1; i > index; i--) x = x.getBefore(); return x; } } @@ -246,8 +230,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { } private boolean isValidIndex(int index) { - if (index >= 0 && index < size) - return true; + if (index >= 0 && index < size) return true; throw new ArrayIndexOutOfBoundsException("NOT A VAILD INDEX!"); } @@ -283,10 +266,10 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { @Override public boolean remove(Object o) { -// Object p; -// for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ -// p = it.next(); -// } + // Object p; + // for (Iterator it = this.iterator(); it.hasNext(); o.equals(p)){ + // p = it.next(); + // } throw new NotImplementedException(""); } @@ -297,8 +280,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { @Override public boolean addAll(Collection<? extends E> c) { - if (c == null) - return false; + if (c == null) return false; c.forEach(this::addLast); return true; } @@ -338,20 +320,19 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { addPrioToNode(node, 1L); } - public void addPrioToNode(AccessPriorityListNode<E> node, long prio){ + public void addPrioToNode(AccessPriorityListNode<E> node, long prio) { long current = node.getPriority(); if (current == Long.MAX_VALUE || (current > 0 && prio > 0 && prio + current < 0)) node.setPriority(Long.MAX_VALUE); - else - node.setPriority(current + prio); - while (node.getBefore() != null && node.getPriority() >= node.getBefore().getPriority()) { + else node.setPriority(current + prio); + while (node.getBefore() != null + && node.getPriority() >= node.getBefore().getPriority()) { moveNodeUp(node); } } public void addPrioToNode(int index, long prio) { - if (!isValidIndex(index)) - return; + if (!isValidIndex(index)) return; AccessPriorityListNode<E> node = getNode(index); addPrioToNode(node, prio); } @@ -362,8 +343,7 @@ public class AccessPriorityList<E> implements List<E>, Deque<E>, Set<E> { @Override public E get(int index) { - if (!isValidIndex(index)) - return null; + if (!isValidIndex(index)) return null; AccessPriorityListNode<E> node = getNode(index); return node.getELEMENT(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java index ec842ede30..4e423b0654 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListIterators.java @@ -22,21 +22,21 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; -import org.apache.commons.lang3.NotImplementedException; - import java.util.Iterator; import java.util.ListIterator; +import org.apache.commons.lang3.NotImplementedException; public class AccessPriorityListIterators { - public static class AccessPriorityListListIterator<E> implements ListIterator<E> { final AccessPriorityListNode<E> head; final AccessPriorityListNode<E> tail; AccessPriorityListNode<E> current; int counter = 0; boolean reverse; - public AccessPriorityListListIterator(AccessPriorityListNode<E> head, AccessPriorityListNode<E> tail, boolean reverse) { + + public AccessPriorityListListIterator( + AccessPriorityListNode<E> head, AccessPriorityListNode<E> tail, boolean reverse) { this.head = head; this.tail = tail; current = reverse ? tail : head; @@ -78,12 +78,12 @@ public class AccessPriorityListIterators { @Override public int nextIndex() { - return counter+1; + return counter + 1; } @Override public int previousIndex() { - return counter-1; + return counter - 1; } @Override @@ -105,6 +105,7 @@ public class AccessPriorityListIterators { public static class AccessPriorityListIterator<E> implements Iterator<E> { final AccessPriorityListNode<E> head; AccessPriorityListNode<E> current; + public AccessPriorityListIterator(AccessPriorityListNode<E> head) { this.head = this.current = head; } @@ -146,6 +147,7 @@ public class AccessPriorityListIterators { public static class AccessPriorityListNodeIterator<E> implements Iterator<AccessPriorityListNode<E>> { final AccessPriorityListNode<E> head; AccessPriorityListNode<E> current; + public AccessPriorityListNodeIterator(AccessPriorityListNode<E> head) { this.head = this.current = head; } @@ -162,5 +164,4 @@ public class AccessPriorityListIterators { return ret; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java index 3c0a037a88..1abeeb6e45 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/accessprioritylist/AccessPriorityListNode.java @@ -24,7 +24,7 @@ package com.github.bartimaeusnek.bartworks.util.accessprioritylist; public class AccessPriorityListNode<E> { - public final static AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); + public static final AccessPriorityListNode EMPTY_NODE = new AccessPriorityListNode(null); private final E ELEMENT; private long priority = Long.MIN_VALUE; @@ -40,7 +40,7 @@ public class AccessPriorityListNode<E> { connect(next, before); } - public void connect(AccessPriorityListNode<E> next, AccessPriorityListNode<E> before){ + public void connect(AccessPriorityListNode<E> next, AccessPriorityListNode<E> before) { this.setNext(next); this.setBefore(before); } @@ -73,7 +73,7 @@ public class AccessPriorityListNode<E> { this.before = before; } - void destroy(){ + void destroy() { this.before = null; this.next = null; this.priority = 0L; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java index 3a43bba536..5fd9dac817 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/flowerset/FlowerSet.java @@ -106,9 +106,7 @@ public class FlowerSet<T> implements Set<T> { } @Override - public void clear() { - - } + public void clear() {} static class FlowerNode<V> { private final FlowerSet<V> map; @@ -124,19 +122,14 @@ public class FlowerSet<T> implements Set<T> { private static final int DEPTH = 20480; public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place, int depth) { - if (depth > DEPTH) - throw new IllegalStateException("Recursive Call went too deep."); - if (node.links[place] == null) - node.links[place] = toset; - else - TryToSetSingleNode(node.links[place], toset, place, depth++); + if (depth > DEPTH) throw new IllegalStateException("Recursive Call went too deep."); + if (node.links[place] == null) node.links[place] = toset; + else TryToSetSingleNode(node.links[place], toset, place, depth++); } public void TryToSetSingleNode(FlowerNode node, FlowerNode toset, int place) { - if (node.links[place] == null) - node.links[place] = toset; - else - TryToSetSingleNode(node.links[place], toset, place, 0); + if (node.links[place] == null) node.links[place] = toset; + else TryToSetSingleNode(node.links[place], toset, place, 0); } @SafeVarargs @@ -153,5 +146,4 @@ public class FlowerSet<T> implements Set<T> { return function -> function.hashCode() % function.map.petals; } } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java index 1009ed4bc1..a52491c353 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/log/DebugLog.java @@ -23,7 +23,6 @@ package com.github.bartimaeusnek.bartworks.util.log; import cpw.mods.fml.common.event.FMLPreInitializationEvent; - import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; @@ -40,9 +39,10 @@ public class DebugLog { private static Logger utilLog; public static void initDebugLog(FMLPreInitializationEvent event) throws IOException { - if (DebugLog.init) - return; - DebugLog.fh = new FileHandler(new File(new File(event.getModConfigurationDirectory().getParentFile(),"logs"),"BWLog.log").toString()); + if (DebugLog.init) return; + DebugLog.fh = new FileHandler( + new File(new File(event.getModConfigurationDirectory().getParentFile(), "logs"), "BWLog.log") + .toString()); DebugLog.utilLog = Logger.getLogger("DebugLog"); DebugLog.utilLog.setUseParentHandlers(false); DebugLog.utilLog.addHandler(DebugLog.fh); @@ -53,7 +53,7 @@ public class DebugLog { Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(record.getMillis()); return "Level: " + record.getLevel() - +" at " + logTime.format(cal.getTime()) + + " at " + logTime.format(cal.getTime()) + " " + record.getMessage() + "\n"; } }; @@ -61,9 +61,8 @@ public class DebugLog { DebugLog.init = true; } - public static void log(String record){ - if (!DebugLog.init) - return; + public static void log(String record) { + if (!DebugLog.init) return; DebugLog.utilLog.info(record); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java index a8fd428baa..0e846834ca 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/package-info.java @@ -23,4 +23,4 @@ package com.github.bartimaeusnek.bartworks.util; import com.github.bartimaeusnek.bartworks.API.API_REFERENCE; -import cpw.mods.fml.common.API;
\ No newline at end of file +import cpw.mods.fml.common.API; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 7f0a8ef426..a37db6b509 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -33,27 +33,25 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; +import java.io.StringReader; import net.minecraft.util.StringTranslate; import org.apache.commons.io.input.ReaderInputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.io.StringReader; - @Mod( - modid = BartWorksCrossmod.MOD_ID, - name = BartWorksCrossmod.NAME, - version = BartWorksCrossmod.VERSION, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " - + "required-after:bartworks;" - + "after:GalacticraftMars; " - + "after:GalacticraftCore; " - + "after:Micdoodlecore; " - + "after:miscutils; " - + "after:EMT; " - + "after:tectech; " -) + modid = BartWorksCrossmod.MOD_ID, + name = BartWorksCrossmod.NAME, + version = BartWorksCrossmod.VERSION, + dependencies = "required-after:IC2; " + + "required-after:gregtech; " + + "required-after:bartworks;" + + "after:GalacticraftMars; " + + "after:GalacticraftCore; " + + "after:Micdoodlecore; " + + "after:miscutils; " + + "after:EMT; " + + "after:tectech; ") public class BartWorksCrossmod { public static final String NAME = "BartWorks Mod Additions"; public static final String VERSION = MainMod.VERSION; @@ -65,53 +63,46 @@ public class BartWorksCrossmod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { -// if (LoaderReference.appliedenergistics2) -// new ItemSingleItemStorageCell("singleItemStorageCell"); - if (LoaderReference.GalacticraftCore) - GalacticraftProxy.preInit(preinit); - if (LoaderReference.Thaumcraft) - new CustomAspects(); + // if (LoaderReference.appliedenergistics2) + // new ItemSingleItemStorageCell("singleItemStorageCell"); + if (LoaderReference.GalacticraftCore) GalacticraftProxy.preInit(preinit); + if (LoaderReference.Thaumcraft) new CustomAspects(); } @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (LoaderReference.GalacticraftCore) - GalacticraftProxy.init(init); + if (LoaderReference.GalacticraftCore) GalacticraftProxy.init(init); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent init) { - if (LoaderReference.GalacticraftCore) - GalacticraftProxy.postInit(init); - if (LoaderReference.miscutils) - RadioHatchCompat.run(); - if (LoaderReference.tectech) - TecTechResearchLoader.runResearches(); + if (LoaderReference.GalacticraftCore) GalacticraftProxy.postInit(init); + if (LoaderReference.miscutils) RadioHatchCompat.run(); + if (LoaderReference.tectech) TecTechResearchLoader.runResearches(); } -// @Mod.EventHandler -// public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ -// for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ -// if (mapping.name.equalsIgnoreCase()) -// } -// } - + // @Mod.EventHandler + // public void onFMLMissingMappingsEvent(FMLMissingMappingsEvent event){ + // for (FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ + // if (mapping.name.equalsIgnoreCase()) + // } + // } -// @Mod.EventHandler -// public void onServerStarted(FMLServerStartedEvent event) { -// if (LoaderReference.EMT){ -// try { -// TCRecipeHandler.init(); -// } catch (IllegalAccessException | InvocationTargetException e) { -// e.printStackTrace(); -// } -// } -// } + // @Mod.EventHandler + // public void onServerStarted(FMLServerStartedEvent event) { + // if (LoaderReference.EMT){ + // try { + // TCRecipeHandler.init(); + // } catch (IllegalAccessException | InvocationTargetException e) { + // e.printStackTrace(); + // } + // } + // } @Mod.EventHandler public void onFMLServerStart(FMLServerStartingEvent event) { if (LoaderReference.miscutils) - for (Object s : RadioHatchCompat.TranslateSet){ + for (Object s : RadioHatchCompat.TranslateSet) { StringTranslate.inject(new ReaderInputStream(new StringReader((String) s))); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index e362bdd5e4..14ebcb50cc 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -29,16 +29,16 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.*; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.RegistryNamespaced; import net.minecraftforge.oredict.OreDictionary; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -@SuppressWarnings({"unchecked","rawtypes","unused"}) +@SuppressWarnings({"unchecked", "rawtypes", "unused"}) public class RadioHatchCompat { private static Class intf; @@ -63,7 +63,7 @@ public class RadioHatchCompat { public static HashSet<String> TranslateSet = new HashSet<>(); - static{ + static { try { RadioHatchCompat.intf = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent"); RadioHatchCompat.enu = Class.forName("gtPlusPlus.core.item.base.BaseItemComponent$ComponentTypes"); @@ -90,13 +90,10 @@ public class RadioHatchCompat { RadioHatchCompat.unlocalizedName.setAccessible(true); Object[] arr = RadioHatchCompat.enu.getEnumConstants(); - for (Object o : arr){ - if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) - break; - else if (o.toString().equalsIgnoreCase("ROD")) - RadioHatchCompat.rod = o; - else if (o.toString().equalsIgnoreCase("RODLONG")) - RadioHatchCompat.longRod = o; + for (Object o : arr) { + if (RadioHatchCompat.rod != null && RadioHatchCompat.longRod != null) break; + else if (o.toString().equalsIgnoreCase("ROD")) RadioHatchCompat.rod = o; + else if (o.toString().equalsIgnoreCase("RODLONG")) RadioHatchCompat.longRod = o; } } catch (NoSuchFieldException | ClassNotFoundException e) { @@ -115,59 +112,69 @@ public class RadioHatchCompat { cOwners.setAccessible(true); Field map = RegistryNamespaced.class.getDeclaredField("field_148758_b"); map.setAccessible(true); - Map<Item,String> UniqueIdentifierMap = (Map<Item, String>) map.get(GameData.getItemRegistry()); + Map<Item, String> UniqueIdentifierMap = (Map<Item, String>) map.get(GameData.getItemRegistry()); - Map<GameRegistry.UniqueIdentifier, ModContainer> ownerItems = (Map<GameRegistry.UniqueIdentifier, ModContainer>) cOwners.get(null); + Map<GameRegistry.UniqueIdentifier, ModContainer> ownerItems = + (Map<GameRegistry.UniqueIdentifier, ModContainer>) cOwners.get(null); ModContainer gtpp = null; ModContainer bartworks = null; - for (ModContainer container : Loader.instance().getModList()){ - if (gtpp != null && bartworks != null) - break; - else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) - bartworks=container; - else if (container.getModId().equalsIgnoreCase("miscutils")) - gtpp=container; + for (ModContainer container : Loader.instance().getModList()) { + if (gtpp != null && bartworks != null) break; + else if (container.getModId().equalsIgnoreCase(BartWorksCrossmod.MOD_ID)) bartworks = container; + else if (container.getModId().equalsIgnoreCase("miscutils")) gtpp = container; } - for (Object mats : (Set) RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { + for (Object mats : (Set) + RadioHatchCompat.materialClass.getField("mMaterialMap").get(null)) { if (RadioHatchCompat.isRadioactive.getBoolean(mats)) { - if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + if (OreDictionary.getOres("stick" + RadioHatchCompat.unlocalizedName.get(mats)) + .isEmpty()) { Item it = c1.newInstance(mats); - UniqueIdentifierMap.replace(it,"miscutils:"+it.getUnlocalizedName()); + UniqueIdentifierMap.replace(it, "miscutils:" + it.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui = GameRegistry.findUniqueIdentifierFor(it); - ownerItems.replace(ui,bartworks,gtpp); + ownerItems.replace(ui, bartworks, gtpp); - String tanslate = it.getUnlocalizedName()+".name="+RadioHatchCompat.localizedName.get(mats)+" Rod"; + String tanslate = + it.getUnlocalizedName() + ".name=" + RadioHatchCompat.localizedName.get(mats) + " Rod"; RadioHatchCompat.TranslateSet.add(tanslate); DebugLog.log(tanslate); DebugLog.log("Generate: " + RadioHatchCompat.rod + RadioHatchCompat.unlocalizedName.get(mats)); } - if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)).isEmpty()) { + if (OreDictionary.getOres("stickLong" + RadioHatchCompat.unlocalizedName.get(mats)) + .isEmpty()) { Item it2 = c2.newInstance(mats); - UniqueIdentifierMap.replace(it2,"miscutils:"+it2.getUnlocalizedName()); + UniqueIdentifierMap.replace(it2, "miscutils:" + it2.getUnlocalizedName()); GameRegistry.UniqueIdentifier ui2 = GameRegistry.findUniqueIdentifierFor(it2); - ownerItems.replace(ui2,bartworks,gtpp); + ownerItems.replace(ui2, bartworks, gtpp); - DebugLog.log("Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); + DebugLog.log( + "Generate: " + RadioHatchCompat.longRod + RadioHatchCompat.unlocalizedName.get(mats)); } } } - } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException | ClassNotFoundException e) { + } catch (NoSuchFieldException + | IllegalAccessException + | NoSuchMethodException + | InvocationTargetException + | InstantiationException + | ClassNotFoundException e) { e.printStackTrace(); } } - public static IRadMaterial GTppRadChecker(ItemStack lStack){ + public static IRadMaterial GTppRadChecker(ItemStack lStack) { try { - if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())){ - if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) - return null; - int amount = RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.rod) ? 1 : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; - if (amount == 0) - return null; + if (RadioHatchCompat.intf.isAssignableFrom(lStack.getItem().getClass())) { + if (!RadioHatchCompat.isRadioactive.getBoolean(RadioHatchCompat.f.get(lStack.getItem()))) return null; + int amount = RadioHatchCompat.componentType + .get(lStack.getItem()) + .equals(RadioHatchCompat.rod) + ? 1 + : RadioHatchCompat.componentType.get(lStack.getItem()).equals(RadioHatchCompat.longRod) ? 2 : 0; + if (amount == 0) return null; return new RadioHatchCompat.GTPPRadAdapter(amount, RadioHatchCompat.f.get(lStack.getItem())); } } catch (IllegalAccessException e) { @@ -176,9 +183,9 @@ public class RadioHatchCompat { return null; } - static class GTPPRadAdapter implements IRadMaterial{ + static class GTPPRadAdapter implements IRadMaterial { - static final HashMap<Object,Integer> BUFFER = new HashMap<>(); + static final HashMap<Object, Integer> BUFFER = new HashMap<>(); GTPPRadAdapter(Object m) { this.m = m; @@ -198,36 +205,36 @@ public class RadioHatchCompat { } private static boolean isElement(Object GTPPMaterial) throws IllegalAccessException { - return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial).isEmpty(); + return RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial) + .isEmpty(); } private static List getElemets(Object GTPPMaterial) throws IllegalAccessException { ArrayList elements = new ArrayList(); Queue toCheck = new LinkedList(); ArrayList materialInputs = RadioHatchCompat.GTPPRadAdapter.getMaterialInput(GTPPMaterial); - if (materialInputs.isEmpty()) - return Collections.singletonList(GTPPMaterial); - for (Object materialStack : materialInputs){ + if (materialInputs.isEmpty()) return Collections.singletonList(GTPPMaterial); + for (Object materialStack : materialInputs) { if (!RadioHatchCompat.GTPPRadAdapter.isElement(RadioHatchCompat.stackMaterial.get(materialStack))) toCheck.add(RadioHatchCompat.stackMaterial.get(materialStack)); - else - elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); + else elements.add(RadioHatchCompat.stackMaterial.get(materialStack)); } - while (!toCheck.isEmpty()){ + while (!toCheck.isEmpty()) { elements.addAll(GTPPRadAdapter.getElemets(toCheck.poll())); } return elements; } - private static Integer calulateRad(Object m){ + private static Integer calulateRad(Object m) { int ret = 0; try { List pureElements = RadioHatchCompat.GTPPRadAdapter.getElemets(m); for (Object materialObj : pureElements) if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) - ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj))); - else - ret += RadioHatchCompat.radlevel.getByte(m); + ret += ((int) RadioHatchCompat.radlevel.getByte(m) + + RadioHatchCompat.GTPPRadAdapter.clampToZero( + RadioHatchCompat.protons.getLong(materialObj))); + else ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); } @@ -236,10 +243,11 @@ public class RadioHatchCompat { @Override public int getRadiationLevel(ItemStack aStack) { - return RadioHatchCompat.GTPPRadAdapter.BUFFER.computeIfAbsent(this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); + return RadioHatchCompat.GTPPRadAdapter.BUFFER.computeIfAbsent( + this.m, radlvl -> RadioHatchCompat.GTPPRadAdapter.calulateRad(this.m)); } - private static long clampToZero(long number){ + private static long clampToZero(long number) { return number > 0 ? number : 0; } @@ -250,7 +258,7 @@ public class RadioHatchCompat { @Override public short[] getColorForGUI(ItemStack aStack) { - short[] rgba = {0,0,0,0}; + short[] rgba = {0, 0, 0, 0}; try { rgba = (short[]) RadioHatchCompat.RGBA.get(this.m); } catch (IllegalAccessException e) { @@ -269,6 +277,5 @@ public class RadioHatchCompat { } return ret; } - } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java index af653781be..a9ac64b5fb 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/ae2/ItemSingleItemStorageCell.java @@ -1,27 +1,27 @@ -//package com.github.bartimaeusnek.crossmod.ae2; -// -//import appeng.api.AEApi; -//import appeng.api.config.FuzzyMode; -//import appeng.api.config.IncludeExclude; -//import appeng.api.implementations.items.IStorageCell; -//import appeng.api.storage.*; -//import appeng.api.storage.data.IAEItemStack; -//import appeng.core.localization.GuiText; -//import appeng.items.contents.CellUpgrades; -//import appeng.util.Platform; -//import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; -//import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; -//import cpw.mods.fml.common.registry.GameRegistry; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.inventory.IInventory; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -// -//import java.util.List; -// -//public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { +// package com.github.bartimaeusnek.crossmod.ae2; +// +// import appeng.api.AEApi; +// import appeng.api.config.FuzzyMode; +// import appeng.api.config.IncludeExclude; +// import appeng.api.implementations.items.IStorageCell; +// import appeng.api.storage.*; +// import appeng.api.storage.data.IAEItemStack; +// import appeng.core.localization.GuiText; +// import appeng.items.contents.CellUpgrades; +// import appeng.util.Platform; +// import com.github.bartimaeusnek.bartworks.common.items.SimpleSubItemClass; +// import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +// import cpw.mods.fml.common.registry.GameRegistry; +// import cpw.mods.fml.relauncher.Side; +// import cpw.mods.fml.relauncher.SideOnly; +// import net.minecraft.entity.player.EntityPlayer; +// import net.minecraft.inventory.IInventory; +// import net.minecraft.item.Item; +// import net.minecraft.item.ItemStack; +// +// import java.util.List; +// +// public class ItemSingleItemStorageCell extends SimpleSubItemClass implements IStorageCell { // // public ItemSingleItemStorageCell(String tex) { // super(tex); @@ -32,15 +32,19 @@ // @Override // @SideOnly(Side.CLIENT) // public void addInformation(ItemStack stack, EntityPlayer p_77624_2_, List lines, boolean p_77624_4_) { -// IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory(stack, (ISaveProvider)null, StorageChannel.ITEMS); +// IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory(stack, +// (ISaveProvider)null, StorageChannel.ITEMS); // if (inventory instanceof ICellInventoryHandler) { // ICellInventoryHandler handler = (ICellInventoryHandler)inventory; // ICellInventory cellInventory = handler.getCellInv(); // if (cellInventory != null) { -// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); -// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); +// lines.add(cellInventory.getUsedBytes() + " " + GuiText.Of.getLocal() + ' ' + +// cellInventory.getTotalBytes() + ' ' + GuiText.BytesUsed.getLocal()); +// lines.add(cellInventory.getStoredItemTypes() + " " + GuiText.Of.getLocal() + ' ' + +// cellInventory.getTotalItemTypes() + ' ' + GuiText.Types.getLocal()); // if (handler.isPreformatted()) { -// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); +// String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : +// GuiText.Excluded).getLocal(); // if (handler.isFuzzy()) { // lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); // } else { @@ -119,4 +123,4 @@ // public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) { // Platform.openNbtData(is).setString("FuzzyMode", fzMode.name()); // } -//} +// } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java index 13c4de03fb..134b541021 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/cls/CLSCompat.java @@ -23,16 +23,14 @@ package com.github.bartimaeusnek.crossmod.cls; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Optional; -@SuppressWarnings({"rawtypes","unchecked"}) +@SuppressWarnings({"rawtypes", "unchecked"}) public class CLSCompat { - private CLSCompat() { - } + private CLSCompat() {} private static final long MINIMAL_UPDATE_INTERVAL = 1000 / 30; // target 30 fps private static long lastUpdate = 0; @@ -76,12 +74,10 @@ public class CLSCompat { e.printStackTrace(); } - if (Werkstoff.werkstoffHashSet.size() >= 100) - sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1; - else - sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size(); + if (Werkstoff.werkstoffHashSet.size() >= 100) sizeStep = Werkstoff.werkstoffHashSet.size() / 100 - 1; + else sizeStep = sizeStep2 = Werkstoff.werkstoffHashSet.size(); - return new Integer[]{sizeStep, sizeStep2, sizeStep}; + return new Integer[] {sizeStep, sizeStep2, sizeStep}; } public static int invokeStepSize(Werkstoff werkstoff, Integer[] steps, int size) { @@ -97,8 +93,7 @@ public class CLSCompat { lastUpdate = time; } - if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100) - steps[0] = steps[2]; + if (steps[0] == 0 && Werkstoff.werkstoffHashSet.size() >= 100) steps[0] = steps[2]; size += steps[1]; return size; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index 7045e27bd1..fa3cf70882 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.crossmod.emt.recipe; +import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; + import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -33,30 +35,35 @@ import gregtech.api.objects.GT_ItemStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; - -import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; @SuppressWarnings("ALL") public class TCRecipeHandler { - public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(15000), + public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap( + new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", "Industrical Alchemical Construct", null, "gregtech:textures/gui/basicmachines/Default", - 2, 1, 2, 0, 1, - "", 1, "", true, true - ); + 2, + 1, + 2, + 0, + 1, + "", + 1, + "", + true, + true); static Class aCrucibleRecipeClass; static Class aThaumcraftAPI; static Field craftingRecipes; @@ -93,18 +100,18 @@ public class TCRecipeHandler { ArrayList tcCraftingList = (ArrayList) craftingRecipes.get(null); HashSet crucibleRecipes = new HashSet(); for (Object o : tcCraftingList) { - if (TCRecipeHandler.aCrucibleRecipeClass.isInstance(o)) - crucibleRecipes.add(o); + if (TCRecipeHandler.aCrucibleRecipeClass.isInstance(o)) crucibleRecipes.add(o); } TCRecipeHandler.convertCrucibleRecipesToGTRecipes(crucibleRecipes); } - public static void convertCrucibleRecipesToGTRecipes(HashSet crucibleRecipes) throws IllegalAccessException, InvocationTargetException { + public static void convertCrucibleRecipesToGTRecipes(HashSet crucibleRecipes) + throws IllegalAccessException, InvocationTargetException { HashSet<GT_Recipe> ret = new HashSet<>(); - ArrayListMultimap<ItemStack,Integer> itemToCircuitConfigMap = ArrayListMultimap.create(); - ArrayListMultimap<ItemStack,Object> itemToAspectsMap = ArrayListMultimap.create(); - ArrayListMultimap<ItemStack,ItemStack> itemToOutputMap = ArrayListMultimap.create(); - ArrayListMultimap<ItemStack,String> itemToResearchMap = ArrayListMultimap.create(); + ArrayListMultimap<ItemStack, Integer> itemToCircuitConfigMap = ArrayListMultimap.create(); + ArrayListMultimap<ItemStack, Object> itemToAspectsMap = ArrayListMultimap.create(); + ArrayListMultimap<ItemStack, ItemStack> itemToOutputMap = ArrayListMultimap.create(); + ArrayListMultimap<ItemStack, String> itemToResearchMap = ArrayListMultimap.create(); for (Object o : crucibleRecipes) { @@ -114,45 +121,47 @@ public class TCRecipeHandler { Object cat = TCRecipeHandler.aCrucibleRecipeCatalyst.get(o); if (cat instanceof ItemStack) { - itemToAspectsMap.put((ItemStack)cat,aspects); - itemToOutputMap.put((ItemStack)cat,out); - itemToResearchMap.put((ItemStack)cat,key); + itemToAspectsMap.put((ItemStack) cat, aspects); + itemToOutputMap.put((ItemStack) cat, out); + itemToResearchMap.put((ItemStack) cat, key); } else if (cat instanceof String) { for (ItemStack stack : OreDictionary.getOres((String) cat)) { - itemToAspectsMap.put(stack,aspects); - itemToOutputMap.put(stack,out); - itemToResearchMap.put(stack,key); + itemToAspectsMap.put(stack, aspects); + itemToOutputMap.put(stack, out); + itemToResearchMap.put(stack, key); } } else if (cat instanceof ArrayList && ((ArrayList) cat).size() > 0) { for (ItemStack stack : ((ArrayList<ItemStack>) cat)) { - itemToAspectsMap.put(stack,aspects); - itemToOutputMap.put(stack,out); - itemToResearchMap.put(stack,key); - + itemToAspectsMap.put(stack, aspects); + itemToOutputMap.put(stack, out); + itemToResearchMap.put(stack, key); } } } - for (ItemStack o : itemToAspectsMap.keySet()){ - if (o.getItemDamage() == Short.MAX_VALUE) - itemToCircuitConfigMap.put(o,24); + for (ItemStack o : itemToAspectsMap.keySet()) { + if (o.getItemDamage() == Short.MAX_VALUE) itemToCircuitConfigMap.put(o, 24); else for (int j = 1; j <= itemToAspectsMap.get(o).size(); j++) { - itemToCircuitConfigMap.put(o,j%24); + itemToCircuitConfigMap.put(o, j % 24); } - - for (int j = 0; j < itemToAspectsMap.get(o).size() ; j++) { - ret.add(addRecipes(itemToResearchMap.get(o).get(j),itemToOutputMap.get(o).get(j),itemToAspectsMap.get(o).get(j),o,itemToCircuitConfigMap.get(o).get(j))); + for (int j = 0; j < itemToAspectsMap.get(o).size(); j++) { + ret.add(addRecipes( + itemToResearchMap.get(o).get(j), + itemToOutputMap.get(o).get(j), + itemToAspectsMap.get(o).get(j), + o, + itemToCircuitConfigMap.get(o).get(j))); } } - for (GT_Recipe recipe : ret){ + for (GT_Recipe recipe : ret) { TCRecipeHandler.alchemicalConstructHandler.add(recipe); } - } - public static GT_Recipe addRecipes(String key, ItemStack out, Object aspects, ItemStack cat, int config) throws InvocationTargetException, IllegalAccessException { + public static GT_Recipe addRecipes(String key, ItemStack out, Object aspects, ItemStack cat, int config) + throws InvocationTargetException, IllegalAccessException { NBTTagCompound toWrite = new NBTTagCompound(); ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(aspects, toWrite); @@ -161,69 +170,106 @@ public class TCRecipeHandler { fake.setStackDisplayName(key); GT_Recipe recipe = new BWRecipes.DynamicGTRecipe( false, - new ItemStack[]{cat, GT_Utility.getIntegratedCircuit(config)}, - new ItemStack[]{out}, + new ItemStack[] {cat, GT_Utility.getIntegratedCircuit(config)}, + new ItemStack[] {out}, fake, null, null, null, 60, 480, - 0 - ); + 0); return recipe; } static class TCRecipeMap extends GT_Recipe.GT_Recipe_Map { - public TCRecipeMap(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) { - super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed); + public TCRecipeMap( + Collection<GT_Recipe> aRecipeList, + String aUnlocalizedName, + String aLocalName, + String aNEIName, + String aNEIGUIPath, + int aUsualInputCount, + int aUsualOutputCount, + int aMinimalInputItems, + int aMinimalInputFluids, + int aAmperage, + String aNEISpecialValuePre, + int aNEISpecialValueMultiplier, + String aNEISpecialValuePost, + boolean aShowVoltageAmperageInNEI, + boolean aNEIAllowed) { + super( + aRecipeList, + aUnlocalizedName, + aLocalName, + aNEIName, + aNEIGUIPath, + aUsualInputCount, + aUsualOutputCount, + aMinimalInputItems, + aMinimalInputFluids, + aAmperage, + aNEISpecialValuePre, + aNEISpecialValueMultiplier, + aNEISpecialValuePost, + aShowVoltageAmperageInNEI, + aNEIAllowed); } @Override - public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { + public GT_Recipe findRecipe( + IHasWorldObjectAndCoords aTileEntity, + GT_Recipe aRecipe, + boolean aNotUnificated, + boolean aDontCheckStackSizes, + long aVoltage, + FluidStack[] aFluids, + ItemStack aSpecialSlot, + ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (mRecipeList.isEmpty()) return null; - // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. - // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 + // Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in + // their Machines to select Sub Recipes. if (GregTech_API.sPostloadFinished) { if (this.mMinimalInputItems > 0) { - if (aInputs == null) - return null; + if (aInputs == null) return null; int tAmount = 0; - for (ItemStack aInput : aInputs) - if (aInput != null) - tAmount++; - if (tAmount < this.mMinimalInputItems) - return null; + for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; + if (tAmount < this.mMinimalInputItems) return null; } } // Unification happens here in case the Input isn't already unificated. - if (aNotUnificated) - aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); - -// // Check the Recipe which has been used last time in order to not have to search for it again, if possible. -// if (aRecipe != null) -// if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { -// NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); -// NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); -// Object aAspectListToCheck = null; -// Object aGivenAspectList = null; -// try { -// aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); -// aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); -// AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); -// AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); -// if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) -// return null; -// } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { -// e.printStackTrace(); -// return null; -// } -// return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; -// } - + if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); + + // // Check the Recipe which has been used last time in order to not have to search for it again, + // if possible. + // if (aRecipe != null) + // if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, + // aDontCheckStackSizes, aFluids, aInputs)) { + // NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); + // NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + // Object aAspectListToCheck = null; + // Object aGivenAspectList = null; + // try { + // aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); + // aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); + // AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); + // AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); + // if + // (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) + // return null; + // } catch (InstantiationException | IllegalAccessException | InvocationTargetException + // e) { + // e.printStackTrace(); + // return null; + // } + // return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null; + // } // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. if (this.mUsualInputCount > 0 && aInputs != null) @@ -232,19 +278,22 @@ public class TCRecipeHandler { Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack)); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); Object aAspectListToCheck = null; Object aGivenAspectList = null; try { aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) - continue; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects( + aAspectListToCheck, aGivenAspectList)) continue; + } catch (InstantiationException + | IllegalAccessException + | InvocationTargetException e) { e.printStackTrace(); return null; } @@ -253,19 +302,24 @@ public class TCRecipeHandler { tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(GT_Values.W, tStack))); if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) - if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && BW_Util.areStacksEqualOrNull((ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) + && BW_Util.areStacksEqualOrNull( + (ItemStack) tRecipe.mSpecialItems, aSpecialSlot)) { NBTTagCompound toCheckNBT = aSpecialSlot.getTagCompound(); - NBTTagCompound givenNBT = ((ItemStack)aRecipe.mSpecialItems).getTagCompound(); + NBTTagCompound givenNBT = ((ItemStack) aRecipe.mSpecialItems).getTagCompound(); Object aAspectListToCheck = null; Object aGivenAspectList = null; try { aAspectListToCheck = AspectAdder.mAspectListClass.newInstance(); aGivenAspectList = AspectAdder.mAspectListClass.newInstance(); - AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck,toCheckNBT); - AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList,givenNBT); - if (!TCRecipeHandler.TCRecipeMap.containsAspects(aAspectListToCheck,aGivenAspectList)) - continue; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + AspectAdder.readAspectListFromNBT.invoke(aAspectListToCheck, toCheckNBT); + AspectAdder.readAspectListFromNBT.invoke(aGivenAspectList, givenNBT); + if (!TCRecipeHandler.TCRecipeMap.containsAspects( + aAspectListToCheck, aGivenAspectList)) continue; + } catch (InstantiationException + | IllegalAccessException + | InvocationTargetException e) { e.printStackTrace(); return null; } @@ -276,15 +330,15 @@ public class TCRecipeHandler { return null; } - - private static boolean containsAspects(Object aAspectListToCheck, Object aGivenAspectList) throws InvocationTargetException, IllegalAccessException { + private static boolean containsAspects(Object aAspectListToCheck, Object aGivenAspectList) + throws InvocationTargetException, IllegalAccessException { Object[] aspects = (Object[]) ThaumcraftHandler.AspectAdder.getAspects.invoke(aGivenAspectList); for (int i = 0; i < aspects.length; i++) { - if ((int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aAspectListToCheck,aspects[i]) < (int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aGivenAspectList,aspects[i])) + if ((int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aAspectListToCheck, aspects[i]) + < (int) ThaumcraftHandler.AspectAdder.getAmount.invoke(aGivenAspectList, aspects[i])) return false; } return true; } - } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index cb74678162..ce5efcd1a4 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -22,6 +22,8 @@ package com.github.bartimaeusnek.crossmod.emt.tileentities.multi; +import static gregtech.api.enums.GT_Values.V; + import com.github.bartimaeusnek.crossmod.emt.recipe.TCRecipeHandler; import com.github.bartimaeusnek.crossmod.emt.util.EMTHandler; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; @@ -32,18 +34,15 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; - import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; - -import static gregtech.api.enums.GT_Values.V; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("ALL") public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { @@ -64,7 +63,7 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo if (aMetaTileEntity == null) { return false; } else if (aTileEntity.getClass().isInstance(EMTHandler.aEssentiaInputHatch)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); return this.mEssentiaHatches.add(aMetaTileEntity); } else { return false; @@ -94,9 +93,10 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo allAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Object o : this.mEssentiaHatches) { Object aspectList = EMTHandler.aAspectField.get(o); - ThaumcraftHandler.AspectAdder.add.invoke(allAspects,aspectList); + ThaumcraftHandler.AspectAdder.add.invoke(allAspects, aspectList); } - NBTTagCompound toWrite = (NBTTagCompound)ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects,new NBTTagCompound()); + NBTTagCompound toWrite = (NBTTagCompound) + ThaumcraftHandler.AspectAdder.writeAspectListToNBT.invoke(allAspects, new NBTTagCompound()); stack.setTagCompound(toWrite); } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); @@ -107,30 +107,29 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, Math.min(GT_Utility.getTier(tVoltage), V.length - 1)); - GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe(this.getBaseMetaTileEntity(),null,false, false, V[tTier], null, stack, tInputs); + GT_Recipe tRecipe = TCRecipeHandler.alchemicalConstructHandler.findRecipe( + this.getBaseMetaTileEntity(), null, false, false, V[tTier], null, stack, tInputs); ItemStack helper = (ItemStack) tRecipe.mSpecialItems; NBTTagCompound tagCompound = helper.getTagCompound(); String research = tagCompound.getCompoundTag("display").getString("Name"); Object aspectList = null; try { aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); - ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList,tagCompound); - } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { + ThaumcraftHandler.AspectAdder.readAspectListFromNBT.invoke(aspectList, tagCompound); + } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { e.printStackTrace(); return false; } boolean complete = false; try { - complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null,owner,research); + complete = (boolean) ThaumcraftHandler.AspectAdder.isResearchComplete.invoke(null, owner, research); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } - if (!complete) - return false; - if (!tRecipe.isRecipeInputEqual(true,new FluidStack[0],tInputs)) - return false; - LinkedHashMap<Object,Integer> list = null; - LinkedHashMap<Object,Integer> needed = null; + if (!complete) return false; + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[0], tInputs)) return false; + LinkedHashMap<Object, Integer> list = null; + LinkedHashMap<Object, Integer> needed = null; try { list = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(allAspects); needed = (LinkedHashMap) ThaumcraftHandler.AspectAdder.linkedAspektList.get(aspectList); @@ -140,8 +139,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo } assert list != null; assert needed != null; - for (Map.Entry<Object,Integer> toTake : needed.entrySet()){ - list.replace(toTake.getKey(),list.get(toTake.getKey())-toTake.getValue()); + for (Map.Entry<Object, Integer> toTake : needed.entrySet()) { + list.replace(toTake.getKey(), list.get(toTake.getKey()) - toTake.getValue()); } this.addOutput(tRecipe.mOutputs[0]); this.updateSlots(); @@ -184,7 +183,8 @@ public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlo } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index b75a9fcd1a..b369480116 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -23,15 +23,17 @@ package com.github.bartimaeusnek.crossmod.emt.util; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; - import java.lang.reflect.Field; + @SuppressWarnings("unchecked") public class EMTHandler { public static Class<? extends GT_MetaTileEntity_Hatch_Input> aEssentiaInputHatch; public static Field aAspectField; + static { try { - aEssentiaInputHatch = (Class<? extends GT_MetaTileEntity_Hatch_Input>) Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aEssentiaInputHatch = (Class<? extends GT_MetaTileEntity_Hatch_Input>) + Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); aAspectField = aEssentiaInputHatch.getDeclaredField("current"); aAspectField.setAccessible(true); } catch (ClassNotFoundException | NoSuchFieldException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index ff5e99fd64..f8e5827b0c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -22,6 +22,10 @@ package com.github.bartimaeusnek.crossmod.galacticgreg; +import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; +import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; +import static gregtech.api.enums.GT_Values.VN; + import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_Layer_Space; import bloodasp.galacticgreg.GT_Worldgen_GT_Ore_SmallPieces_Space; import bloodasp.galacticgreg.GalacticGreg; @@ -45,6 +49,10 @@ import gregtech.api.util.GT_Utility; import gregtech.common.GT_Worldgen_GT_Ore_Layer; import gregtech.common.GT_Worldgen_GT_Ore_SmallPieces; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collectors; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -52,27 +60,19 @@ import net.minecraft.world.World; import net.minecraft.world.gen.ChunkProviderServer; import net.minecraftforge.fluids.FluidStack; -import java.util.*; -import java.util.function.Consumer; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import static bloodasp.galacticgreg.registry.GalacticGregRegistry.getModContainers; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; -import static gregtech.api.enums.GT_Values.VN; - @SuppressWarnings("ALL") public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_DrillerBase { - private static ArrayListMultimap<Integer,Pair<Pair<Integer,Boolean>, Float>> extraDropsDimMap = ArrayListMultimap.create(); - private static FluidStack[] NOBLE_GASSES = new FluidStack[]{ - WerkstoffLoader.Neon.getFluidOrGas(1), - WerkstoffLoader.Krypton.getFluidOrGas(1), - WerkstoffLoader.Xenon.getFluidOrGas(1), - WerkstoffLoader.Oganesson.getFluidOrGas(1) + private static ArrayListMultimap<Integer, Pair<Pair<Integer, Boolean>, Float>> extraDropsDimMap = + ArrayListMultimap.create(); + private static FluidStack[] NOBLE_GASSES = new FluidStack[] { + WerkstoffLoader.Neon.getFluidOrGas(1), + WerkstoffLoader.Krypton.getFluidOrGas(1), + WerkstoffLoader.Xenon.getFluidOrGas(1), + WerkstoffLoader.Oganesson.getFluidOrGas(1) }; - private HashMap<Pair<Integer,Boolean>, Float> dropmap = null; + private HashMap<Pair<Integer, Boolean>, Float> dropmap = null; private float totalWeight; private int multiplier = 1; @@ -88,12 +88,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ public static void addMatierialToDimensionList(int DimensionID, ISubTagContainer Material, float weight) { if (Material instanceof Materials) - getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>(((Materials)Material).mMetaItemSubID,false), weight)); + getExtraDropsDimMap() + .put(DimensionID, new Pair<>(new Pair<>(((Materials) Material).mMetaItemSubID, false), weight)); else if (Material instanceof Werkstoff) - getExtraDropsDimMap().put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff)Material).getmID(),true), weight)); + getExtraDropsDimMap() + .put(DimensionID, new Pair<>(new Pair<>((int) ((Werkstoff) Material).getmID(), true), weight)); } - //adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 Dust + // adding tellurium to OW to ensure a way to get it, as it's used in Magneto Resonatic Dust and Circuit Compound MK3 + // Dust static { addMatierialToDimensionList(0, Materials.Tellurium, 8.0f); } @@ -106,7 +109,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setByte("TIER_MULTIPLIER",TIER_MULTIPLIER); + aNBT.setByte("TIER_MULTIPLIER", TIER_MULTIPLIER); aNBT.setBoolean("mBlacklist", mBlacklist); } @@ -124,7 +127,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri @Override protected int getMinTier() { - return this.TIER_MULTIPLIER + 5; //min tier = LuV + return this.TIER_MULTIPLIER + 5; // min tier = LuV } @Override @@ -149,17 +152,16 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri } @Override - protected boolean workingAtBottom(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - //if the dropmap has never been initialised or if the dropmap is empty - if (dropmap == null || totalWeight == 0) - calculateDropMap(); + protected boolean workingAtBottom( + ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { + // if the dropmap has never been initialised or if the dropmap is empty + if (dropmap == null || totalWeight == 0) calculateDropMap(); - if(totalWeight != 0.f){ + if (totalWeight != 0.f) { handleFluidConsumption(); handleOutputs(); return true; - } - else{ + } else { stopMachine(); return false; } @@ -171,10 +173,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Miner") - .addInfo("Controller Block for the Void Miner "+ GT_Values.VN[this.getMinTier()]) + .addInfo("Controller Block for the Void Miner " + GT_Values.VN[this.getMinTier()]) .addInfo("Consumes " + GT_Values.V[this.getMinTier()] + "EU/t") - .addInfo("Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") - .addInfo("Will output "+(2*TIER_MULTIPLIER)+" Ores per Second depending on the Dimension it is build in") + .addInfo( + "Can be supplied with 2L/s of Neon(x4), Krypton(x8), Xenon(x16) or Oganesson(x64) for higher outputs.") + .addInfo("Will output " + (2 * TIER_MULTIPLIER) + + " Ores per Second depending on the Dimension it is build in") .addInfo("Put the Ore into the input bus to set the Whitelist/Blacklist") .addInfo("Use a screwdriver to toggle Whitelist/Blacklist") .addInfo("Blacklist or non Whitelist Ore will be VOIDED") @@ -255,14 +259,12 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param key a Pair of <int, bool> where the int is the meta of the ore, and the bool is true for BW ores, false for GT ores * @param value the non normalised weight */ - private void addDrop(Pair<Integer,Boolean> key, float value){ + private void addDrop(Pair<Integer, Boolean> key, float value) { final ItemStack ore = getOreItemStack(key); - if (ConfigHandler.voidMinerBlacklist.contains(String.format("%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) - return; - if (!dropmap.containsKey(key)) - dropmap.put(key, value); - else - dropmap.put(key, dropmap.get(key) + value); + if (ConfigHandler.voidMinerBlacklist.contains(String.format( + "%s:%d", GameRegistry.findUniqueIdentifierFor(ore.getItem()).toString(), ore.getItemDamage()))) return; + if (!dropmap.containsKey(key)) dropmap.put(key, value); + else dropmap.put(key, dropmap.get(key) + value); } /** @@ -270,13 +272,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param oreLayerPredicate the predicate made by makeOreLayerPredicate */ private void getDropsVanillaVeins(Predicate<GT_Worldgen_GT_Ore_Layer> oreLayerPredicate) { - GT_Worldgen_GT_Ore_Layer.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)).forEach(element -> { - addDrop(new Pair<>((int) element.mPrimaryMeta,false), (float) element.mWeight); - addDrop(new Pair<>((int) element.mSecondaryMeta,false), (float) element.mWeight); - addDrop(new Pair<>((int) element.mSporadicMeta,false), (element.mWeight / 8f)); - addDrop(new Pair<>((int) element.mBetweenMeta,false), (element.mWeight / 8f)); - } - ); + GT_Worldgen_GT_Ore_Layer.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && oreLayerPredicate.test(gt_worldgen)) + .forEach(element -> { + addDrop(new Pair<>((int) element.mPrimaryMeta, false), (float) element.mWeight); + addDrop(new Pair<>((int) element.mSecondaryMeta, false), (float) element.mWeight); + addDrop(new Pair<>((int) element.mSporadicMeta, false), (element.mWeight / 8f)); + addDrop(new Pair<>((int) element.mBetweenMeta, false), (element.mWeight / 8f)); + }); } /** @@ -284,9 +287,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param smallOresPredicate the predicate made by makeSmallOresPredicate */ private void getDropsVanillaSmallOres(Predicate<GT_Worldgen_GT_Ore_SmallPieces> smallOresPredicate) { - GT_Worldgen_GT_Ore_SmallPieces.sList.stream().filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)).forEach(element -> - addDrop(new Pair<>((int) element.mMeta,false), (float) element.mAmount) - ); + GT_Worldgen_GT_Ore_SmallPieces.sList.stream() + .filter(gt_worldgen -> gt_worldgen.mEnabled && smallOresPredicate.test(gt_worldgen)) + .forEach(element -> addDrop(new Pair<>((int) element.mMeta, false), (float) element.mAmount)); } /** @@ -295,17 +298,23 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void getDropsOreVeinsSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.oreVeinWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_Layer_Space + && ((GT_Worldgen_GT_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach( - element -> { - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta,false), (float) ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta,false), (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); - } - ); + space.forEach(element -> { + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mPrimaryMeta, false), (float) + ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSecondaryMeta, false), (float) + ((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight); + addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mSporadicMeta, false), + (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + addDrop( + new Pair<>((int) ((GT_Worldgen_GT_Ore_Layer_Space) element).mBetweenMeta, false), + (((GT_Worldgen_GT_Ore_Layer_Space) element).mWeight / 8f)); + }); } /** @@ -314,27 +323,27 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void getDropsSmallOreSpace(ModDimensionDef finalDef) { Set space = GalacticGreg.smallOreWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof GT_Worldgen_GT_Ore_SmallPieces_Space + && ((GT_Worldgen_GT_Ore_SmallPieces_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach( - element -> - addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta,false), (float) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount) - ); + space.forEach(element -> + addDrop(new Pair<>((int) ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mMeta, false), (float) + ((GT_Worldgen_GT_Ore_SmallPieces_Space) element).mAmount)); } /** * method used to pick the next key in the dropmap that will be used to generate the ore. * @return the chosen key */ - private Pair<Integer,Boolean> getOreDamage() { + private Pair<Integer, Boolean> getOreDamage() { float curentWeight = 0.f; while (true) { float randomnumber = XSTR.XSTR_INSTANCE.nextFloat() * totalWeight; - for (Map.Entry<Pair<Integer,Boolean>, Float> entry : dropmap.entrySet()) { + for (Map.Entry<Pair<Integer, Boolean>, Float> entry : dropmap.entrySet()) { curentWeight += entry.getValue(); - if (randomnumber < curentWeight) - return entry.getKey(); + if (randomnumber < curentWeight) return entry.getKey(); } } } @@ -348,7 +357,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri for (int i = 0; i < NOBLE_GASSES.length; i++) { FluidStack ng = NOBLE_GASSES[i]; if (ng.isFluidEqual(s)) { - multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i+2) : (i+1))); + multiplier = TIER_MULTIPLIER * (2 << (i == NOBLE_GASSES.length - 1 ? (i + 2) : (i + 1))); return s; } } @@ -377,8 +386,7 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleFluidConsumption() { FluidStack storedNobleGas = getNobleGasInputAndSetMultiplier(); - if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) - multiplier = TIER_MULTIPLIER; + if (storedNobleGas == null || !consumeNobleGas(storedNobleGas)) multiplier = TIER_MULTIPLIER; } /** @@ -388,7 +396,9 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void getDropMapRoss(int aID) { Consumer<BW_OreLayer> addToList = makeAddToList(); BW_OreLayer.sList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_OreLayer && gt_worldgen.isGenerationAllowed(null, aID, 0)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_OreLayer + && gt_worldgen.isGenerationAllowed(null, aID, 0)) .collect(Collectors.toSet()) .forEach(addToList); } @@ -399,12 +409,10 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private Consumer<BW_OreLayer> makeAddToList() { return element -> { - List<Pair<Integer,Boolean>> data = element.getStacksRawData(); + List<Pair<Integer, Boolean>> data = element.getStacksRawData(); for (int i = 0; i < data.size(); i++) { - if (i < data.size()-2) - addDrop(data.get(i), (float) element.mWeight); - else - addDrop(data.get(i), (element.mWeight/8f)); + if (i < data.size() - 2) addDrop(data.get(i), (float) element.mWeight); + else addDrop(data.get(i), (element.mWeight / 8f)); } }; } @@ -416,9 +424,15 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private ModDimensionDef makeModDimDef() { return getModContainers().stream() .flatMap(modContainer -> modContainer.getDimensionList().stream()) - .filter(modDimensionDef -> modDimensionDef.getChunkProviderName() - .equals(((ChunkProviderServer) this.getBaseMetaTileEntity().getWorld().getChunkProvider()).currentChunkProvider.getClass().getName())) - .findFirst().orElse(null); + .filter(modDimensionDef -> modDimensionDef + .getChunkProviderName() + .equals(((ChunkProviderServer) + this.getBaseMetaTileEntity().getWorld().getChunkProvider()) + .currentChunkProvider + .getClass() + .getName())) + .findFirst() + .orElse(null); } /** @@ -429,11 +443,14 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void addOresVeinsBartworks(ModDimensionDef finalDef, Consumer<BW_OreLayer> addToList) { try { Set space = GalacticGreg.oreVeinWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_Layer_Space + && ((BW_Worldgen_Ore_Layer_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); space.forEach(addToList); - } catch (NullPointerException ignored) {} + } catch (NullPointerException ignored) { + } } /** @@ -443,14 +460,18 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri private void addSmallOresBartworks(ModDimensionDef finalDef) { try { Set space = GalacticGreg.smallOreWorldgenList.stream() - .filter(gt_worldgen -> gt_worldgen.mEnabled && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) + .filter(gt_worldgen -> gt_worldgen.mEnabled + && gt_worldgen instanceof BW_Worldgen_Ore_SmallOre_Space + && ((BW_Worldgen_Ore_SmallOre_Space) gt_worldgen).isEnabledForDim(finalDef)) .collect(Collectors.toSet()); - space.forEach( - element -> - addDrop(new Pair<>(((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity) - ); - } catch (NullPointerException ignored) {} + space.forEach(element -> addDrop( + new Pair<>( + ((BW_Worldgen_Ore_SmallOre_Space) element).mPrimaryMeta, + ((BW_Worldgen_Ore_SmallOre_Space) element).bwOres != 0), + (float) ((BW_Worldgen_Ore_SmallOre_Space) element).mDensity)); + } catch (NullPointerException ignored) { + } } /** @@ -458,7 +479,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param id the specified dim id */ private void handleExtraDrops(int id) { - Optional.ofNullable(getExtraDropsDimMap().get(id)).ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); + Optional.ofNullable(getExtraDropsDimMap().get(id)) + .ifPresent(e -> e.forEach(f -> addDrop(f.getKey(), f.getValue()))); } /** @@ -474,19 +496,19 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @param id the dim number */ private void handleModDimDef(int id) { - //vanilla dims or TF + // vanilla dims or TF if ((id <= 1 && id >= -1) || id == 7) { getDropsVanillaVeins(makeOreLayerPredicate()); getDropsVanillaSmallOres(makeSmallOresPredicate()); - // ross dims + // ross dims } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { getDropMapRoss(id); - // other space dims + // other space dims } else { Optional.ofNullable(makeModDimDef()).ifPresent(def -> { - //normal space dim + // normal space dim getDropsOreVeinsSpace(def); getDropsSmallOreSpace(def); @@ -514,12 +536,13 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri */ private void handleOutputs() { Pair<Integer, Boolean> stats = getOreDamage(); - final List<ItemStack> inputOres = this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); + final List<ItemStack> inputOres = + this.getStoredInputs().stream().filter(GT_Utility::isOre).collect(Collectors.toList()); final ItemStack output = getOreItemStack(stats); if (inputOres.size() == 0 - || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) - || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output))) - ) this.addOutput(output); + || (mBlacklist && inputOres.stream().allMatch(is -> !GT_Utility.areStacksEqual(is, output))) + || (!mBlacklist && inputOres.stream().anyMatch(is -> GT_Utility.areStacksEqual(is, output)))) + this.addOutput(output); this.updateSlots(); } @@ -529,7 +552,8 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri * @return an ItemStack corresponding to the target ore, with a stacksize corresponding to the mutiplier induced by the gas used */ private ItemStack getOreItemStack(Pair<Integer, Boolean> stats) { - return new ItemStack(stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); + return new ItemStack( + stats.getValue() ? WerkstoffLoader.BWOres : GregTech_API.sBlockOres1, multiplier, stats.getKey()); } @Override diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java index a5058a34d7..6898b81ded 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiners.java @@ -27,7 +27,7 @@ import gregtech.api.enums.Materials; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -public class GT_TileEntity_VoidMiners { +public class GT_TileEntity_VoidMiners { public static class VMLUV extends GT_TileEntity_VoidMiner_Base { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index 447909e03d..d458ea07af 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -32,18 +32,17 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gregtech.api.objects.GT_UO_DimensionList; +import java.io.File; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; -import java.io.File; - public class GalacticraftProxy { public static GT_UO_DimensionList uo_dimensionList = new GT_UO_DimensionList(); static Configuration gtConf; - private GalacticraftProxy() { - } - public static void postInit(FMLPostInitializationEvent e){ + private GalacticraftProxy() {} + + public static void postInit(FMLPostInitializationEvent e) { if (SideReference.Side.Server || SideReference.EffectiveSide.Server) { GalacticraftProxy.serverPostInit(e); } else { @@ -61,20 +60,17 @@ public class GalacticraftProxy { GalacticraftProxy.commonpreInit(e); } - private static void serverpreInit(FMLPreInitializationEvent e) { + private static void serverpreInit(FMLPreInitializationEvent e) {} - } - - private static void clientpreInit(FMLPreInitializationEvent e) { - } + private static void clientpreInit(FMLPreInitializationEvent e) {} private static void commonpreInit(FMLPreInitializationEvent e) { - GalacticraftProxy.gtConf = new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); + GalacticraftProxy.gtConf = + new Configuration(new File(new File(e.getModConfigurationDirectory(), "GregTech"), "GregTech.cfg")); GalacticraftProxy.uo_dimensionList.getConfig(GalacticraftProxy.gtConf, "undergroundfluid"); BW_WorldGenRoss128b.initundergroundFluids(); BW_WorldGenRoss128ba.init_undergroundFluids(); - if (GalacticraftProxy.gtConf.hasChanged()) - GalacticraftProxy.gtConf.save(); + if (GalacticraftProxy.gtConf.hasChanged()) GalacticraftProxy.gtConf.save(); BW_WorldGenRoss128b.initOres(); BW_WorldGenRoss128ba.init_Ores(); MinecraftForge.EVENT_BUS.register(BWAtmosphereManager.INSTANCE); @@ -89,27 +85,17 @@ public class GalacticraftProxy { GalacticraftProxy.commonInit(e); } - private static void serverInit(FMLInitializationEvent e) { + private static void serverInit(FMLInitializationEvent e) {} - } - - private static void clientInit(FMLInitializationEvent e) { - - } + private static void clientInit(FMLInitializationEvent e) {} private static void commonInit(FMLInitializationEvent e) { - if (ConfigHandler.Ross128Enabled) - Ross128SolarSystem.init(); - } - private static void serverPostInit(FMLPostInitializationEvent e) { - + if (ConfigHandler.Ross128Enabled) Ross128SolarSystem.init(); } - private static void clientPostInit(FMLPostInitializationEvent e) { - - } + private static void serverPostInit(FMLPostInitializationEvent e) {} - private static void commonPostInit(FMLPostInitializationEvent e) { + private static void clientPostInit(FMLPostInitializationEvent e) {} - } + private static void commonPostInit(FMLPostInitializationEvent e) {} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index 8f6f1f9164..a0381dd0e9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -31,9 +31,9 @@ import net.minecraft.entity.player.EntityPlayerMP; public class PlanetsHelperClass { - public static EntityLanderBase getLanderType(EntityPlayerMP player){ + public static EntityLanderBase getLanderType(EntityPlayerMP player) { EntityLanderBase elb; - switch (ConfigHandler.landerType){ + switch (ConfigHandler.landerType) { case 1: elb = new EntityLander(player); break; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index 74b0f94a26..ff53bfcfa8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -23,6 +23,7 @@ package com.github.bartimaeusnek.crossmod.galacticraft; import com.github.bartimaeusnek.bartworks.API.LoaderReference; +import java.util.Random; import micdoodle8.mods.galacticraft.api.vector.Vector3; import micdoodle8.mods.galacticraft.api.world.ITeleportType; import micdoodle8.mods.galacticraft.core.entities.EntityLander; @@ -33,8 +34,6 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.World; import net.minecraft.world.WorldServer; -import java.util.Random; - public class UniversalTeleportType implements ITeleportType { @Override @@ -63,18 +62,15 @@ public class UniversalTeleportType implements ITeleportType { @Override public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) { - if (ridingAutoRocket) - return; + if (ridingAutoRocket) return; if ((player != null) && (GCPlayerStats.get(player).teleportCooldown <= 0)) { if (player.capabilities.isFlying) { player.capabilities.isFlying = false; } EntityLanderBase elb; - if (LoaderReference.GalacticraftMars) - elb=PlanetsHelperClass.getLanderType(player); - else - elb = new EntityLander(player); + if (LoaderReference.GalacticraftMars) elb = PlanetsHelperClass.getLanderType(player); + else elb = new EntityLander(player); if (!newWorld.isRemote) { newWorld.spawnEntityInWorld(elb); @@ -84,7 +80,5 @@ public class UniversalTeleportType implements ITeleportType { } @Override - public void setupAdventureSpawn(EntityPlayerMP player) { - - } + public void setupAdventureSpawn(EntityPlayerMP player) {} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 5faa82b6e6..79f4db3734 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -30,84 +30,90 @@ import com.google.common.collect.ArrayListMultimap; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.Materials; import gregtech.api.interfaces.ISubTagContainer; +import java.util.*; import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import java.util.*; - @SuppressWarnings({"unused", "RedundantSuppression"}) public final class BWAtmosphereManager { - private static final Map<Integer,Integer[]> COEFFICIENT_MAP = new HashMap<>(); + private static final Map<Integer, Integer[]> COEFFICIENT_MAP = new HashMap<>(); private BWAtmosphereManager() { - BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[]{100}); - BWAtmosphereManager.COEFFICIENT_MAP.put(2,new Integer[]{70,30}); - BWAtmosphereManager.COEFFICIENT_MAP.put(3,new Integer[]{60,25,15}); - BWAtmosphereManager.COEFFICIENT_MAP.put(4,new Integer[]{50,25,15,10}); - BWAtmosphereManager.COEFFICIENT_MAP.put(5,new Integer[]{45,25,15,10,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(6,new Integer[]{45,20,15,10,5,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(7,new Integer[]{40,20,15,10,5,5,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(8,new Integer[]{35,20,15,10,5,5,5,5}); - BWAtmosphereManager.COEFFICIENT_MAP.put(9,new Integer[]{35,15,15,10,5,5,5,5,5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(1, new Integer[] {100}); + BWAtmosphereManager.COEFFICIENT_MAP.put(2, new Integer[] {70, 30}); + BWAtmosphereManager.COEFFICIENT_MAP.put(3, new Integer[] {60, 25, 15}); + BWAtmosphereManager.COEFFICIENT_MAP.put(4, new Integer[] {50, 25, 15, 10}); + BWAtmosphereManager.COEFFICIENT_MAP.put(5, new Integer[] {45, 25, 15, 10, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(6, new Integer[] {45, 20, 15, 10, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(7, new Integer[] {40, 20, 15, 10, 5, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(8, new Integer[] {35, 20, 15, 10, 5, 5, 5, 5}); + BWAtmosphereManager.COEFFICIENT_MAP.put(9, new Integer[] {35, 15, 15, 10, 5, 5, 5, 5, 5}); } public static final BWAtmosphereManager INSTANCE = new BWAtmosphereManager(); - private static final ArrayListMultimap<Integer, Pair<ISubTagContainer,Integer>> gasConcentration = ArrayListMultimap.create(); + private static final ArrayListMultimap<Integer, Pair<ISubTagContainer, Integer>> gasConcentration = + ArrayListMultimap.create(); - public static List<Pair<ISubTagContainer,Integer>> getGasFromWorldID(int worldID){ + public static List<Pair<ISubTagContainer, Integer>> getGasFromWorldID(int worldID) { return BWAtmosphereManager.gasConcentration.get(worldID); } - public static void removeGasFromWorld(int worldID, ISubTagContainer gas){ - for (Pair<ISubTagContainer,Integer> pair : BWAtmosphereManager.gasConcentration.get(worldID)){ - if (pair.getKey().equals(gas)){ + public static void removeGasFromWorld(int worldID, ISubTagContainer gas) { + for (Pair<ISubTagContainer, Integer> pair : BWAtmosphereManager.gasConcentration.get(worldID)) { + if (pair.getKey().equals(gas)) { BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); return; } } } - public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount){ - Pair<ISubTagContainer,Integer> toadd = new Pair<>(gas,amount); - BWAtmosphereManager.gasConcentration.put(worldID,toadd); + public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount) { + Pair<ISubTagContainer, Integer> toadd = new Pair<>(gas, amount); + BWAtmosphereManager.gasConcentration.put(worldID, toadd); } - public static void addGasToWorld(int worldID, Pair<ISubTagContainer,Integer> toPut){ - BWAtmosphereManager.gasConcentration.put(worldID,toPut); + public static void addGasToWorld(int worldID, Pair<ISubTagContainer, Integer> toPut) { + BWAtmosphereManager.gasConcentration.put(worldID, toPut); } @SafeVarargs - public static void addGasToWorld(int worldID, Pair<ISubTagContainer,Integer>... toPut){ + public static void addGasToWorld(int worldID, Pair<ISubTagContainer, Integer>... toPut) { Arrays.stream(toPut).forEach(toadd -> BWAtmosphereManager.gasConcentration.put(worldID, toadd)); } - private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber){ + private static boolean addGCGasToWorld(int worldID, IAtmosphericGas gas, int aNumber, int aMaxNumber) { if (gas.equals(IAtmosphericGas.CO2)) { - BWAtmosphereManager.addGasToWorld(worldID, Materials.CarbonDioxide, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + BWAtmosphereManager.addGasToWorld( + worldID, + Materials.CarbonDioxide, + BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); return true; } String name = gas.toString(); - name = name.charAt(0)+name.substring(1).toLowerCase(Locale.US); + name = name.charAt(0) + name.substring(1).toLowerCase(Locale.US); ISubTagContainer mat = Materials.get(name); - if (mat == Materials._NULL){ + if (mat == Materials._NULL) { mat = WerkstoffLoader.getWerkstoff(name); } - if (mat == Werkstoff.default_null_Werkstoff){ + if (mat == Werkstoff.default_null_Werkstoff) { return false; } - BWAtmosphereManager.addGasToWorld(worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); + BWAtmosphereManager.addGasToWorld( + worldID, mat, BWAtmosphereManager.COEFFICIENT_MAP.get(aMaxNumber)[aNumber]); return true; } @SubscribeEvent - public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event){ + public void gcAutoRegister(GalaxyRegistry.PlanetRegisterEvent event) { CelestialBody planet = GalaxyRegistry.getRegisteredPlanets().get(event.planetName); for (int i = 0; i < planet.atmosphere.size(); i++) { - if (!BWAtmosphereManager.addGCGasToWorld(planet.getDimensionID(),planet.atmosphere.get(i),i,planet.atmosphere.size())) - BartWorksCrossmod.LOGGER.warn("Unidentified Fluid ("+planet.atmosphere.get(i)+") in the Atmosphere of: "+planet.getLocalizedName()); + if (!BWAtmosphereManager.addGCGasToWorld( + planet.getDimensionID(), planet.atmosphere.get(i), i, planet.atmosphere.size())) + BartWorksCrossmod.LOGGER.warn("Unidentified Fluid (" + planet.atmosphere.get(i) + + ") in the Atmosphere of: " + planet.getLocalizedName()); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index ecc243a3d0..5f1d2a98e6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -41,5 +41,4 @@ public abstract class AbstractWorldProviderSpace extends WorldProviderSpace impl public boolean hasSunset() { return true; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index 6fc3ed11ec..2d5928bb37 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -22,12 +22,16 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; + import com.github.bartimaeusnek.bartworks.API.LoaderReference; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; import com.github.bartimaeusnek.bartworks.system.oregen.BW_WordGenerator; import com.github.bartimaeusnek.bartworks.system.worldgen.MapGenRuins; import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler; import gregtech.api.objects.XSTR; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.entity.EnumCreatureType; @@ -45,11 +49,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; -import java.util.List; - -import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; -import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; - public class ChunkProviderRoss128b extends ChunkProviderGenerate { XSTR rand = new XSTR(); private BiomeGenBase[] biomesForGeneration; @@ -75,7 +74,9 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); - this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.biomesForGeneration = this.worldObj + .getWorldChunkManager() + .loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); for (int i = 0; i < this.biomesForGeneration.length; i++) { BiomeGenBase biomeGenBase = this.biomesForGeneration[i]; if (biomeGenBase.biomeID == BiomeGenBase.mushroomIsland.biomeID) { @@ -86,7 +87,8 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { if (LoaderReference.Thaumcraft) { if (ThaumcraftHandler.isTaintBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.taiga; - else if (ConfigHandler.disableMagicalForest && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) + else if (ConfigHandler.disableMagicalForest + && ThaumcraftHandler.isMagicalForestBiome(biomeGenBase.biomeID)) this.biomesForGeneration[i] = BiomeGenBase.birchForest; } } @@ -118,22 +120,27 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed()); } - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post( + new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); int x1; int y1; int z1; - if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { + if (biomegenbase != BiomeGenBase.desert + && biomegenbase != BiomeGenBase.desertHills + && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) { x1 = k + this.rand.nextInt(16) + 8; y1 = this.rand.nextInt(256); z1 = l + this.rand.nextInt(16) + 8; int rni = this.rand.nextInt(8); - if (rni == 0) - (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); - else if (rni == 4) - (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); + if (rni == 0) (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1); + else if (rni == 4) (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1); } - if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver + if (biomegenbase != BiomeGenBase.ocean + && biomegenbase != BiomeGenBase.deepOcean + && biomegenbase != BiomeGenBase.river + && biomegenbase != BiomeGenBase.frozenOcean + && biomegenbase != BiomeGenBase.frozenRiver && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) { x1 = k + this.rand.nextInt(16) + 3; y1 = this.rand.nextInt(256); @@ -162,17 +169,18 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this); - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post( + new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false)); BlockFalling.fallInstantly = false; } @Override - public void recreateStructures(int p_82695_1_, int p_82695_2_) { - } + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} @Override - public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { + public void replaceBlocksForBiome( + int p_147422_1_, int p_147422_2_, Block[] blocks, byte[] metas, BiomeGenBase[] p_147422_5_) { super.replaceBlocksForBiome(p_147422_1_, p_147422_2_, blocks, metas, p_147422_5_); for (int i = 0; i < blocks.length; i++) { if (blocks[i] == Blocks.grass) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index ddb37b9941..e8962ed14a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import net.minecraft.util.ResourceLocation; public class SkyProviderRoss128b { - //ASM enables this texture - public static final ResourceLocation sunTex = new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); + // ASM enables this texture + public static final ResourceLocation sunTex = + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/World/SunRoss128.png"); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index 2c8eac2cd9..5a6c5b6dca 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -60,10 +60,9 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { return Vec3.createVectorHelper(red, green, blue); } - @Override public Vector3 getFogColor() { - //unused + // unused return null; } @@ -159,5 +158,4 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { public boolean hasBreathableAtmosphere() { return true; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 78cbd986ac..ec7ecb17c1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -25,6 +25,8 @@ package com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba; import com.github.bartimaeusnek.bartworks.util.NoiseUtil.BartsNoise; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.ChunkProviderRoss128b; import gregtech.api.objects.XSTR; +import java.util.Arrays; +import java.util.Random; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; import micdoodle8.mods.galacticraft.core.blocks.GCBlocks; import micdoodle8.mods.galacticraft.core.world.gen.BiomeGenBaseMoon; @@ -38,9 +40,6 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; -import java.util.Arrays; -import java.util.Random; - public class ChunkProviderRoss128ba extends ChunkProviderMoon { private final XSTR rand = new XSTR(); @@ -50,7 +49,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { public ChunkProviderRoss128ba(World world, long seed, boolean mapFeaturesEnabled) { super(world, seed, mapFeaturesEnabled); - this.biomesForGeneration = new BiomeGenBase[]{BiomeGenBaseMoon.moonFlat}; + this.biomesForGeneration = new BiomeGenBase[] {BiomeGenBaseMoon.moonFlat}; this.caveGenerator = new MapGenCavesMoon(); this.worldObj = world; } @@ -61,7 +60,9 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { byte[] meta = new byte[65536]; Arrays.fill(ids, Blocks.air); this.generateTerrain(cx, cz, ids, meta); - this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); + this.biomesForGeneration = this.worldObj + .getWorldChunkManager() + .loadBlockGeneratorData(this.biomesForGeneration, cx * 16, cz * 16, 16, 16); this.createCraters(cx, cz, ids, meta); this.replaceBlocksForBiome(cx, cz, ids, meta, this.biomesForGeneration); this.caveGenerator.generate(this, this.worldObj, cx, cz, ids, meta); @@ -70,8 +71,7 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { return Chunk; } - public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) { - } + public void decoratePlanet(World par1World, Random par2Random, int par3, int par4) {} @Override public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { @@ -108,6 +108,5 @@ public class ChunkProviderRoss128ba extends ChunkProviderMoon { } } } - } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index bc47a60f4a..6bc6aafc09 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -28,6 +28,7 @@ import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; import com.github.bartimaeusnek.crossmod.galacticraft.UniversalTeleportType; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128b.WorldProviderRoss128b; import com.github.bartimaeusnek.crossmod.galacticraft.planets.ross128ba.WorldProviderRoss128ba; +import java.util.Arrays; import micdoodle8.mods.galacticraft.api.GalacticraftRegistry; import micdoodle8.mods.galacticraft.api.galaxies.*; import micdoodle8.mods.galacticraft.api.vector.Vector3; @@ -35,8 +36,6 @@ import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; import micdoodle8.mods.galacticraft.core.GalacticraftCore; import net.minecraft.util.ResourceLocation; -import java.util.Arrays; - public class Ross128SolarSystem { public static SolarSystem Ross128System; @@ -44,40 +43,51 @@ public class Ross128SolarSystem { public static Planet Ross128b; public static Moon Ross128ba; - private Ross128SolarSystem() { - } + private Ross128SolarSystem() {} public static void init() { - Ross128SolarSystem.Ross128System = new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); - Ross128SolarSystem.Ross128 = (Star) new Star("Ross128").setParentSolarSystem(Ross128SolarSystem.Ross128System).setTierRequired(-1); + Ross128SolarSystem.Ross128System = + new SolarSystem("Ross128System", "milkyWay").setMapPosition(new Vector3(-1.0D, 1.3D, 0.0D)); + Ross128SolarSystem.Ross128 = (Star) new Star("Ross128") + .setParentSolarSystem(Ross128SolarSystem.Ross128System) + .setTierRequired(-1); Ross128SolarSystem.Ross128.setUnreachable(); - Ross128SolarSystem.Ross128.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); + Ross128SolarSystem.Ross128.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128.png")); Ross128SolarSystem.Ross128System.setMainStar(Ross128SolarSystem.Ross128); Ross128SolarSystem.Ross128b = new Planet("Ross128b").setParentSolarSystem(Ross128SolarSystem.Ross128System); Ross128SolarSystem.Ross128b.setRingColorRGB((0x9F) / 255f, (0x8A) / 255f, (0x79) / 255f); Ross128SolarSystem.Ross128b.setPhaseShift(1.25F); - Ross128SolarSystem.Ross128b.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); + Ross128SolarSystem.Ross128b.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128b.png")); Ross128SolarSystem.Ross128b.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(0.75F, 1.75F)); Ross128SolarSystem.Ross128b.setRelativeOrbitTime(0.65F); - Ross128SolarSystem.Ross128b.atmosphere.addAll(Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); + Ross128SolarSystem.Ross128b.atmosphere.addAll( + Arrays.asList(IAtmosphericGas.OXYGEN, IAtmosphericGas.NITROGEN, IAtmosphericGas.ARGON)); Ross128SolarSystem.Ross128b.setDimensionInfo(ConfigHandler.ross128BID, WorldProviderRoss128b.class); Ross128SolarSystem.Ross128b.setTierRequired(ConfigHandler.ross128btier); Ross128SolarSystem.Ross128ba = new Moon("Ross128ba").setParentPlanet(Ross128SolarSystem.Ross128b); - Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)).setRelativeOrbitTime(1 / 0.01F); - Ross128SolarSystem.Ross128ba.setBodyIcon(new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); + Ross128SolarSystem.Ross128ba.setRelativeDistanceFromCenter(new CelestialBody.ScalableDistance(10f, 15f)) + .setRelativeOrbitTime(1 / 0.01F); + Ross128SolarSystem.Ross128ba.setBodyIcon( + new ResourceLocation(BartWorksCrossmod.MOD_ID + ":galacticraft/Ross128b/MapObjs/Ross128ba.png")); Ross128SolarSystem.Ross128ba.setDimensionInfo(ConfigHandler.ross128BAID, WorldProviderRoss128ba.class); - Ross128SolarSystem.Ross128ba.setTierRequired(LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); + Ross128SolarSystem.Ross128ba.setTierRequired( + LoaderReference.GalaxySpace ? Math.min(ConfigHandler.ross128btier + 2, 8) : 3); GalaxyRegistry.registerSolarSystem(Ross128SolarSystem.Ross128System); GalaxyRegistry.registerPlanet(Ross128SolarSystem.Ross128b); GalaxyRegistry.registerMoon(Ross128SolarSystem.Ross128ba); - GalacticraftRegistry.registerRocketGui(WorldProviderRoss128b.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); - GalacticraftRegistry.registerRocketGui(WorldProviderRoss128ba.class, new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); + GalacticraftRegistry.registerRocketGui( + WorldProviderRoss128b.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/overworldRocketGui.png")); + GalacticraftRegistry.registerRocketGui( + WorldProviderRoss128ba.class, + new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/moonRocketGui.png")); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128b.class, new UniversalTeleportType()); GalacticraftRegistry.registerTeleportType(WorldProviderRoss128ba.class, new UniversalTeleportType()); } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index a2f3f78861..e2271aaeff 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -37,7 +37,6 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { private static long dysonObjs; private static long swarmControllers; - public DysonSwarmSunReplacement(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { super(aID, aBasicName, aRegionalName, aInvSlotCount); } @@ -46,13 +45,18 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { super(aName, aInvSlotCount); } - - public void toggle(){ + public void toggle() { if (!wasBuild) { - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); + GalacticraftCore.solarSystemSol + .getMainStar() + .setBodyIcon(new ResourceLocation( + GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/moon.png")); wasBuild = !wasBuild; } else { - GalacticraftCore.solarSystemSol.getMainStar().setBodyIcon(new ResourceLocation(GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); + GalacticraftCore.solarSystemSol + .getMainStar() + .setBodyIcon(new ResourceLocation( + GalacticraftCore.ASSET_PREFIX, "textures/gui/celestialbodies/sun.png")); wasBuild = !wasBuild; } } @@ -75,7 +79,7 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new DysonSwarmSunReplacement(this.mName,this.mInventory.length); + return new DysonSwarmSunReplacement(this.mName, this.mInventory.length); } @Override @@ -90,7 +94,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - aBaseMetaTileEntity.increaseStoredEnergyUnits((DysonSwarmSunReplacement.dysonObjs*10000)/ swarmControllers, true); + aBaseMetaTileEntity.increaseStoredEnergyUnits( + (DysonSwarmSunReplacement.dysonObjs * 10000) / swarmControllers, true); } public boolean isEnetOutput() { @@ -113,8 +118,8 @@ public class DysonSwarmSunReplacement extends MetaTileEntity { } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java index 1fbddb01b1..77dc5c2c22 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -28,53 +28,29 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class GalaxySpaceProxy { - private GalaxySpaceProxy() { - } + private GalaxySpaceProxy() {} - public static void postInit(FMLPostInitializationEvent e){ + public static void postInit(FMLPostInitializationEvent e) {} - } + public static void preInit(FMLPreInitializationEvent e) {} - public static void preInit(FMLPreInitializationEvent e) { + private static void serverpreInit(FMLPreInitializationEvent e) {} - } + private static void clientpreInit(FMLPreInitializationEvent e) {} - private static void serverpreInit(FMLPreInitializationEvent e) { + private static void commonpreInit(FMLPreInitializationEvent e) {} - } + public static void init(FMLInitializationEvent e) {} - private static void clientpreInit(FMLPreInitializationEvent e) { - } + private static void serverInit(FMLInitializationEvent e) {} - private static void commonpreInit(FMLPreInitializationEvent e) { + private static void clientInit(FMLInitializationEvent e) {} - } + private static void commonInit(FMLInitializationEvent e) {} - public static void init(FMLInitializationEvent e) { + private static void serverPostInit(FMLPostInitializationEvent e) {} - } - - private static void serverInit(FMLInitializationEvent e) { - - } - - private static void clientInit(FMLInitializationEvent e) { - - } - - private static void commonInit(FMLInitializationEvent e) { - - } - private static void serverPostInit(FMLPostInitializationEvent e) { - - } - - private static void clientPostInit(FMLPostInitializationEvent e) { - - } - - private static void commonPostInit(FMLPostInitializationEvent e) { - - } + private static void clientPostInit(FMLPostInitializationEvent e) {} + private static void commonPostInit(FMLPostInitializationEvent e) {} } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 7a01028a61..ea4e349ca8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -31,7 +31,7 @@ public class GT_NBT_DataBase { private static final BiMap<NBTTagCompound, Long> tagIdBiMap = HashBiMap.create(); private static final BiMap<GT_NBT_DataBase, Long> GTNBTBIMAP = HashBiMap.create(); - private static long maxID = Long.MIN_VALUE+1; + private static long maxID = Long.MIN_VALUE + 1; private final NBTTagCompound tagCompound; @@ -45,23 +45,23 @@ public class GT_NBT_DataBase { this.tagCompound = tagCompound; this.id = GT_NBT_DataBase.maxID; GT_NBT_DataBase.tagIdBiMap.put(tagCompound, this.id); - GT_NBT_DataBase.GTNBTBIMAP.put(this,this.id); + GT_NBT_DataBase.GTNBTBIMAP.put(this, this.id); ++GT_NBT_DataBase.maxID; } - static GT_NBT_DataBase getGTTagFromId(Long id){ + static GT_NBT_DataBase getGTTagFromId(Long id) { return GT_NBT_DataBase.GTNBTBIMAP.inverse().get(id); } - static Long getIdFromGTTag(GT_NBT_DataBase tagCompound){ + static Long getIdFromGTTag(GT_NBT_DataBase tagCompound) { return GT_NBT_DataBase.GTNBTBIMAP.get(tagCompound); } - static NBTTagCompound getTagFromId(Long id){ + static NBTTagCompound getTagFromId(Long id) { return GT_NBT_DataBase.tagIdBiMap.inverse().get(id); } - static Long getIdFromTag(NBTTagCompound tagCompound){ + static Long getIdFromTag(NBTTagCompound tagCompound) { return GT_NBT_DataBase.tagIdBiMap.get(tagCompound); } @@ -96,7 +96,8 @@ public class GT_NBT_DataBase { this.id = id; } - public static GT_NBT_DataBase makeNewWithoutRegister(String mDataName, String mDataTitle, NBTTagCompound tagCompound){ - return new GT_NBT_DataBase(tagCompound,mDataName,mDataTitle,Long.MIN_VALUE); + public static GT_NBT_DataBase makeNewWithoutRegister( + String mDataName, String mDataTitle, NBTTagCompound tagCompound) { + return new GT_NBT_DataBase(tagCompound, mDataName, mDataTitle, Long.MIN_VALUE); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 082b7307d1..fd69d50483 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -32,6 +32,9 @@ import cpw.mods.fml.common.Optional; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; @@ -42,14 +45,11 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers") -public class TileEntity_GTDataServer extends TileEntity implements ISidedInventory, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { +public class TileEntity_GTDataServer extends TileEntity + implements ISidedInventory, ITileWithGUI, ITileAddsInformation, ITileHasDifferentTextureSides, SimpleComponent { - private final BiMap<Long,GT_NBT_DataBase> OrbDataBase = HashBiMap.create(); + private final BiMap<Long, GT_NBT_DataBase> OrbDataBase = HashBiMap.create(); private ItemStack[] mItems = new ItemStack[2]; private byte TickTimer; @@ -63,8 +63,9 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento @Callback public Object[] listData(Context context, Arguments args) { Set<String> ret = new HashSet<>(); - for (Map.Entry<Long,GT_NBT_DataBase> entry : OrbDataBase.entrySet()){ - ret.add((entry.getValue().getId()+Long.MAX_VALUE)+". "+entry.getValue().getmDataTitle()); + for (Map.Entry<Long, GT_NBT_DataBase> entry : OrbDataBase.entrySet()) { + ret.add((entry.getValue().getId() + Long.MAX_VALUE) + ". " + + entry.getValue().getmDataTitle()); } return ret.toArray(new String[0]); } @@ -72,21 +73,19 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento @Optional.Method(modid = "OpenComputers") @Callback public Object[] imprintOrb(Context context, Arguments args) { - return new Object[]{false}; + return new Object[] {false}; } - - private boolean isServerSide(){ + private boolean isServerSide() { return !this.worldObj.isRemote || SideReference.Side.Server; } @Override public void updateEntity() { - if (this.TickTimer++ % 20 != 0) - return; - + if (this.TickTimer++ % 20 != 0) return; + if (this.isServerSide()) { - if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataOrb.get(1))) { + if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataOrb.get(1))) { if (this.mItems[0].hasTagCompound()) { if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( @@ -94,37 +93,33 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento new GT_NBT_DataBase( Behaviour_DataOrb.getDataName(this.mItems[0]), Behaviour_DataOrb.getDataTitle(this.mItems[0]), - this.mItems[0].getTagCompound() - ) - ); + this.mItems[0].getTagCompound())); } else { long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); - this.OrbDataBase.put(id,GT_NBT_DataBase.getGTTagFromId(id)); + this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } } - if (GT_Utility.areStacksEqual(this.mItems[0],ItemList.Tool_DataStick.get(1))) { + if (GT_Utility.areStacksEqual(this.mItems[0], ItemList.Tool_DataStick.get(1))) { if (this.mItems[0].hasTagCompound()) { - + String bookTitle = GT_Utility.ItemNBT.getBookTitle(this.mItems[0]); String punchcardData = GT_Utility.ItemNBT.getPunchCardData(this.mItems[0]); short mapID = GT_Utility.ItemNBT.getMapID(this.mItems[0]); byte data = (byte) (bookTitle.isEmpty() ? punchcardData.isEmpty() ? mapID != -1 ? 3 : -1 : 2 : 1); - - String title = data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? ""+mapID : "Custom Data"; - String name = data == 1 ? "eBook" : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; + + String title = + data == 1 ? bookTitle : data == 2 ? punchcardData : data == 3 ? "" + mapID : "Custom Data"; + String name = data == 1 + ? "eBook" + : data == 2 ? "Punch Card Data" : data == 3 ? "Map Data" : "Custom Data"; if (GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()) == null) { this.OrbDataBase.put( GT_NBT_DataBase.getMaxID(), - new GT_NBT_DataBase( - name, - title, - this.mItems[0].getTagCompound() - ) - ); + new GT_NBT_DataBase(name, title, this.mItems[0].getTagCompound())); } else { - long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); - this.OrbDataBase.put(id,GT_NBT_DataBase.getGTTagFromId(id)); + long id = GT_NBT_DataBase.getIdFromTag(this.mItems[0].getTagCompound()); + this.OrbDataBase.put(id, GT_NBT_DataBase.getGTTagFromId(id)); } } } @@ -137,9 +132,7 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento } @Override - public void registerBlockIcons(IIconRegister par1IconRegister) { - - } + public void registerBlockIcons(IIconRegister par1IconRegister) {} @Override public int getGUIID() { @@ -183,9 +176,8 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento @Override public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - if (p_70299_1_ > 1 || p_70299_1_ < 0) - return; - this.mItems[p_70299_1_]=p_70299_2_; + if (p_70299_1_ > 1 || p_70299_1_ < 0) return; + this.mItems[p_70299_1_] = p_70299_2_; } @Override @@ -209,14 +201,10 @@ public class TileEntity_GTDataServer extends TileEntity implements ISidedInvento } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index ffac1554d4..7caac936d5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -29,15 +29,15 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; - import java.util.ArrayList; import java.util.Iterator; -@SuppressWarnings({"unused","RedundantSuppression"}) +@SuppressWarnings({"unused", "RedundantSuppression"}) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> mTTEnergyHatches = new ArrayList<>(); ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> mTTDynamos = new ArrayList<>(); + public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -46,21 +46,19 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { super(aName); } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new TT_TileEntity_ManualTrafo(this.mName); } - public boolean addEnergyOutput(long aEU) { if (aEU <= 0L) { return true; } else { - return mTTDynamos.size() > 0 || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); + return mTTDynamos.size() > 0 + || this.mDynamoHatches.size() > 0 && this.addEnergyOutputMultipleDynamos(aEU, true); } } - public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { int injected = 0; long totalOutput = 0L; @@ -69,7 +67,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { Iterator<GT_MetaTileEntity_Hatch_Dynamo> var10 = this.mDynamoHatches.iterator(); long aVoltage; - while(var10.hasNext()) { + while (var10.hasNext()) { GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next(); if (aDynamo == null) { return false; @@ -94,7 +92,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } else { Iterator<GT_MetaTileEntity_Hatch_Dynamo> var17 = this.mDynamoHatches.iterator(); - while(true) { + while (true) { GT_MetaTileEntity_Hatch_Dynamo aDynamo; do { if (!var17.hasNext()) { @@ -102,20 +100,20 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } aDynamo = var17.next(); - } while(!isValidMetaTileEntity(aDynamo)); + } while (!isValidMetaTileEntity(aDynamo)); - long leftToInject = aEU - (long)injected; + long leftToInject = aEU - (long) injected; aVoltage = aDynamo.maxEUOutput(); - int aAmpsToInject = (int)(leftToInject / aVoltage); - int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage); - int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); + int aAmpsToInject = (int) (leftToInject / aVoltage); + int aRemainder = (int) (leftToInject - (long) aAmpsToInject * aVoltage); + int ampsOnCurrentHatch = (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); - for(int i = 0; i < ampsOnCurrentHatch; ++i) { + for (int i = 0; i < ampsOnCurrentHatch; ++i) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); } - injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch); - if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { + injected = (int) ((long) injected + aVoltage * (long) ampsOnCurrentHatch); + if (aRemainder > 0 && (long) ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder; } @@ -123,8 +121,6 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } } - - public boolean drainEnergyInput(long aEU) { if (aEU > 0L) { { @@ -137,7 +133,8 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } tHatch = var3.next(); - } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } while (!isValidMetaTileEntity(tHatch) + || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } { Iterator<GT_MetaTileEntity_Hatch_Energy> var3 = this.mEnergyHatches.iterator(); @@ -149,10 +146,10 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { } tHatch = var3.next(); - } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + } while (!isValidMetaTileEntity(tHatch) + || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } - } return true; } -}
\ No newline at end of file +} diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java index aea0bd9ec9..593fcf33b8 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechEnabledMulti.java @@ -30,11 +30,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.util.GT_Utility; +import java.util.List; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; -import java.util.List; - public interface TecTechEnabledMulti { List<GT_MetaTileEntity_Hatch_Energy> getVanillaEnergyHatches(); @@ -58,7 +57,7 @@ public interface TecTechEnabledMulti { maxEnergy += tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - return new long[]{storedEnergy, maxEnergy}; + return new long[] {storedEnergy, maxEnergy}; } default String[] getInfoDataArray(GT_MetaTileEntity_MultiBlockBase multiBlockBase) { @@ -81,26 +80,30 @@ public interface TecTechEnabledMulti { } } - return new String[]{ - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + - EnumChatFormatting.RED + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + - EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + - StatCollector.translateToLocal("GT5U.machines.tier") + ": " + - EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + - EnumChatFormatting.RED + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + " " + - StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + - EnumChatFormatting.YELLOW + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + - EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(multiBlockBase.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(multiBlockBase.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-multiBlockBase.mEUt) + EnumChatFormatting.RESET + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(multiBlockBase.getMaxInputVoltage()) + EnumChatFormatting.RESET + + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(multiBlockBase.getMaxInputVoltage())] + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + + (multiBlockBase.getIdealStatus() - multiBlockBase.getRepairStatus()) + EnumChatFormatting.RESET + + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + EnumChatFormatting.YELLOW + + (float) multiBlockBase.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + + mPollutionReduction + EnumChatFormatting.RESET + " %", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index ce810e2125..83d1604d11 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -39,7 +39,9 @@ public class TecTechResearchLoader { @SuppressWarnings("deprecation") public static void runResearches() { - Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); + Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null + ? FluidRegistry.getFluid("molten.indalloy140") + : FluidRegistry.getFluid("molten.solderingalloy"); if (LoaderReference.galacticgreg) { @@ -49,23 +51,20 @@ public class TecTechResearchLoader { 256, BW_Util.getMachineVoltageFromTier(7), 24, - new Object[]{ - ItemRegistry.voidminer[0].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), - Materials.BlackPlutonium.getPlates(3), - ItemList.Electric_Motor_ZPM.get(9L), - ItemList.Sensor_ZPM.get(9L), - ItemList.Field_Generator_ZPM.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) + new Object[] { + ItemRegistry.voidminer[0].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.BlackPlutonium, 9L), + Materials.BlackPlutonium.getPlates(3), + ItemList.Electric_Motor_ZPM.get(9L), + ItemList.Sensor_ZPM.get(9L), + ItemList.Field_Generator_ZPM.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.BlackPlutonium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Krypton.getFluidOrGas(20000) + new FluidStack[] {new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Krypton.getFluidOrGas(20000) }, ItemRegistry.voidminer[1].copy(), 216000, - BW_Util.getMachineVoltageFromTier(7) - ); + BW_Util.getMachineVoltageFromTier(7)); TT_recipeAdder.addResearchableAssemblylineRecipe( ItemRegistry.voidminer[1].copy(), @@ -73,24 +72,21 @@ public class TecTechResearchLoader { 512, BW_Util.getMachineVoltageFromTier(8), 64, - new Object[]{ - ItemRegistry.voidminer[1].copy(), - GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), - Materials.Neutronium.getPlates(3), - ItemList.Electric_Motor_UV.get(9L), - ItemList.Sensor_UV.get(9L), - ItemList.Field_Generator_UV.get(9L), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) + new Object[] { + ItemRegistry.voidminer[1].copy(), + GT_OreDictUnificator.get(OrePrefixes.frameGt, Materials.Neutronium, 9L), + Materials.Neutronium.getPlates(3), + ItemList.Electric_Motor_UV.get(9L), + ItemList.Sensor_UV.get(9L), + ItemList.Field_Generator_UV.get(9L), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Neutronium, 36L) }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - WerkstoffLoader.Oganesson.getFluidOrGas(20000) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), WerkstoffLoader.Oganesson.getFluidOrGas(20000) }, ItemRegistry.voidminer[2].copy(), 432000, - BW_Util.getMachineVoltageFromTier(8) - ); - + BW_Util.getMachineVoltageFromTier(8)); } TT_recipeAdder.addResearchableAssemblylineRecipe( @@ -99,45 +95,50 @@ public class TecTechResearchLoader { 48, BW_Util.getMachineVoltageFromTier(8), 8, - new Object[]{ - ItemList.Machine_Multi_ImplosionCompressor.get(1L), - Materials.Neutronium.getBlocks(5), - GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), - GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), - ItemList.Electric_Piston_UV.get(64), + new Object[] { + ItemList.Machine_Multi_ImplosionCompressor.get(1L), + Materials.Neutronium.getBlocks(5), + GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), + GT_OreDictUnificator.get(OrePrefixes.wireGt01, Materials.Superconductor, 64), + ItemList.Electric_Piston_UV.get(64), }, - new FluidStack[]{ - new FluidStack(solderIndalloy, 1440), - Materials.Osmium.getMolten(1440), - Materials.Neutronium.getMolten(1440) + new FluidStack[] { + new FluidStack(solderIndalloy, 1440), + Materials.Osmium.getMolten(1440), + Materials.Neutronium.getMolten(1440) }, ItemRegistry.eic.copy(), 240000, - BW_Util.getMachineVoltageFromTier(8) - ); + BW_Util.getMachineVoltageFromTier(8)); -// BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); -// HashSet<GT_Recipe.GT_Recipe_AssemblyLine> toRem = new HashSet<>(); -// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ -// if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, CustomItemList.UnusedStuff.get(1L))){ -// String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; -// if (!modId.equalsIgnoreCase("tectech")) -// if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) -// toRem.add(recipe); -// } -// } -// HashSet<GT_Recipe> toRemVisualScanner = new HashSet<>(); -// HashSet<GT_Recipe> toRemVisualAssLine = new HashSet<>(); -// GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); -// -// for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ -// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); -// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); -// TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); -// } -// -// GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); -// GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); + // BartWorksCrossmod.LOGGER.info("Nerfing Assembly Lines >= LuV Recipes to run with TecTech!"); + // HashSet<GT_Recipe.GT_Recipe_AssemblyLine> toRem = new HashSet<>(); + // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes){ + // if (recipe.mEUt >= BW_Util.getTierVoltage(6) && !GT_Utility.areStacksEqual(recipe.mResearchItem, + // CustomItemList.UnusedStuff.get(1L))){ + // String modId = GameRegistry.findUniqueIdentifierFor(recipe.mOutput.getItem()).modId; + // if (!modId.equalsIgnoreCase("tectech")) + // if (!modId.equalsIgnoreCase("gregtech") || modId.equalsIgnoreCase("gregtech") && + // (recipe.mOutput.getItemDamage() < 15000 || recipe.mOutput.getItemDamage() > 16999)) + // toRem.add(recipe); + // } + // } + // HashSet<GT_Recipe> toRemVisualScanner = new HashSet<>(); + // HashSet<GT_Recipe> toRemVisualAssLine = new HashSet<>(); + // GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.removeAll(toRem); + // + // for (GT_Recipe.GT_Recipe_AssemblyLine recipe : toRem){ + // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.stream().filter(re -> + // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualAssLine::add); + // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.stream().filter(re -> + // GT_Utility.areStacksEqual(re.mOutputs[0],recipe.mOutput)).forEach(toRemVisualScanner::add); + // TT_recipeAdder.addResearchableAssemblylineRecipe(recipe.mResearchItem, recipe.mResearchTime, + // recipe.mResearchTime/1000, recipe.mEUt, GT_Utility.getTier(recipe.mEUt)-2, recipe.mInputs, + // recipe.mFluidInputs, recipe.mOutput, recipe.mDuration, recipe.mEUt); + // } + // + // GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.mRecipeList.removeAll(toRemVisualScanner); + // GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList.removeAll(toRemVisualAssLine); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java index c392754c0c..f8d0db5ea6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/IHasCoils.java @@ -26,5 +26,6 @@ import gregtech.api.enums.HeatingCoilLevel; public interface IHasCoils { void setCoilHeat(HeatingCoilLevel coilMeta); + HeatingCoilLevel getCoilHeat(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java index 05ca3b665f..af3059ea7c 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java @@ -33,34 +33,31 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockB public class TecTechUtils { @Deprecated - public static boolean addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex){ + public static boolean addEnergyInputToMachineList( + TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex) { return addEnergyInputToMachineList(baseTE, te, aBaseCasingIndex, -1) != -1; } - public static int addEnergyInputToMachineList(TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex, int aTier) { - if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) - return -1; + public static int addEnergyInputToMachineList( + TecTechEnabledMulti baseTE, IGregTechTileEntity te, int aBaseCasingIndex, int aTier) { + if (te == null || !(te.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch)) return -1; else { GT_MetaTileEntity_Hatch mte = (GT_MetaTileEntity_Hatch) te.getMetaTileEntity(); - if(mte.mTier != aTier && aTier != -1) - return -1; + if (mte.mTier != aTier && aTier != -1) return -1; if (mte instanceof GT_MetaTileEntity_Hatch_EnergyTunnel) - if(baseTE.getVanillaEnergyHatches().isEmpty() && baseTE.getTecTechEnergyMultis().isEmpty()) + if (baseTE.getVanillaEnergyHatches().isEmpty() + && baseTE.getTecTechEnergyMultis().isEmpty()) baseTE.getTecTechEnergyTunnels().add((GT_MetaTileEntity_Hatch_EnergyTunnel) mte); - else - return -1; - else if(baseTE.getTecTechEnergyTunnels().isEmpty()) { + else return -1; + else if (baseTE.getTecTechEnergyTunnels().isEmpty()) { if (mte instanceof GT_MetaTileEntity_Hatch_Energy) baseTE.getVanillaEnergyHatches().add((GT_MetaTileEntity_Hatch_Energy) mte); else if (mte instanceof GT_MetaTileEntity_Hatch_EnergyMulti) baseTE.getTecTechEnergyMultis().add((GT_MetaTileEntity_Hatch_EnergyMulti) mte); - else - return -1; - } - else - return -1; + else return -1; + } else return -1; mte.updateTexture(aBaseCasingIndex); return mte.mTier; @@ -68,8 +65,7 @@ public class TecTechUtils { } public static boolean drainEnergyMEBFTecTech(TecTechEnabledMulti multi, long aEU) { - if (aEU <= 0) - return true; + if (aEU <= 0) return true; long allTheEu = 0; int hatches = 0; @@ -91,8 +87,7 @@ public class TecTechUtils { hatches++; } - if (allTheEu < aEU) - return false; + if (allTheEu < aEU) return false; if (hatches == 0) return false; @@ -109,7 +104,10 @@ public class TecTechUtils { for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis()) hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false); - return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0); + return hasDrained + && (multi.getVanillaEnergyHatches().size() > 0 + || multi.getTecTechEnergyTunnels().size() > 0 + || multi.getTecTechEnergyMultis().size() > 0); } public static long getnominalVoltageTT(TecTechEnabledMulti base) { @@ -181,6 +179,6 @@ public class TecTechUtils { } public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) { - return tHatch.Amperes * tHatch.maxEUInput()/* - (tHatch.Amperes / 20)*/; + return tHatch.Amperes * tHatch.maxEUInput() /* - (tHatch.Amperes / 20)*/; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java index 9cc15b6773..77677ed79b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/LowPowerLaser.java @@ -40,8 +40,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel return false; } - default void setEUVar(long aEnergy) { - } + default void setEUVar(long aEnergy) {} default long getAMPERES() { return -1; @@ -70,7 +69,8 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel byte opposite = GT_Utility.getOppositeSide(front); for (short dist = 1; dist < 250; ++dist) { - IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); + IGregTechTileEntity tGTTileEntity = + aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); if (tGTTileEntity == null || tGTTileEntity.getColorization() != color) { return; } @@ -80,23 +80,35 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel return; } - if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isReceiver() && opposite == tGTTileEntity.getFrontFacing()) { - if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { + if (aMetaTileEntity instanceof LowPowerLaser + && ((LowPowerLaser) aMetaTileEntity).isReceiver() + && opposite == tGTTileEntity.getFrontFacing()) { + if (this.maxEUOutput() > ((LowPowerLaser) aMetaTileEntity).maxEUInput() + || this.getAMPERES() > ((LowPowerLaser) aMetaTileEntity).getAMPERES()) { aMetaTileEntity.doExplosion(this.maxEUOutput()); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - this.maxEUOutput()); return; } if (this.maxEUOutput() == ((LowPowerLaser) aMetaTileEntity).maxEUInput()) { - long diff = Math.min(this.getAMPERES() * 20L * this.maxEUOutput(), Math.min(((LowPowerLaser) aMetaTileEntity).maxEUStore() - aMetaTileEntity.getBaseMetaTileEntity().getStoredEU(), aBaseMetaTileEntity.getStoredEU())); + long diff = Math.min( + this.getAMPERES() * 20L * this.maxEUOutput(), + Math.min( + ((LowPowerLaser) aMetaTileEntity).maxEUStore() + - aMetaTileEntity + .getBaseMetaTileEntity() + .getStoredEU(), + aBaseMetaTileEntity.getStoredEU())); this.setEUVar(aBaseMetaTileEntity.getStoredEU() - diff); - ((LowPowerLaser) aMetaTileEntity).setEUVar(aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); + ((LowPowerLaser) aMetaTileEntity) + .setEUVar( + aMetaTileEntity.getBaseMetaTileEntity().getStoredEU() + diff); } return; } - - if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { + if ((!(aMetaTileEntity instanceof LowPowerLaser) || !((LowPowerLaser) aMetaTileEntity).isTunnel()) + && !(aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Energy)) { return; } @@ -107,8 +119,7 @@ public interface LowPowerLaser extends IMetaTileEntity, IConnectsToEnergyTunnel ((GT_MetaTileEntity_Pipe_Energy) aMetaTileEntity).markUsed(); } else if (aMetaTileEntity instanceof LowPowerLaser && ((LowPowerLaser) aMetaTileEntity).isTunnel()) { - if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) - return; + if (!((LowPowerLaser) aMetaTileEntity).isConnectedCorrectly(front)) return; } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java index 34473eab6c..f6db55e4d3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_Abstract_LowPowerLaserThingy.java @@ -26,32 +26,55 @@ import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import java.util.Optional; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import java.util.Optional; - -public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock implements LowPowerLaser { +public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_TieredMachineBlock + implements LowPowerLaser { protected long AMPERES; - public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture... aTextures) { + public TT_Abstract_LowPowerLaserThingy( + int aID, + String aName, + String aNameRegional, + int aTier, + long aAmperes, + int aInvSlotCount, + String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy(int aID, String aName, String aNameRegional, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + public TT_Abstract_LowPowerLaserThingy( + int aID, + String aName, + String aNameRegional, + int aTier, + long aAmperes, + int aInvSlotCount, + String[] aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public TT_Abstract_LowPowerLaserThingy( + String aName, int aTier, long aAmperes, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } - public TT_Abstract_LowPowerLaserThingy(String aName, int aTier, long aAmperes, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public TT_Abstract_LowPowerLaserThingy( + String aName, + int aTier, + long aAmperes, + int aInvSlotCount, + String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); this.AMPERES = aAmperes; } @@ -93,16 +116,12 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ @Override public void saveNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent( - tag -> tag.setLong("AMPERES", AMPERES) - ); + Optional.ofNullable(nbtTagCompound).ifPresent(tag -> tag.setLong("AMPERES", AMPERES)); } @Override public void loadNBTData(NBTTagCompound nbtTagCompound) { - Optional.ofNullable(nbtTagCompound).ifPresent( - tag -> AMPERES = tag.getLong("AMPERES") - ); + Optional.ofNullable(nbtTagCompound).ifPresent(tag -> AMPERES = tag.getLong("AMPERES")); } @Override @@ -154,5 +173,4 @@ public abstract class TT_Abstract_LowPowerLaserThingy extends GT_MetaTileEntity_ public long maxEUStore() { return 512L + GT_Values.V[this.mTier + 1] * 24L * AMPERES; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java index 3247af4861..996a106b4b 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserBox.java @@ -32,11 +32,13 @@ import gregtech.api.util.GT_Utility; public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLaserThingy { - public TT_MetaTileEntity_LowPowerLaserBox(int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) { + public TT_MetaTileEntity_LowPowerLaserBox( + int aID, String aName, String aNameRegional, int aTier, long aAmperes, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aAmperes, 0, new String[0], aTextures); } - public TT_MetaTileEntity_LowPowerLaserBox(String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserBox( + String aName, int aTier, long aAmperes, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmperes, 0, aDescription, aTextures); } @@ -92,7 +94,8 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_MetaTileEntity_LowPowerLaserBox(this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures); + return new TT_MetaTileEntity_LowPowerLaserBox( + this.mName, this.mTier, this.AMPERES, this.mDescriptionArray, this.mTextures); } @Override @@ -116,39 +119,82 @@ public class TT_MetaTileEntity_LowPowerLaserBox extends TT_Abstract_LowPowerLase } } - @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[1][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[2][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier]}; - rTextures[3][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; - rTextures[4][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; - rTextures[5][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier]}; - rTextures[6][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[7][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[8][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]}; - rTextures[9][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; - rTextures[10][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; - rTextures[11][i + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier]}; + rTextures[0][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[1][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[2][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[this.mTier] + }; + rTextures[3][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] + }; + rTextures[4][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] + }; + rTextures[5][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_IN_LASER_TT[this.mTier] + }; + rTextures[6][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[7][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[8][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + }; + rTextures[9][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] + }; + rTextures[10][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] + }; + rTextures[11][i + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + com.github.technus.tectech.thing.metaTileEntity.Textures.OVERLAYS_ENERGY_OUT_LASER_TT[this.mTier] + }; } return rTextures; } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { return this.mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1]; } @Override public String[] getDescription() { - return new String[]{ - "Like a Tranformer... but for LAZORZ", - "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + ChatColorHelper.WHITE + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get()}; + return new String[] { + "Like a Tranformer... but for LAZORZ", + "Transfer rate: " + ChatColorHelper.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + + ChatColorHelper.WHITE + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + }; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java index eef208a71e..0aa5cbee2d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserDynamo.java @@ -32,19 +32,22 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @SuppressWarnings("deprecation") -public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel implements LowPowerLaser { +public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hatch_DynamoTunnel + implements LowPowerLaser { public TT_MetaTileEntity_LowPowerLaserDynamo(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserDynamo(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserDynamo( + String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_MetaTileEntity_LowPowerLaserDynamo(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + return new TT_MetaTileEntity_LowPowerLaserDynamo( + this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); } @Override @@ -69,11 +72,12 @@ public class TT_MetaTileEntity_LowPowerLaserDynamo extends GT_MetaTileEntity_Hat @Override public String[] getDescription() { - return new String[]{ - this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + return new String[] { + this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.dynamotunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java index 7274d37af5..3cacc5e843 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_LowPowerLaserHatch.java @@ -32,29 +32,33 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; @SuppressWarnings("deprecation") -public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel implements LowPowerLaser { +public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatch_EnergyTunnel + implements LowPowerLaser { public TT_MetaTileEntity_LowPowerLaserHatch(int aID, String aName, String aNameRegional, int aTier, int aAmp) { super(aID, aName, aNameRegional, aTier, aAmp); } - public TT_MetaTileEntity_LowPowerLaserHatch(String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { + public TT_MetaTileEntity_LowPowerLaserHatch( + String aName, int aTier, int aAmp, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aAmp, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[]{ - this.mDescription, - StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " - + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + EnumChatFormatting.RESET + " EU/t", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + return new String[] { + this.mDescription, + StatCollector.translateToLocal("gt.blockmachines.hatch.energytunnel.desc.1") + ": " + + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.getTotalPower()) + + EnumChatFormatting.RESET + " EU/t", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_MetaTileEntity_LowPowerLaserHatch(this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); + return new TT_MetaTileEntity_LowPowerLaserHatch( + this.mName, this.mTier, this.Amperes, this.mDescription, this.mTextures); } @Override @@ -76,5 +80,4 @@ public class TT_MetaTileEntity_LowPowerLaserHatch extends GT_MetaTileEntity_Hatc public long getAMPERES() { return this.Amperes; } - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java index f66014596c..4be79bfd10 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/tiered/TT_MetaTileEntity_Pipe_Energy_LowPower.java @@ -35,26 +35,41 @@ import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Client; import ic2.core.Ic2Items; +import java.util.ArrayList; +import java.util.HashSet; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import java.util.ArrayList; -import java.util.HashSet; - public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Cable implements LowPowerLaser { public TT_MetaTileEntity_Pipe_Energy_LowPower(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, 0.25f, Materials.BorosilicateGlass, 0, 0, 0, false, false); } - public TT_MetaTileEntity_Pipe_Energy_LowPower(String aName, float aThickNess, Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) { + public TT_MetaTileEntity_Pipe_Energy_LowPower( + String aName, + float aThickNess, + Materials aMaterial, + long aCableLossPerMeter, + long aAmperage, + long aVoltage, + boolean aInsulated, + boolean aCanShock) { super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock); } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { - return new TT_MetaTileEntity_Pipe_Energy_LowPower(this.mName, this.mThickNess, this.mMaterial, this.mCableLossPerMeter, this.mAmperage, this.mVoltage, this.mInsulated, this.mCanShock); + return new TT_MetaTileEntity_Pipe_Energy_LowPower( + this.mName, + this.mThickNess, + this.mMaterial, + this.mCableLossPerMeter, + this.mAmperage, + this.mVoltage, + this.mInsulated, + this.mCanShock); } @Override @@ -65,24 +80,32 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) { - return new ITexture[]{ - TextureFactory.of( - Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), - Ic2Items.glassFiberCableBlock.getItemDamage(), - ForgeDirection.getOrientation(aSide) - ) + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aConnections, + byte aColorIndex, + boolean aConnected, + boolean aRedstone) { + return new ITexture[] { + TextureFactory.of( + Block.getBlockFromItem(Ic2Items.glassFiberCableBlock.getItem()), + Ic2Items.glassFiberCableBlock.getItemDamage(), + ForgeDirection.getOrientation(aSide)) }; } @Override public String[] getDescription() { - return new String[]{ - "Primitive Laser Cable intended for Low Power Applications", - "Does not auto-connect", - "Does not turn or bend", - ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + " in order to work", - BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() + return new String[] { + "Primitive Laser Cable intended for Low Power Applications", + "Does not auto-connect", + "Does not turn or bend", + ChatColorHelper.WHITE + "Must be " + ChatColorHelper.YELLOW + "c" + ChatColorHelper.RED + "o" + + ChatColorHelper.BLUE + "l" + ChatColorHelper.DARKPURPLE + "o" + ChatColorHelper.GOLD + "r" + + ChatColorHelper.DARKRED + "e" + ChatColorHelper.DARKGREEN + "d" + ChatColorHelper.WHITE + + " in order to work", + BW_Tooltip_Reference.ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS.get() }; } @@ -126,11 +149,11 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca return 0L; } - @Override @Deprecated @SuppressWarnings("deprecation") - public long transferElectricity(byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) { + public long transferElectricity( + byte aSide, long aVoltage, long aAmperage, ArrayList<TileEntity> aAlreadyPassedTileEntityList) { return 0L; } @@ -140,12 +163,14 @@ public class TT_MetaTileEntity_Pipe_Energy_LowPower extends GT_MetaPipeEntity_Ca } @Override - public boolean letsIn(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean letsIn( + GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } @Override - public boolean letsOut(GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public boolean letsOut( + GT_CoverBehavior coverBehavior, byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return true; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java index a4cff256bb..e64bcab13f 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tgregworks/MaterialsInjector.java @@ -8,6 +8,11 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; import net.minecraftforge.common.config.Property; import tconstruct.library.TConstructRegistry; import vexatos.tgregworks.TGregworks; @@ -15,20 +20,15 @@ import vexatos.tgregworks.integration.TGregRegistry; import vexatos.tgregworks.item.ItemTGregPart; import vexatos.tgregworks.reference.Config; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; - @Mod( - modid = MaterialsInjector.MOD_ID, name = MaterialsInjector.NAME, version = MaterialsInjector.VERSION, + modid = MaterialsInjector.MOD_ID, + name = MaterialsInjector.NAME, + version = MaterialsInjector.VERSION, dependencies = "required-after:IC2; " + "required-after:gregtech; " + "required-after:bartworks;" + "before:TGregworks;" - + "before:miscutils; " -) + + "before:miscutils; ") @SuppressWarnings("unchecked") public class MaterialsInjector { @@ -57,19 +57,17 @@ public class MaterialsInjector { try { getFields(); getMethodes(); - } catch ( - IllegalArgumentException + } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException - | SecurityException - e) { + | SecurityException e) { MainMod.LOGGER.catching(e); FMLCommonHandler.instance().exitJava(1, true); } } - private static void getFields() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { + private static void getFields() throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { Field configPropsField = TGregRegistry.class.getDeclaredField("configProps"); configPropsField.setAccessible(true); configProps = (HashMap<Materials, Property>) configPropsField.get(TGregworks.registry); @@ -83,7 +81,8 @@ public class MaterialsInjector { getGlobalMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class); getGlobalMultiplierMethod.setAccessible(true); - getGlobalMultiplierMethodTwoArguments = TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class, double.class); + getGlobalMultiplierMethodTwoArguments = + TGregRegistry.class.getDeclaredMethod("getGlobalMultiplier", String.class, double.class); getGlobalMultiplierMethodTwoArguments.setAccessible(true); getMultiplierMethod = TGregRegistry.class.getDeclaredMethod("getMultiplier", Materials.class, String.class); @@ -134,10 +133,11 @@ public class MaterialsInjector { } } - private static void setConfigProps(Materials m){ + private static void setConfigProps(Materials m) { if (TGregworks.config.get(Config.Category.Enable, m.mName, true).getBoolean(true)) { TGregworks.registry.toolMaterials.add(m); - Property configProp = TGregworks.config.get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); + Property configProp = + TGregworks.config.get(Config.onMaterial(Config.MaterialID), m.mName, 0, null, 0, 100000); configProps.put(m, configProp); configIDs.add(configProp.getInt()); } @@ -145,25 +145,53 @@ public class MaterialsInjector { private static void addToolMaterial(int matID, Materials m) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addToolMaterial(matID, m.mName, m.mLocalizedName, m.mToolQuality, - (int) (m.mDurability * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability - (int) (m.mToolSpeed * 100F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining speed - (int) (m.mToolQuality * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack - (m.mToolQuality - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.HandleModifier), // Handle Modifier - (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), "", (m.getRGBA()[0] << 16) | (m.getRGBA()[1] << 8) | (m.getRGBA()[2])); + TConstructRegistry.addToolMaterial( + matID, + m.mName, + m.mLocalizedName, + m.mToolQuality, + (int) (m.mDurability + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Durability) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Durability)), // Durability + (int) (m.mToolSpeed + * 100F + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.MiningSpeed) + * (float) + getMultiplierMethod.invoke(TGregworks.registry, m, Config.MiningSpeed)), // Mining speed + (int) (m.mToolQuality + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.Attack) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.Attack)), // Attack + (m.mToolQuality - 0.5F) + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.HandleModifier) + * (float) getMultiplierMethod.invoke( + TGregworks.registry, m, Config.HandleModifier), // Handle Modifier + (int) getReinforcedLevelMethod.invoke(TGregworks.registry, m), + (float) getStoneboundLevelMethod.invoke(TGregworks.registry, m), + "", + (m.getRGBA()[0] << 16) | (m.getRGBA()[1] << 8) | (m.getRGBA()[2])); } private static void addBowMaterial(int matID, Materials m) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addBowMaterial(matID, - (int) ((float) m.mToolQuality * 10F * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), - (((float) m.mToolQuality) - 0.5F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowFlightSpeed) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowFlightSpeed)); + TConstructRegistry.addBowMaterial( + matID, + (int) ((float) m.mToolQuality + * 10F + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowDrawSpeed) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowDrawSpeed)), + (((float) m.mToolQuality) - 0.5F) + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.BowFlightSpeed) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.BowFlightSpeed)); } private static void addArrowMaterial(int matID, Materials m) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - TConstructRegistry.addArrowMaterial(matID, - (float) ((((double) m.getMass()) / 10F) * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.ArrowMass) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowMass)), - (float) getGlobalMultiplierMethodTwoArguments.invoke(TGregworks.registry, Config.ArrowBreakChance, 0.9) * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowBreakChance)); + TConstructRegistry.addArrowMaterial( + matID, + (float) ((((double) m.getMass()) / 10F) + * (float) getGlobalMultiplierMethod.invoke(TGregworks.registry, Config.ArrowMass) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowMass)), + (float) getGlobalMultiplierMethodTwoArguments.invoke(TGregworks.registry, Config.ArrowBreakChance, 0.9) + * (float) getMultiplierMethod.invoke(TGregworks.registry, m, Config.ArrowBreakChance)); } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index bacd18c894..07adc7e752 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -23,28 +23,33 @@ package com.github.bartimaeusnek.crossmod.thaumcraft; public class CustomAspects { -// static Constructor aspectConstructor; -// static Object TRADE; -// static Object UNIVERSE; -// static Object SCIENCE; -// static Object[] tmpArray = new Object[3]; -// static{ -// try { -// aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); -// tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); -// tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); -// tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); -// Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); -// Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); -// TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); -// Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); -// Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); -// UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); -// Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); -// Array.set(tmpArray[2],1,UNIVERSE); -// SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); -// } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | InvocationTargetException e) { -// e.printStackTrace(); -// } -// } + // static Constructor aspectConstructor; + // static Object TRADE; + // static Object UNIVERSE; + // static Object SCIENCE; + // static Object[] tmpArray = new Object[3]; + // static{ + // try { + // aspectConstructor = ThaumcraftHandler.AspectAdder.mAspectClass.getConstructor(String.class,int.class, + // Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,1).getClass(), ResourceLocation.class,int.class); + // tmpArray[0] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // tmpArray[1] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // tmpArray[2] = Array.newInstance(ThaumcraftHandler.AspectAdder.mAspectClass,2); + // Array.set(tmpArray[0],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("EXCHANGE").get(null)); + // Array.set(tmpArray[0],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("GREED").get(null)); + // TRADE = aspectConstructor.newInstance("Artis",0x00FF00, tmpArray[0],new + // ResourceLocation(MainMod.MOD_ID+":Aspects/Artis.png"),1); + // Array.set(tmpArray[1],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAGIC").get(null)); + // Array.set(tmpArray[1],1,ThaumcraftHandler.AspectAdder.mAspectClass.getField("ELDRITCH").get(null)); + // UNIVERSE = aspectConstructor.newInstance("Universum",0x0000FF, tmpArray[1],new + // ResourceLocation(MainMod.MOD_ID+":Aspects/Universum.png"),1); + // Array.set(tmpArray[2],0,ThaumcraftHandler.AspectAdder.mAspectClass.getField("MAN").get(null)); + // Array.set(tmpArray[2],1,UNIVERSE); + // SCIENCE = aspectConstructor.newInstance("Scientia",0x00FFFF, tmpArray[2],new + // ResourceLocation(MainMod.MOD_ID+":Aspects/Scientia.png"),1); + // } catch (NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InstantiationException | + // InvocationTargetException e) { + // e.printStackTrace(); + // } + // } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index ee22ca8ab2..3c0c8abf3e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -84,7 +84,8 @@ public class GT_Multi_IndustrialCrucible extends GT_MetaTileEntity_MultiBlockBas } @Override - public ITexture[] getTexture(IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { + public ITexture[] getTexture( + IGregTechTileEntity iGregTechTileEntity, byte b, byte b1, byte b2, boolean b3, boolean b4) { return new ITexture[0]; } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 08fc1d0e5c..813aa16d74 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -59,7 +59,6 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { } } } - } public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { @@ -115,8 +114,6 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { tStored = 9223372036854775807L; } - return new long[]{tStored, tScale}; + return new long[] {tStored, tScale}; } - - } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 872970b2f2..1cca3a9f8d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -26,17 +26,16 @@ import com.github.bartimaeusnek.bartworks.API.API_ConfigValues; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.log.DebugLog; import gregtech.api.enums.TC_Aspects; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.biome.BiomeGenBase; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.biome.BiomeGenBase; -@SuppressWarnings({"rawtypes","unchecked","unused"}) +@SuppressWarnings({"rawtypes", "unchecked", "unused"}) public class ThaumcraftHandler { - private ThaumcraftHandler(){} + private ThaumcraftHandler() {} private static Integer taintBiomeID; private static Integer magicalForestBiomeID; @@ -52,16 +51,21 @@ public class ThaumcraftHandler { public static boolean isWand(ItemStack aStack) { try { - return aStack != null && ThaumcraftHandler.mWandInterface.isAssignableFrom(aStack.getItem().getClass()); + return aStack != null + && ThaumcraftHandler.mWandInterface.isAssignableFrom( + aStack.getItem().getClass()); } catch (Throwable var3) { return false; } } - public static boolean isMagicalForestBiome(int biomeID){ + public static boolean isMagicalForestBiome(int biomeID) { if (ThaumcraftHandler.magicalForestBiomeID == null) { try { - BiomeGenBase biome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeMagicalForest").get(null); + BiomeGenBase biome = + (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") + .getField("biomeMagicalForest") + .get(null); return biomeID == (ThaumcraftHandler.magicalForestBiomeID = biome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -71,10 +75,13 @@ public class ThaumcraftHandler { return biomeID == ThaumcraftHandler.magicalForestBiomeID; } - public static boolean isTaintBiome(int biomeID){ + public static boolean isTaintBiome(int biomeID) { if (ThaumcraftHandler.taintBiomeID == null) { try { - BiomeGenBase TaintBiome = (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator").getField("biomeTaint").get(null); + BiomeGenBase TaintBiome = + (BiomeGenBase) Class.forName("thaumcraft.common.lib.world.ThaumcraftWorldGenerator") + .getField("biomeTaint") + .get(null); return biomeID == (ThaumcraftHandler.taintBiomeID = TaintBiome.biomeID); } catch (ClassCastException | ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { e.printStackTrace(); @@ -102,33 +109,45 @@ public class ThaumcraftHandler { try { ThaumcraftHandler.AspectAdder.mAspectListClass = Class.forName("thaumcraft.api.aspects.AspectList"); ThaumcraftHandler.AspectAdder.mAspectClass = Class.forName("thaumcraft.api.aspects.Aspect"); - ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectClass,int.class); - ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi").getMethod("registerObjectTag",ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.addToList = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( + "add", ThaumcraftHandler.AspectAdder.mAspectClass, int.class); + ThaumcraftHandler.AspectAdder.registerObjectTag = Class.forName("thaumcraft.api.ThaumcraftApi") + .getMethod( + "registerObjectTag", ItemStack.class, ThaumcraftHandler.AspectAdder.mAspectListClass); ThaumcraftHandler.AspectAdder.getName = ThaumcraftHandler.AspectAdder.mAspectClass.getMethod("getName"); - ThaumcraftHandler.AspectAdder.writeAspectListToNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("writeToNBT", NBTTagCompound.class); - ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("add", ThaumcraftHandler.AspectAdder.mAspectListClass); - ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); - ThaumcraftHandler.AspectAdder.getAspects = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); - ThaumcraftHandler.AspectAdder.readAspectListFromNBT = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); - ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName("thaumcraft.common.lib.research.ResearchManager").getMethod("isResearchComplete",String.class,String.class); - ThaumcraftHandler.AspectAdder.linkedAspektList = ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); + ThaumcraftHandler.AspectAdder.writeAspectListToNBT = + ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("writeToNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.add = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( + "add", ThaumcraftHandler.AspectAdder.mAspectListClass); + ThaumcraftHandler.AspectAdder.getAmount = ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod( + "getAmount", ThaumcraftHandler.AspectAdder.mAspectClass); + ThaumcraftHandler.AspectAdder.getAspects = + ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("getAspects"); + ThaumcraftHandler.AspectAdder.readAspectListFromNBT = + ThaumcraftHandler.AspectAdder.mAspectListClass.getMethod("readFromNBT", NBTTagCompound.class); + ThaumcraftHandler.AspectAdder.isResearchComplete = Class.forName( + "thaumcraft.common.lib.research.ResearchManager") + .getMethod("isResearchComplete", String.class, String.class); + ThaumcraftHandler.AspectAdder.linkedAspektList = + ThaumcraftHandler.AspectAdder.mAspectListClass.getField("aspects"); } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { e.printStackTrace(); } } - public static void addAspectViaBW(ItemStack stack, Pair<Object,Integer>... aspectPair) { - if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) - return; + public static void addAspectViaBW(ItemStack stack, Pair<Object, Integer>... aspectPair) { + if (stack == null || stack.getItem() == null || stack.getUnlocalizedName() == null) return; try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (Pair a : aspectPair) { if (API_ConfigValues.debugLog) - DebugLog.log("Stack:"+ stack.getDisplayName() + " Damage:" +stack.getItemDamage() + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + a.getValue()); + DebugLog.log("Stack:" + stack.getDisplayName() + " Damage:" + stack.getItemDamage() + + " aspectPair: " + ThaumcraftHandler.AspectAdder.getName.invoke(a.getKey()) + " / " + + a.getValue()); ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, a.getKey(), a.getValue()); } ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); - }catch (IllegalAccessException | InstantiationException | InvocationTargetException e){ + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); } } @@ -137,9 +156,10 @@ public class ThaumcraftHandler { try { Object aspectList = ThaumcraftHandler.AspectAdder.mAspectListClass.newInstance(); for (TC_Aspects.TC_AspectStack tc_aspects : tc_aspectStacks) - ThaumcraftHandler.AspectAdder.addToList.invoke(aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); + ThaumcraftHandler.AspectAdder.addToList.invoke( + aspectList, tc_aspects.mAspect.mAspect, (int) tc_aspects.mAmount); ThaumcraftHandler.AspectAdder.registerObjectTag.invoke(null, stack, aspectList); - }catch (IllegalAccessException | InstantiationException | InvocationTargetException e){ + } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { e.printStackTrace(); } } |