From 82bd52008b663bd38e96472c5d12a3db8bca63b3 Mon Sep 17 00:00:00 2001 From: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Date: Wed, 9 Jan 2019 19:17:23 +0100 Subject: Bio Cultre System! -Added the Bio Cultre System -Added the Bio Vat, Bio Lab and custom Glas types -Updated Copyright on the Files -Added a shitton of ressources -Added an API to for the Bio Cultre System -Added a Phyton Script for the ease of adding Glas Types to the Bio Vat -Fixed Spawning on custom blocks -Fixed Nuggets giving out boni in the windmill -Fixed tooltip again for the Windmill -Added dimensionsIDs to the BlockCoord class -Added apiJar, sourceJar, devJar to the grandlew output --- .../bartimaeusnek/bartworks/API/API_REFERENCE.java | 27 + .../bartworks/API/BioObjectAdder.java | 125 ++++ .../bartworks/API/BioObjectGetter.java | 122 ++++ .../bartworks/API/BioRecipeAdder.java | 124 ++++ .../bartworks/API/BioVatLogicAdder.java | 197 ++++++ .../github/bartimaeusnek/bartworks/GuiHandler.java | 53 +- .../github/bartimaeusnek/bartworks/MainMod.java | 62 +- .../bartworks/client/creativetabs/BioTab.java | 39 ++ .../bartworks/client/creativetabs/GT2Tab.java | 24 +- .../client/creativetabs/bartworksTab.java | 24 +- .../client/gui/BW_GUIContainer_RadLevel.java | 60 ++ .../client/gui/BW_GUIContainer_RotorBlock.java | 27 +- .../client/gui/BW_GUIContainer_Windmill.java | 39 +- .../gui/GT_GUIContainer_CircuitProgrammer.java | 28 +- .../client/gui/GT_GUIContainer_Destructopack.java | 28 +- .../bartworks/client/gui/GT_GUIContainer_LESU.java | 47 +- .../client/gui/GT_GUIContainer_RadioHatch.java | 77 +++ .../renderer/RendererSwitchingColorFluid.java | 298 +++++++++ .../bartworks/common/ConfigHandler.java | 34 -- .../bartworks/common/blocks/BW_Blocks.java | 68 ++- .../bartworks/common/blocks/BW_GlasBlocks.java | 65 ++ .../common/blocks/BW_TileEntityContainer.java | 41 +- .../bartworks/common/blocks/BioFluidBlock.java | 98 +++ .../bartworks/common/configs/ConfigHandler.java | 65 ++ .../bartworks/common/items/BW_ItemBlocks.java | 36 +- .../bartworks/common/items/BW_Stonage_Rotors.java | 42 +- .../bartworks/common/items/Circuit_Programmer.java | 36 +- .../common/items/GT_Destructopack_Item.java | 31 +- .../bartworks/common/items/GT_Rockcutter_Item.java | 72 ++- .../bartworks/common/items/GT_Teslastaff_Item.java | 38 +- .../bartworks/common/items/LabModule.java | 46 ++ .../bartworks/common/items/LabParts.java | 135 +++++ .../bartworks/common/items/SimpleIconItem.java | 28 +- .../bartworks/common/items/SimpleSubItemClass.java | 52 +- .../bartworks/common/loaders/BioCultureLoader.java | 60 ++ .../bartworks/common/loaders/BioItemList.java | 140 +++++ .../bartworks/common/loaders/BioLabLoader.java | 42 ++ .../bartworks/common/loaders/BioRecipeLoader.java | 375 ++++++++++++ .../bartworks/common/loaders/FluidLoader.java | 85 +++ .../bartworks/common/loaders/GTNHBlocks.java | 96 +++ .../bartworks/common/loaders/ItemRegistry.java | 117 ++-- .../bartworks/common/loaders/LoaderRegistry.java | 34 +- .../bartworks/common/loaders/RecipeLoader.java | 190 +++--- .../bartworks/common/net/BW_Network.java | 128 ++++ .../bartworks/common/net/RendererPacket.java | 112 ++++ .../tileentities/BWTileEntityDimIDBridge.java | 28 + .../common/tileentities/BW_RotorBlock.java | 26 +- .../tileentities/GT_MetaTileEntity_BioLab.java | 263 ++++++++ .../tileentities/GT_MetaTileEntity_Diode.java | 29 +- .../GT_MetaTileEntity_EnergyDistributor.java | 26 +- .../tileentities/GT_MetaTileEntity_RadioHatch.java | 315 ++++++++++ .../common/tileentities/GT_TileEntity_BioVat.java | 674 +++++++++++++++++++++ .../common/tileentities/GT_TileEntity_DEHP.java | 23 +- .../common/tileentities/GT_TileEntity_LESU.java | 115 ++-- .../tileentities/GT_TileEntity_ManualTrafo.java | 295 +++++---- .../tileentities/GT_TileEntity_Windmill.java | 90 ++- .../server/container/BW_Container_RadioHatch.java | 216 +++++++ .../container/GT_Container_CircuitProgrammer.java | 83 ++- .../container/GT_Container_Item_Destructopack.java | 37 +- .../server/container/GT_Container_LESU.java | 22 + .../server/container/GT_Container_RadioHatch.java | 155 +++++ .../bartimaeusnek/bartworks/util/BWRecipes.java | 580 ++++++++++++++++++ .../bartimaeusnek/bartworks/util/BW_Util.java | 122 ++++ .../bartimaeusnek/bartworks/util/BioCulture.java | 189 ++++++ .../bartimaeusnek/bartworks/util/BioDNA.java | 63 ++ .../bartimaeusnek/bartworks/util/BioData.java | 171 ++++++ .../bartimaeusnek/bartworks/util/BioPlasmid.java | 62 ++ .../bartworks/util/ChatColorHelper.java | 22 + .../bartworks/util/ConnectedBlocksChecker.java | 129 ++-- .../bartimaeusnek/bartworks/util/Coords.java | 63 ++ .../bartworks/util/NEIbartworksConfig.java | 30 +- 71 files changed, 6866 insertions(+), 629 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/ConfigHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/BWTileEntityDimIDBridge.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_BioLab.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_MetaTileEntity_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/GT_TileEntity_BioVat.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java (limited to 'src/main/java/com') diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java new file mode 100644 index 0000000000..2767d56168 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +public final class API_REFERENCE { + public static final String VERSION = "@version@"; +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java new file mode 100644 index 0000000000..e0e332fab1 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +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.*; + +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); +// } + + /** + * @param color the color of the Culture + * @param name the name of the Culture + * @param plasmid the cultures plasmid, get it from createAndRegisterBioPlasmid + * @param dna the cultures dna, get it from createAndRegisterBioDNA + * @param breedable if the culture can be inserted into the BacterialVat + * @param rarity visual + * @return + */ + public static BioCulture createAndRegisterBioCulture(Color color, String name, BioPlasmid plasmid, BioDNA dna, EnumRarity rarity, boolean breedable) { + return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, rarity, breedable); + } + + /** + * rarity inherits from dna + * + * @param color the color of the Culture + * @param name the name of the Culture + * @param plasmid the cultures plasmid, get it from createAndRegisterBioPlasmid + * @param dna the cultures dna, get it from createAndRegisterBioDNA + * @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) { + return BioCulture.createAndRegisterBioCulture(color, name, plasmid, dna, breedable); + } + + /** + * unspecific Biodata that can be converted into DNA and Plasmid with the propper methodes + * + * @param aName the name of the Biodata + * @param rarity visual only + * @param chance the chanche to extract this BioData + * @param tier the tier of this BioData 0=HV, 1=EV etc. + * @return + */ + public static BioData createAndRegisterBioData(String aName, EnumRarity rarity, int chance, int tier) { + return BioData.createAndRegisterBioData(aName, rarity, chance, tier); + } + + /** + * Default Constructor for HV Tier DNA with 75% extraction rate + * + * @param aName Name of the DNA String + * @param rarity visual + * @return + */ + public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity) { + return BioDNA.createAndRegisterBioDNA(aName, rarity); + } + + /** + * Default Constructor for HV Tier Plasmid with 75% extraction rate + * + * @param aName Name of the Plasmid + * @param rarity visual + * @return + */ + public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity) { + return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity); + } + + /** + * @param aName Name of the DNA String + * @param rarity visual + * @param chance chanche of extracting + * @param tier tier needed to extract 0=HV, 1=EV etc. + * @return + */ + public static BioDNA createAndRegisterBioDNA(String aName, EnumRarity rarity, int chance, int tier) { + return BioDNA.createAndRegisterBioDNA(aName, rarity, chance, tier); + } + + /** + * @param aName Name of the Plasmid + * @param rarity visual + * @param chance chanche of extracting + * @param tier tier needed to extract 0=HV, 1=EV etc. + * @return + */ + public static BioPlasmid createAndRegisterBioPlasmid(String aName, EnumRarity rarity, int chance, int tier) { + return BioPlasmid.createAndRegisterBioPlasmid(aName, rarity, chance, tier); + } + + +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java new file mode 100644 index 0000000000..86ec61c138 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +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.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import java.util.Collection; + +public final class BioObjectGetter { + + public static BioCulture getBioCulture(String aName) { + return BioCulture.getBioCulture(aName); + } + + public static NBTTagCompound getNBTTagFromCulture(BioCulture bioCulture) { + return BioCulture.getNBTTagFromCulture(bioCulture); + } + + public static NBTTagCompound getNBTTagFromBioPlasmid(BioPlasmid bioPlasmid) { + return getNBTTagFromBioData(convertBioPlasmidToData(bioPlasmid)); + } + + public static NBTTagCompound getNBTTagFromBioDNA(BioDNA bioDNA) { + return getNBTTagFromBioData(convertBioDNAtoData(bioDNA)); + } + + public static NBTTagCompound getNBTTagFromBioData(BioData bioData) { + return BioData.getNBTTagFromBioData(bioData); + } + + public static BioDNA convertDataToDNA(BioData bioData) { + return BioDNA.convertDataToDNA(bioData); + } + + public static BioPlasmid convertDataToPlasmid(BioData bioData) { + return BioPlasmid.convertDataToPlasmid(bioData); + } + + public static BioData convertBioPlasmidToData(BioPlasmid bioPlasmid) { + return BioData.convertBioPlasmidToBioData(bioPlasmid); + } + + public static BioData convertDataToDNA(BioDNA bioData) { + return BioData.convertBioDNAToBioData(bioData); + } + + public static BioData convertBioDNAtoData(BioDNA bioDNA) { + return BioData.convertBioDNAToBioData(bioDNA); + } + + public static BioPlasmid convertBioDNAtoBioPlasmid(BioDNA bioDNA) { + return convertDataToPlasmid(convertBioDNAtoData(bioDNA)); + } + + public static BioDNA convertBioPlasmidtoBioDNA(BioPlasmid bioPlasmid) { + return convertDataToDNA(convertBioPlasmidToData(bioPlasmid)); + } + + public static Collection getAllPetriDishes() { + return BioItemList.getAllPetriDishes(); + } + + public static Collection getAllDNASampleFlasks() { + return BioItemList.getAllDNASampleFlasks(); + } + + public static Collection getAllPlasmidCells() { + return BioItemList.getAllPlasmidCells(); + } + + public static ItemStack getDNASampleFlask(BioDNA dna) { + return BioItemList.getDNASampleFlask(dna); + } + + public static ItemStack getPetriDish(BioCulture culture) { + return BioItemList.getPetriDish(culture); + } + + public static ItemStack getPlasmidCell(BioPlasmid plasmid) { + return BioItemList.getPlasmidCell(plasmid); + } + + /** + * 1 - DetergentPowder + * 2 - Agarose + * 3 - IncubationModule + * 4 - Plasma Membrane + * + * @param selection + * @return the selected Item + */ + 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 new file mode 100644 index 0000000000..0f81d266f0 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.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; + +public final class BioRecipeAdder { + + public static final int STANDART = 0; + public static final int LOWGRAVITY = -100; + public static final int CLEANROOM = -200; + + public static boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, Object 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); + } + + /** + * Adds a Incubation Recipe for the BioLab. + * + * @param aInput any item that will be added with a petri dish + * @param aOutput must be a BioCulture + * @param aChances + * @param aFluidInputs + * @param aDuration + * @param aEUt use BW_Util.getMachineVoltageFromTier(tier) to get optimal EU/t + * @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); + } + + /** + * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can be null + * @param aCulture the bio culture + * @param aFluidInputs may not be null + * @param aFluidOutputs may not be null + * @param aDuration + * @param aEUt + * @param Sv Manual Sv entry i.e. for custom items + * @param glasTier the glass tier + * @param aSpecialValue Space or Cleanroom, Not yet implemented + * @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); + } + + /** + * @param aInputs Item Inputs, DO NOT PUT INTEGRATED CIRCUITS IN HERE! THEY WILL GET ADDED AUTOMATICALLY!, can be null + * @param aCulture the bio culture + * @param aFluidInputs may not be null + * @param aFluidOutputs may not be null + * @param aDuration + * @param aEUt + * @param material may be null. used for auto Sv calculation + * @param glasTier the glass tier + * @param aSpecialValue Space or Cleanroom, Not yet implemented + * @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, 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 new file mode 100644 index 0000000000..483b4a67e2 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.API; + +import com.github.bartimaeusnek.bartworks.MainMod; +import gregtech.api.enums.Materials; +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.Iterator; +import java.util.Objects; + +import static cpw.mods.fml.common.registry.GameRegistry.findBlock; + +public final class BioVatLogicAdder { + + + public static class RadioHatch { + + private static final HashSet MaSv = new HashSet<>(); + private static final HashMap IsSv = new HashMap<>(); + + public static HashSet getMaSv() { + return RadioHatch.MaSv; + } + + public static HashMap getIsSv() { + return RadioHatch.IsSv; + } + + public static void setOverrideSvForMaterial(Materials m, Integer sv) { + MaSv.add(new BioVatLogicAdder.MaterialSvPair(m, sv)); + } + + public static void giveItemStackRadioHatchAbilites(ItemStack stack, Integer sv) { + IsSv.put(stack, sv); + } + + public static int getMaxSv() { + int ret = 150; + Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); + while (it.hasNext()) { + BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + if (pair.getSievert() > ret) + ret = pair.getSievert(); + } + for (ItemStack is : RadioHatch.IsSv.keySet()) { + if (RadioHatch.IsSv.get(is) > ret) + ret = RadioHatch.IsSv.get(is); + } + return ret; + } + + } + + public static class BioVatGlass { + + private static final HashMap glasses = new HashMap<>(); + + /** + * @param sModname The modid owning the block + * @param sUnlocBlockName The name of the block itself + * @param meta The meta of the block + * @param tier the glasses Tier = Voltage tier (MIN 3) + * @return if the block was found in the Block registry + */ + 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); + else + MainMod.logger.warn("Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!"); + block = null; + return ret; + } + + /** + * @param block the block to add + * @param meta the meta of the block (0-15) + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(@Nonnull Block block, @Nonnegative int meta, @Nonnegative int tier) { + BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) meta), (byte) tier); + } + + /** + * @param block the block to add + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(@Nonnull Block block, @Nonnegative int tier) { + BioVatGlass.glasses.put(new BlockMetaPair(block, (byte) 0), (byte) tier); + } + + /** + * @param blockBytePair the block to add and its meta as a javafx.util Pair + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(@Nonnull BlockMetaPair blockBytePair, @Nonnegative byte tier) { + BioVatGlass.glasses.put(blockBytePair, tier); + } + + public static HashMap getGlassMap() { + return BioVatGlass.glasses; + } + } + + public static class MaterialSvPair { + final Materials materials; + final Integer sievert; + + public MaterialSvPair(Materials materials, Integer sievert) { + this.materials = materials; + this.sievert = sievert; + } + + @Override + public boolean equals(Object o) { + 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()); + } + + @Override + public int hashCode() { + return Objects.hash(this.getMaterials(), this.getSievert()); + } + + public Materials getMaterials() { + return this.materials; + } + + public Integer getSievert() { + return this.sievert; + } + + + } + + public static class BlockMetaPair { + final Block block; + final Byte aByte; + + public BlockMetaPair(Block block, Byte aByte) { + this.block = block; + this.aByte = aByte; + } + + @Override + public boolean equals(Object o) { + 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()); + } + + @Override + public int hashCode() { + return Objects.hash(this.getBlock(), this.getaByte()); + } + + public Block getBlock() { + return this.block; + } + + public Byte getaByte() { + return this.aByte; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 7d2f2d4628..f45ac86579 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,10 +1,35 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.gui.BW_GUIContainer_RadLevel; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.client.gui.GT_GUIContainer_Destructopack; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_CircuitProgrammer; import com.github.bartimaeusnek.bartworks.server.container.GT_Container_Item_Destructopack; import cpw.mods.fml.common.network.IGuiHandler; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; @@ -12,18 +37,34 @@ public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID){ - case 0: return new GT_Container_Item_Destructopack(player.inventory); - case 1: return new GT_Container_CircuitProgrammer(player.inventory); + switch (ID) { + case 0: + return new GT_Container_Item_Destructopack(player.inventory); + case 1: + return new GT_Container_CircuitProgrammer(player.inventory); + case 2: { + if (world.getTileEntity(x, y, z) instanceof IGregTechTileEntity) { + IGregTechTileEntity te = (IGregTechTileEntity) world.getTileEntity(x, y, z); + return new BW_Container_RadioHatch(player.inventory, te.getMetaTileEntity()); + } + } } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - switch (ID){ - case 0: return new GT_GUIContainer_Destructopack(player.inventory); - case 1: return new GT_GUIContainer_CircuitProgrammer(player.inventory); + switch (ID) { + case 0: + return new GT_GUIContainer_Destructopack(player.inventory); + case 1: + return new GT_GUIContainer_CircuitProgrammer(player.inventory); + 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 null; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 0219ef93bd..c2a42579df 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,13 +1,35 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks; +import com.github.bartimaeusnek.bartworks.client.creativetabs.BioTab; import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; -import com.github.bartimaeusnek.bartworks.common.ConfigHandler; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_TileEntityContainer; +import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.LoaderRegistry; -import com.github.bartimaeusnek.bartworks.common.tileentities.BW_RotorBlock; -import com.github.bartimaeusnek.bartworks.common.tileentities.GT_TileEntity_Windmill; +import com.github.bartimaeusnek.bartworks.common.net.BW_Network; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -15,51 +37,59 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import static com.github.bartimaeusnek.bartworks.API.API_REFERENCE.VERSION; + @Mod( modid = MainMod.modID, name = MainMod.name, version = MainMod.version, - dependencies = "required-after:IC2; " - + "required-after:gregtech; " - ) + dependencies = "required-after:IC2; " + + "required-after:gregtech; " +) public final class MainMod { public static final String name = "BartWorks"; public static final String version = "@version@"; public static final String modID = "bartworks"; public static final Logger logger = LogManager.getLogger(name); - public static boolean GTNH = false; public static final CreativeTabs GT2 = new GT2Tab("GT2C"); + public static final CreativeTabs BioTab = new BioTab("BioTab"); public static final CreativeTabs BWT = new bartworksTab("bartworks"); public static final IGuiHandler GH = new GuiHandler(); + public static boolean GTNH = false; @Mod.Instance(modID) public static MainMod instance; public static ConfigHandler CHandler; - + public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - if(Loader.isModLoaded("dreamcraft")) { + if (!(VERSION.equals(version))) { + logger.error("Something has loaded an old API. Please contact the Mod authors to update!"); + } + + if (Loader.isModLoaded("dreamcraft")) { GTNH = true; } - CHandler= new ConfigHandler(preinit); + CHandler = new ConfigHandler(preinit); if (GTNH) logger.info("GTNH-Detected . . . ACTIVATE HARDMODE."); + } + @Mod.EventHandler public void init(FMLInitializationEvent init) { - new LoaderRegistry().run(); + new LoaderRegistry().run(); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent postinit) { - NetworkRegistry.INSTANCE.registerGuiHandler(instance,GH); + NetworkRegistry.INSTANCE.registerGuiHandler(instance, GH); + if (ConfigHandler.BioLab) + new GTNHBlocks().run(); } - } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java new file mode 100644 index 0000000000..2057052be3 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.creativetabs; + +import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class BioTab extends CreativeTabs { + + public BioTab(String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return BioItemList.getPetriDish(null).getItem(); + } +} diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 82188db9c5..1d403a93d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.creativetabs; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -6,7 +28,7 @@ import net.minecraft.item.Item; public class GT2Tab extends CreativeTabs { - public GT2Tab (String lable) { + public GT2Tab(String lable) { super(lable); } 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 30449b88de..f3e5e15882 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 @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.creativetabs; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -6,7 +28,7 @@ import net.minecraft.item.Item; public class bartworksTab extends CreativeTabs { - public bartworksTab (String lable) { + public bartworksTab(String lable) { super(lable); } 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 new file mode 100644 index 0000000000..91dfa14c28 --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.client.gui; + +import com.github.bartimaeusnek.bartworks.MainMod; +import com.github.bartimaeusnek.bartworks.server.container.BW_Container_RadioHatch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class BW_GUIContainer_RadLevel extends GuiContainer { + final BW_Container_RadioHatch container; + + public BW_GUIContainer_RadLevel(Container p_i1072_1_) { + super(p_i1072_1_); + container = (BW_Container_RadioHatch) p_i1072_1_; + } + + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { + GL11.glColor3f(1, 1, 1); + this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_RSC.png")); + drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); + } + + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + int y = 51 + (container.coverage / 2 - 3); + int x = -63; + if (container.coverage != 100 && container.coverage != 0) + drawRect(x, y, x + 51, y + 1, 0xFF60D82E); + drawRect(x, 48, x + 51, y, 0xFF8B8B8B); + this.fontRendererObj.drawString(Byte.toString(container.coverage), 88 - 79, 50, 16448255); + } +} 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 1311c291ac..61b87019e3 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 @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -11,8 +33,7 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator -{ +public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator { public ContainerWindKineticGenerator container; public String name; @@ -42,7 +63,7 @@ public class BW_GUIContainer_RotorBlock extends GuiWindKineticGenerator } protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GL11.glColor3f(0.5f,0.25f,0.07f); + GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUIPrimitiveKUBox.png")); int j = (this.width - this.xSize) / 2; int k = (this.height - this.ySize) / 2; 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 76cd7d2998..09dec26e2b 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 @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -13,30 +35,31 @@ public class BW_GUIContainer_Windmill extends GT_GUIContainer_MultiMachine { public BW_GUIContainer_Windmill(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { super(aInventoryPlayer, aTileEntity, aName, null); } + protected void drawGuiContainerForegroundLayer(int par1, int par2) { if (!(this.mContainer instanceof GT_Container_MultiMachine)) return; - if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 64) != 0) + if ((((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) this.fontRendererObj.drawString(this.trans("138", "Incomplete Structure."), 92, 22, 16448255); } protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor3f(0.5f,0.25f,0.07f); + GL11.glColor3f(0.5f, 0.25f, 0.07f); this.mc.getTextureManager().bindTexture(new ResourceLocation(MainMod.modID, "textures/GUI/GUI_Windmill.png")); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer.mMaxProgressTime > 0){ - this.drawTexturedModalRect(x+152, y+5,176,0,16,15); - this.drawTexturedModalRect(x+53, y+63,176,16,13,17); + if (this.mContainer.mMaxProgressTime > 0) { + this.drawTexturedModalRect(x + 152, y + 5, 176, 0, 16, 15); + this.drawTexturedModalRect(x + 53, y + 63, 176, 16, 13, 17); } - if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) { + if (((GT_Container_MultiMachine) this.mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachine) this.mContainer).mActive == 0) { - GL11.glColor3f(1f,1f,1f); - this.drawTexturedModalRect(x+66, y+66,176,33,15,15); + GL11.glColor3f(1f, 1f, 1f); + this.drawTexturedModalRect(x + 66, y + 66, 176, 33, 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 d511369435..2a699035f4 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 @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -10,14 +32,16 @@ import org.lwjgl.opengl.GL11; public class GT_GUIContainer_CircuitProgrammer extends GuiContainer { + public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + public GT_GUIContainer_CircuitProgrammer(InventoryPlayer p_i1072_1_) { super(new GT_Container_CircuitProgrammer(p_i1072_1_)); } - public static final ResourceLocation texture = new ResourceLocation(MainMod.modID, "textures/GUI/GUI_CircuitP.png"); + @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1F, 1F, 1F, 1F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft-79, guiTop, 0, 0, 256, 165); + drawTexturedModalRect(guiLeft - 79, guiTop, 0, 0, 256, 165); } } 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 68e2516979..feaf22fcc1 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 @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.gui; import com.github.bartimaeusnek.bartworks.MainMod; @@ -8,12 +30,12 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -public class GT_GUIContainer_Destructopack extends GuiContainer -{ +public class GT_GUIContainer_Destructopack extends GuiContainer { + public static final