From 55a6ac375cd21584aef3d38e4770d9961f2bddb3 Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:24:31 +0100 Subject: Bartworks cleaning (#2951) * Remove added by bartworks from every single item * Fix germanglish * Works * Clean up a little * Ok, spiralled a little but hopefully worth it... * Spotless * Less "added by" * Clean up tooltips somewhat * more cleanups * Bit more cleaning * Spotless * Reduce random glass crap * Get rid of destructopack (useless) * Magneto work * Further refactor/cleanup * Move Boro tags to materials * Attempt fix * No longer needed * Go away * Rename * Remove dead recipes * Spotless apply for branch bartTooltips for #2951 (#2952) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Add warded glass to HV * remove ignored --------- Co-authored-by: Connor Colenso Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz Co-authored-by: boubou19 --- .../bartworks/API/BioVatLogicAdder.java | 87 ---- .../bartworks/API/BorosilicateGlass.java | 4 +- .../bartimaeusnek/bartworks/API/GlassTier.java | 78 ++++ .../ASM/BWCoreStaticReplacementMethodes.java | 1 - .../github/bartimaeusnek/bartworks/MainMod.java | 40 +- .../client/ClientEventHandler/TooltipCache.java | 53 --- .../ClientEventHandler/TooltipEventHandler.java | 112 +---- .../bartworks/common/configs/ConfigHandler.java | 8 +- .../bartworks/common/items/BW_ItemBlocks.java | 15 +- .../bartworks/common/items/BW_SimpleWindMeter.java | 2 - .../bartworks/common/items/BW_Stonage_Rotors.java | 2 - .../bartworks/common/items/Circuit_Programmer.java | 2 - .../common/items/GT_Destructopack_Item.java | 90 ---- .../bartworks/common/items/GT_Rockcutter_Item.java | 2 - .../bartworks/common/items/GT_Teslastaff_Item.java | 2 - .../bartworks/common/items/SimpleSubItemClass.java | 8 - .../bartworks/common/loaders/BeforeGTPreload.java | 129 ------ .../bartworks/common/loaders/GTNHBlocks.java | 145 ------- .../bartworks/common/loaders/ItemRegistry.java | 8 +- .../common/loaders/RegisterGlassTiers.java | 118 ++++++ .../common/loaders/recipes/CraftingRecipes.java | 14 - .../multis/GT_TileEntity_CircuitAssemblyLine.java | 19 +- .../tiered/GT_MetaTileEntity_Diode.java | 18 +- .../GT_MetaTileEntity_EnergyDistributor.java | 16 +- .../material/BW_MetaGeneratedBlock_Item.java | 10 - .../system/material/BW_MetaGenerated_Items.java | 10 - .../CircuitGeneration/BW_CircuitsLoader.java | 16 +- .../material/CircuitGeneration/BW_Meta_Items.java | 150 ++----- .../CircuitGeneration/CircuitImprintLoader.java | 12 +- .../CircuitGeneration/CircuitPartLoader.java | 6 +- .../material/GT_Enhancement/BWGTMetaItems.java | 2 - .../processingLoaders/AdditionalRecipes.java | 457 +++++++-------------- .../bartimaeusnek/bartworks/util/BW_ColorUtil.java | 4 - .../bartworks/util/BW_Tooltip_Reference.java | 15 +- .../bartimaeusnek/bartworks/util/BW_Util.java | 56 +-- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 7 +- .../galacticraft/blocks/UniversalSpaceBlocks.java | 38 -- .../galacticraft/creativetabs/SpaceTab.java | 37 -- .../tiered/TT_MetaTileEntity_LowPowerLaserBox.java | 2 +- .../TT_MetaTileEntity_LowPowerLaserDynamo.java | 16 +- .../TT_MetaTileEntity_LowPowerLaserHatch.java | 16 +- .../crossmod/thaumcraft/Research.java | 3 +- src/main/java/gregtech/api/enums/Materials.java | 2 + 43 files changed, 460 insertions(+), 1372 deletions(-) create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/API/GlassTier.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java delete mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java create mode 100644 src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterGlassTiers.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java (limited to 'src/main/java') 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 b53638a77a..4e1728fccd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -13,17 +13,12 @@ package com.github.bartimaeusnek.bartworks.API; -import static cpw.mods.fml.common.registry.GameRegistry.findBlock; import static gregtech.api.enums.Mods.IndustrialCraft2; import java.util.HashMap; import java.util.HashSet; import java.util.Objects; -import javax.annotation.Nonnegative; -import javax.annotation.Nonnull; - -import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; @@ -207,57 +202,6 @@ public final class BioVatLogicAdder { } } - 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 new IllegalArgumentException( - "Block: " + sUnlocBlockName + " of the Mod: " + sModname + " was NOT found!").printStackTrace(); - 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; @@ -291,35 +235,4 @@ public final class BioVatLogicAdder { } } - 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; - } - } } 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 eb4c2a0405..aca6b16330 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BorosilicateGlass.java @@ -47,14 +47,14 @@ public class BorosilicateGlass { return tier > 0 && tier <= Byte.MAX_VALUE; } - private static Block getGlassBlock() { + public static Block getGlassBlock() { if (block == null) { block = GameRegistry.findBlock(BartWorks.ID, "BW_GlasBlocks"); } return block; } - private static Block getGlassBlock2() { + public static Block getGlassBlock2() { if (block2 == null) { block2 = GameRegistry.findBlock(BartWorks.ID, "BW_GlasBlocks2"); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/GlassTier.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/GlassTier.java new file mode 100644 index 0000000000..7a9493914a --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/GlassTier.java @@ -0,0 +1,78 @@ +package com.github.bartimaeusnek.bartworks.API; + +import static cpw.mods.fml.common.registry.GameRegistry.findBlock; + +import java.util.HashMap; +import java.util.Objects; + +import net.minecraft.block.Block; + +import org.jetbrains.annotations.NotNull; + +public class GlassTier { + + private static final HashMap glasses = new HashMap<>(); + + /** + * @param modname The modid owning the block + * @param unlocalisedBlockName The name of the block itself + * @param meta The meta of the block + * @param tier the glasses Tier = Voltage tier (MIN 3) + */ + public static void addCustomGlass(String modname, String unlocalisedBlockName, int meta, int tier) { + Block block = findBlock(modname, unlocalisedBlockName); + if (block != null) { + addCustomGlass(block, meta, tier); + } else { + new IllegalArgumentException( + "Block: " + unlocalisedBlockName + + " of the Mod: " + + modname + + " was NOT found when attempting to register a glass!").printStackTrace(); + } + } + + public static void addCustomGlass(@NotNull Block block, int meta, int tier) { + GlassTier.glasses.put(new BlockMetaPair(block, (byte) meta), tier); + } + + public static HashMap getGlassMap() { + return glasses; + } + + public static int getGlassTier(Block block, int meta) { + return glasses.getOrDefault(new BlockMetaPair(block, (byte) meta), 0); + } + + public static class BlockMetaPair { + + private final Block block; + private final int meta; + + public BlockMetaPair(Block block, int aByte) { + this.block = block; + this.meta = aByte; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + BlockMetaPair that = (BlockMetaPair) o; + return Objects.equals(this.getBlock(), that.getBlock()) && Objects.equals(this.getMeta(), that.getMeta()); + } + + @Override + public int hashCode() { + return Objects.hash(this.getBlock(), this.getMeta()); + } + + public Block getBlock() { + return this.block; + } + + public int getMeta() { + return this.meta; + } + } +} 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 38a5a70d27..8802105563 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/ASM/BWCoreStaticReplacementMethodes.java @@ -109,5 +109,4 @@ public class BWCoreStaticReplacementMethodes { return stack; } - private BWCoreStaticReplacementMethodes() {} } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index 30c1276f97..6526eafe4b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -15,14 +15,11 @@ 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 static gregtech.api.enums.Mods.BartWorks; 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; @@ -38,15 +35,15 @@ import com.github.bartimaeusnek.bartworks.client.creativetabs.GT2Tab; import com.github.bartimaeusnek.bartworks.client.creativetabs.bartworksTab; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; +import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.ArtificialMicaLine; -import com.github.bartimaeusnek.bartworks.common.loaders.BeforeGTPreload; import com.github.bartimaeusnek.bartworks.common.loaders.BioCultureLoader; import com.github.bartimaeusnek.bartworks.common.loaders.BioLabLoader; -import com.github.bartimaeusnek.bartworks.common.loaders.GTNHBlocks; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; import com.github.bartimaeusnek.bartworks.common.loaders.LocalisationLoader; import com.github.bartimaeusnek.bartworks.common.loaders.RadioHatchMaterialLoader; import com.github.bartimaeusnek.bartworks.common.loaders.RecipeLoader; +import com.github.bartimaeusnek.bartworks.common.loaders.RegisterGlassTiers; import com.github.bartimaeusnek.bartworks.common.loaders.RegisterServerCommands; import com.github.bartimaeusnek.bartworks.common.loaders.StaticRecipeChangeLoaders; import com.github.bartimaeusnek.bartworks.common.net.BW_Network; @@ -72,12 +69,12 @@ import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameRegistry; import gregtech.GT_Version; import gregtech.api.GregTech_API; import gregtech.api.enums.Mods; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResultRegistry; -import gregtech.api.util.GT_OreDictUnificator; @Mod(modid = MainMod.MOD_ID, name = MainMod.NAME, version = GT_Version.VERSION, dependencies = """ required-after:IC2;\ @@ -107,13 +104,16 @@ public final class MainMod { public static BW_Network BW_Network_instance = new BW_Network(); public MainMod() { - GregTech_API.sBeforeGTPreload.add(new BeforeGTPreload()); + } @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { MainMod.LOGGER.info("Found GT++, continuing"); + GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BW_ItemBlocks.class, "BW_GlasBlocks"); + GameRegistry.registerBlock(ItemRegistry.bw_glasses[1], BW_ItemBlocks.class, "BW_GlasBlocks2"); + if (API_ConfigValues.debugLog) { try { DebugLog.initDebugLog(preinit); @@ -124,9 +124,7 @@ public final class MainMod { WerkstoffLoader.setUp(); - if (ConfigHandler.BioLab) { - BioCultureLoader.run(); - } + BioCultureLoader.run(); Werkstoff.init(); GregTech_API.sAfterGTPostload.add(new CircuitPartLoader()); @@ -134,6 +132,7 @@ public final class MainMod { GregTech_API.sBeforeGTLoad.add(new PrefixTextureLinker()); } + RegisterGlassTiers.run(); } @Mod.EventHandler @@ -147,9 +146,7 @@ public final class MainMod { FMLCommonHandler.instance() .bus() .register(serverEventHandler); - if (ConfigHandler.BioLab) { - BioLabLoader.run(); - } + BioLabLoader.run(); WerkstoffLoader.runInit(); @@ -162,20 +159,7 @@ public final class MainMod { RecipeLoader.run(); NetworkRegistry.INSTANCE.registerGuiHandler(MainMod.instance, MainMod.GH); - if (ConfigHandler.BioLab) { - GTNHBlocks.run(); - for (Map.Entry pair : BioVatLogicAdder.BioVatGlass.getGlassMap() - .entrySet()) { - GT_OreDictUnificator.registerOre( - "blockGlass" + VN[pair.getValue()], - new ItemStack( - pair.getKey() - .getBlock(), - 1, - pair.getKey() - .getaByte())); - } - } + ArtificialMicaLine.runArtificialMicaRecipe(); BioObjectAdder.regenerateBioFluids(); @@ -219,8 +203,6 @@ public final class MainMod { if (classicMode) DownTierLoader.run(); - // StaticRecipeChangeLoaders.patchEBFMapForCircuitUnification(); - recipesAdded = true; } 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 deleted file mode 100644 index 969398df47..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2018-2020 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.ClientEventHandler; - -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; - -import com.github.bartimaeusnek.bartworks.util.Pair; - -class TooltipCache { - - private static final HashMap, char[]> cache = new HashMap<>(); - - static boolean put(ItemStack itemStack, List tooltip) { - Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - if (TooltipCache.cache.containsKey(p) || tooltip.isEmpty()) { - return false; - } - StringBuilder sb = new StringBuilder(); - for (String s : tooltip) { - sb.append(s); - sb.append(System.lineSeparator()); - } - char[] rettype = sb.toString() - .toCharArray(); - return TooltipCache.cache.put(p, rettype) == rettype; - } - - static List getTooltip(ItemStack itemStack) { - Pair p = new Pair<>(Item.getIdFromItem(itemStack.getItem()), (short) itemStack.getItemDamage()); - char[] toTest = TooltipCache.cache.get(p); - if (toTest == null) { - return new ArrayList<>(); - } - return Arrays.asList(new String(toTest).split(System.lineSeparator())); - } -} 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 0f7cb58bae..edf9b7f07f 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 @@ -1,48 +1,17 @@ -/* - * Copyright (c) 2018-2020 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.ClientEventHandler; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; +import static gregtech.api.util.GT_Utility.getColoredTierNameFromTier; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.common.blocks.BW_Blocks; -import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; -import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.Pair; -import com.github.bartimaeusnek.crossmod.BartWorksCrossmod; +import com.github.bartimaeusnek.bartworks.API.GlassTier; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -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; @SideOnly(Side.CLIENT) public class TooltipEventHandler { @@ -53,75 +22,16 @@ public class TooltipEventHandler { if (event == null || event.itemStack == null || event.itemStack.getItem() == null) return; - if (TooltipCache.getTooltip(event.itemStack) - .isEmpty()) { - ItemStack tmp = event.itemStack.copy(); - Pair abstractedStack = new Pair<>( - Item.getIdFromItem(tmp.getItem()), - (short) tmp.getItemDamage()); - List tooAdd = new ArrayList<>(); - if (ConfigHandler.sharedItemStackTooltip && OreDictHandler.getNonBWCache() - .contains(abstractedStack)) { - for (Pair 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 (MainMod.MOD_ID.equals(UI.modId) || BartWorksCrossmod.MOD_ID.equals(UI.modId) - || "BWCore".equals(UI.modId)) break; - if (UI.modId.equals(modContainer.getModId())) { - tooAdd.add( - "Shared ItemStack between " + EnumChatFormatting.DARK_GREEN - + "BartWorks" - + EnumChatFormatting.GRAY - + " and " - + EnumChatFormatting.RED - + modContainer.getName()); - } - } - } else tooAdd.add( - "Shared ItemStack between " + EnumChatFormatting.DARK_GREEN - + "BartWorks" - + EnumChatFormatting.GRAY - + " and another Mod, that doesn't use the ModContainer propperly!"); - } - } - } + final Block block = Block.getBlockFromItem(event.itemStack.getItem()); + final int meta = event.itemStack.getItemDamage(); + + int tier = GlassTier.getGlassTier(block, meta); + + if (tier == 0) return; - Block BLOCK = Block.getBlockFromItem(event.itemStack.getItem()); - if (BLOCK != null && BLOCK != Blocks.air) { - if (BLOCK instanceof BW_Blocks) { - TooltipCache.put(event.itemStack, tooAdd); - return; - } - BioVatLogicAdder.BlockMetaPair PAIR = new BioVatLogicAdder.BlockMetaPair( - BLOCK, - (byte) event.itemStack.getItemDamage()); - HashMap 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] - + EnumChatFormatting.RESET); - } else if (BLOCK.getMaterial() - .equals(Material.glass)) { - tooAdd.add( - StatCollector.translateToLocal("tooltip.glas.0.name") + " " - + BW_ColorUtil.getColorForTier(3) - + GT_Values.VN[3] - + EnumChatFormatting.RESET); - } - } + event.toolTip.add( + StatCollector.translateToLocal("tooltip.glass_tier.0.name") + " " + + getColoredTierNameFromTier((byte) tier)); - TooltipCache.put(event.itemStack, tooAdd); - event.toolTip.addAll(tooAdd); - } else { - event.toolTip.addAll(TooltipCache.getTooltip(event.itemStack)); - } } } 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 27cf0f4fe6..0b6a131341 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 @@ -40,7 +40,6 @@ public class ConfigHandler { public static long energyPerCell = 1000000L; - public static boolean BioLab = true; public static boolean Ross128Enabled = true; public static boolean disableExtraGassesForEBF; @@ -135,12 +134,7 @@ public class ConfigHandler { false, "Enables the Teslastaff, an Item used to destroy Electric Armors") .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", 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 f512e778bc..e575dfb269 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 @@ -22,17 +22,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.API.ITileAddsInformation; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; public class BW_ItemBlocks extends ItemBlock { @@ -62,20 +57,12 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) 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]); - } + 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); - - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override 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 0b589bf53a..32c521117b 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 @@ -24,7 +24,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; 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; @@ -55,7 +54,6 @@ public class BW_SimpleWindMeter extends Item { + (this.getMaxDamage() - this.getDamage(itemStack)) + "/" + this.getMaxDamage()); - list.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override 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 f58ae8d6e7..eb3b251706 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 @@ -28,7 +28,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; 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; @@ -94,7 +93,6 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { if (type != null) { info.add(StatCollector.translateToLocal("ic2.itemrotor.fitsin." + this.isAcceptedType(itemStack, type))); } - info.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override 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 59332b17a2..fd36b603d2 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 @@ -26,7 +26,6 @@ import net.minecraft.world.World; import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; @@ -80,7 +79,6 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem + (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()); } @Override 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 deleted file mode 100644 index 37ecfc61d2..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.items; - -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 com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures; -import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; -import com.gtnewhorizons.modularui.api.ModularUITextures; -import com.gtnewhorizons.modularui.api.forge.ItemStackHandler; -import com.gtnewhorizons.modularui.api.screen.IItemWithModularUI; -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; -import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.items.GT_Generic_Item; - -public class GT_Destructopack_Item extends GT_Generic_Item implements IItemWithModularUI { - - public GT_Destructopack_Item() { - super("GT2Destructopack", "Destructopack", "Mobile Trash Bin"); - this.setMaxStackSize(1); - this.setNoRepair(); - this.setHasSubtypes(false); - this.setCreativeTab(MainMod.GT2); - } - - @Override - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - super.addInformation(aStack, aPlayer, aList, aF3_H); - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); - } - - @Override - public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { - GT_UIInfos.openPlayerHeldItemUI(aPlayer); - return aStack; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aIconRegister) { - this.mIcon = aIconRegister.registerIcon("bartworks:gt.GT2Destructopack"); - } - - @Override - public ModularWindow createWindow(UIBuildContext buildContext, ItemStack heldStack) { - ModularWindow.Builder builder = ModularWindow.builder(176, 166); - builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); - builder.bindPlayerInventory(buildContext.getPlayer()); - - builder.widget(new SlotWidget(new BaseSlot(new ItemStackHandler(), 0) { - - @Override - public void putStack(ItemStack stack) { - this.onSlotChanged(); - } - }).setBackground(ModularUITextures.ITEM_SLOT, BW_UITextures.OVERLAY_SLOT_CROSS) - .setPos(79, 16)) - .widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_GT_LOGO_17x17_TRANSPARENT) - .setSize(17, 17) - .setPos(152, 63)); - - return builder.build(); - } -} 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 3a132dde22..1fb3e42910 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 @@ -34,7 +34,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; @@ -74,7 +73,6 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { @Override 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]); - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override 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 6728a791e4..9c68f093d7 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 @@ -30,7 +30,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import com.github.bartimaeusnek.bartworks.MainMod; -import com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference; import com.google.common.collect.Sets; import cpw.mods.fml.relauncher.Side; @@ -63,7 +62,6 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { @Override public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); } @Override 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 8d5b239a75..b482d14f1a 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 @@ -17,13 +17,11 @@ import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; 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; @@ -50,12 +48,6 @@ public class SimpleSubItemClass extends Item { } } - @Override - public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); - aList.add(BW_Tooltip_Reference.ADDED_BY_BARTWORKS.get()); - } - @Override public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < this.tex.length; i++) { 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 deleted file mode 100644 index 61df90e5d4..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.loaders; - -import static gregtech.api.enums.Mods.BartWorks; - -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 com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.LoadController; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.api.enums.SubTag; -import ic2.core.Ic2Items; - -/** - * This class gets injected into GT via ASM! DO NOT CALL IT YOURSELF! - */ -public class BeforeGTPreload implements Runnable { - - private static boolean didrun; - - @Override - public void run() { - 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; - ModContainer gregtech = Loader.instance() - .activeModContainer(); - boolean switchback = false; - LoadController modController = null; - if (!Loader.instance() - .activeModContainer() - .getModId() - .equals(BartWorks.ID)) { - Field fieldModController = FieldUtils.getDeclaredField(Loader.class, "modController", true); - try { - modController = (LoadController) fieldModController.get(Loader.instance()); - } catch (IllegalAccessException e) { - e.printStackTrace(); - FMLCommonHandler.instance() - .exitJava(-1, true); - } - - assert modController != null; - for (ModContainer mod : modController.getActiveModList()) { - if (mod.getModId() - .equals(BartWorks.ID)) { - bartworks = mod; - } - if (bartworks != null) break; - } - if (bartworks == null || gregtech == null) FMLCommonHandler.instance() - .exitJava(-1, true); - - try { - activeContainer.set(modController, bartworks); - } catch (IllegalAccessException e) { - e.printStackTrace(); - FMLCommonHandler.instance() - .exitJava(-1, true); - } - switchback = true; - } - - Block[] bw_glasses; - try { - 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"); - GameRegistry.registerBlock(bw_glasses[1], BW_ItemBlocks.class, "BW_GlasBlocks2"); - OreDictionary.registerOre("blockGlassHV", new ItemStack(Blocks.glass, 1, GT_Values.W)); - OreDictionary.registerOre("blockGlassHV", new ItemStack(bw_glasses[0], 1, 0)); - OreDictionary.registerOre("blockGlassEV", Ic2Items.reinforcedGlass); - OreDictionary.registerOre("blockGlassEV", new ItemStack(bw_glasses[0], 1, 1)); - OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 12)); - OreDictionary.registerOre("blockGlassIV", new ItemStack(bw_glasses[0], 1, 2)); - OreDictionary.registerOre("blockGlassLuV", new ItemStack(bw_glasses[0], 1, 3)); - OreDictionary.registerOre("blockGlassZPM", new ItemStack(bw_glasses[0], 1, 4)); - OreDictionary.registerOre("blockGlassUV", new ItemStack(bw_glasses[0], 1, 5)); - OreDictionary.registerOre("blockGlassUHV", new ItemStack(bw_glasses[0], 1, 13)); - OreDictionary.registerOre("blockGlassUEV", new ItemStack(bw_glasses[0], 1, 14)); - OreDictionary.registerOre("blockGlassUIV", new ItemStack(bw_glasses[0], 1, 15)); - OreDictionary.registerOre("blockGlassUMV", new ItemStack(bw_glasses[1], 1, 0)); - } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { - e.printStackTrace(); - FMLCommonHandler.instance() - .exitJava(-1, true); - } - if (switchback) { - try { - activeContainer.set(modController, gregtech); - } catch (IllegalAccessException e) { - e.printStackTrace(); - FMLCommonHandler.instance() - .exitJava(-1, true); - } - } - BeforeGTPreload.didrun = true; - } -} 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 deleted file mode 100644 index 977ebf19e0..0000000000 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package com.github.bartimaeusnek.bartworks.common.loaders; - -import static gregtech.api.enums.Mods.BloodArsenal; -import static gregtech.api.enums.Mods.Botania; -import static gregtech.api.enums.Mods.Botany; -import static gregtech.api.enums.Mods.Chisel; -import static gregtech.api.enums.Mods.EnderIO; -import static gregtech.api.enums.Mods.ExtraUtilities; -import static gregtech.api.enums.Mods.GalaxySpace; -import static gregtech.api.enums.Mods.HardcoreEnderExpansion; -import static gregtech.api.enums.Mods.IndustrialCraft2; -import static gregtech.api.enums.Mods.Minecraft; -import static gregtech.api.enums.Mods.Natura; -import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.enums.Mods.RandomThings; -import static gregtech.api.enums.Mods.TecTech; -import static gregtech.api.enums.Mods.TinkerConstruct; -import static gregtech.api.enums.Mods.Witchery; -import static gregtech.api.enums.Mods.ZTones; - -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; - -/** - * Autogenerated run file, script Created on Wed Jan 2 19:11:07 2019 by boubou_19 and bartimaeusnek Executed on - * 2019-01-03 02:08:43 modified by bartimaeusnek to only add blocks that mods are loaded modified by bartimaeusnek on - * 2020-03-22 00:20 to run statically modified by Quarri6343 on 2022-08-24 20:02 to add Botania Support - */ -public class GTNHBlocks { - - public static void run() { - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Minecraft.ID, "stained_glass", i, 3); - } - - BioVatLogicAdder.BioVatGlass.addCustomGlass(IndustrialCraft2.ID, "blockAlloyGlass", 0, 4); - - if (BloodArsenal.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(BloodArsenal.ID, "blood_stained_glass", 0, 3); - } - if (Botania.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "manaGlass", 0, 4); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Botania.ID, "elfGlass", 0, 5); - } - if (Botany.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Botany.ID, "stained", 0, 3); - } - - if (Chisel.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "glass2", 0, 3); - - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "glass", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_white", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_yellow", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_lightgray", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_brown", i, 3); - BioVatLogicAdder.BioVatGlass.addCustomGlass(Chisel.ID, "stained_glass_forestry", i, 3); - } - } - - if (EnderIO.isModLoaded()) { - for (int i = 0; i <= 5; ++i) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(EnderIO.ID, "blockFusedQuartz", i, 3); - } - } - - if (ExtraUtilities.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(ExtraUtilities.ID, "decorativeBlock1", 9, 3); - for (int i = 0; i < 12; ++i) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(ExtraUtilities.ID, "decorativeBlock2", i, 3); - } - - for (int i = 0; i < 6; ++i) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(ExtraUtilities.ID, "etherealglass", i, 3); - - } - } - - if (GalaxySpace.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(GalaxySpace.ID, "futureglass", 0, 3); - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(GalaxySpace.ID, "futureglasses", i, 3); - } - } - - if (HardcoreEnderExpansion.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(HardcoreEnderExpansion.ID, "laboratory_glass", 0, 3); - } - - if (IndustrialCraft2.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Minecraft.ID, "glass", 0, 3); - } - - if (Natura.isModLoaded()) { - for (int i = 0; i <= 1; ++i) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Natura.ID, "NetherGlass", i, 3); - } - } - - if (Railcraft.isModLoaded()) { - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Railcraft.ID, "glass", i, 3); - } - } - - if (RandomThings.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(RandomThings.ID, "spectreGlass", 0, 3); - } - - if (TinkerConstruct.isModLoaded()) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(TinkerConstruct.ID, "GlassBlock", 0, 3); - - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(TinkerConstruct.ID, "GlassBlock.StainedClear", i, 3); - } - } - - BioVatLogicAdder.BioVatGlass.addCustomGlass(TecTech.ID, "tile.quantumGlass", 0, 8); - - if (Witchery.isModLoaded()) { - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(Witchery.ID, "shadedglass", i, 3); - } - } - - if (ZTones.isModLoaded()) { - for (int i = 0; i < 16; i++) { - BioVatLogicAdder.BioVatGlass.addCustomGlass(ZTones.ID, "tile.glaxx", 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 d1167b3a09..a5bd2edc12 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 @@ -194,7 +194,6 @@ import com.github.bartimaeusnek.bartworks.common.items.BW_ItemBlocks; import com.github.bartimaeusnek.bartworks.common.items.BW_SimpleWindMeter; import com.github.bartimaeusnek.bartworks.common.items.BW_Stonage_Rotors; import com.github.bartimaeusnek.bartworks.common.items.Circuit_Programmer; -import com.github.bartimaeusnek.bartworks.common.items.GT_Destructopack_Item; import com.github.bartimaeusnek.bartworks.common.items.GT_Rockcutter_Item; import com.github.bartimaeusnek.bartworks.common.items.GT_Teslastaff_Item; import com.github.bartimaeusnek.bartworks.common.items.SimpleIconItem; @@ -238,7 +237,6 @@ import ic2.api.item.IKineticRotor; public class ItemRegistry { - public static final Item DESTRUCTOPACK = new GT_Destructopack_Item(); public static final Item TESLASTAFF = new GT_Teslastaff_Item(); public static final Item ROCKCUTTER_LV = new GT_Rockcutter_Item(1); public static final Item ROCKCUTTER_MV = new GT_Rockcutter_Item(2); @@ -611,7 +609,7 @@ public class ItemRegistry { TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox( LowPowerLaserConverter[amps / 32 - 1][tier - 4], GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", + GT_Values.VN[tier] + " " + amps + "A" + " Low Power Laser Converter", tier, amps).getStackForm(1L); } @@ -633,7 +631,7 @@ public class ItemRegistry { TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch( LowPowerLaserTargetHatch[amps / 32 - 1][tier - 4], GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", + GT_Values.VN[tier] + " " + amps + "A" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L); } @@ -655,7 +653,7 @@ public class ItemRegistry { TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo( LowPowerLaserSourceHatch[amps / 32 - 1][tier - 4], GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, - GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", + GT_Values.VN[tier] + " " + amps + "A" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterGlassTiers.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterGlassTiers.java new file mode 100644 index 0000000000..aa2e0bbc2b --- /dev/null +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RegisterGlassTiers.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +package com.github.bartimaeusnek.bartworks.common.loaders; + +import static gregtech.api.enums.GT_Values.VN; +import static gregtech.api.enums.Mods.BloodArsenal; +import static gregtech.api.enums.Mods.Botania; +import static gregtech.api.enums.Mods.EnderIO; +import static gregtech.api.enums.Mods.IndustrialCraft2; +import static gregtech.api.enums.Mods.Railcraft; +import static gregtech.api.enums.Mods.Thaumcraft; + +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; +import com.github.bartimaeusnek.bartworks.API.GlassTier; +import com.github.technus.tectech.thing.block.QuantumGlassBlock; + +// Register all your glasses here. +public class RegisterGlassTiers { + + public static void run() { + registerGlassAsTiered(); + registerGlassOreDicts(); + } + + private static void registerGlassAsTiered() { + + // --------------------------------------------------------------------- + // Register glass. + // --------------------------------------------------------------------- + + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 0, 3); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 1, 4); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 2, 5); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 3, 6); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 4, 7); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 5, 8); + + // Stained boro glass + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 6, 3); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 7, 3); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 8, 3); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 9, 3); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 10, 3); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 11, 3); + + // Incrementing tiers + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 12, 5); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 13, 9); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 14, 10); + GlassTier.addCustomGlass(BorosilicateGlass.getGlassBlock(), 15, 11); + + // Glass block 2 for transcendent (Really?) + GlassTier.addCustomGlass(BorosilicateG