aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-09-02 23:17:17 +0200
committerGitHub <noreply@github.com>2024-09-02 23:17:17 +0200
commit1b820de08a05070909a267e17f033fcf58ac8710 (patch)
tree02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/net
parentafd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff)
downloadGT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip
The Great Renaming (#3014)
* move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/glease/ggfab/BlockIcons.java45
-rw-r--r--src/main/java/net/glease/ggfab/ComponentRecipeLoader.java57
-rw-r--r--src/main/java/net/glease/ggfab/ConfigurationHandler.java52
-rw-r--r--src/main/java/net/glease/ggfab/GGConstants.java16
-rw-r--r--src/main/java/net/glease/ggfab/GGItemList.java205
-rw-r--r--src/main/java/net/glease/ggfab/GigaGramFab.java191
-rw-r--r--src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java103
-rw-r--r--src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java64
-rw-r--r--src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java30
-rw-r--r--src/main/java/net/glease/ggfab/items/GGMetaItem_DumbItems.java153
-rw-r--r--src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java1107
-rw-r--r--src/main/java/net/glease/ggfab/mte/MTE_LinkedInputBus.java684
-rw-r--r--src/main/java/net/glease/ggfab/mui/ClickableTextWidget.java58
-rw-r--r--src/main/java/net/glease/ggfab/util/GGUtils.java78
-rw-r--r--src/main/java/net/glease/ggfab/util/OverclockHelper.java75
15 files changed, 0 insertions, 2918 deletions
diff --git a/src/main/java/net/glease/ggfab/BlockIcons.java b/src/main/java/net/glease/ggfab/BlockIcons.java
deleted file mode 100644
index 638b206f44..0000000000
--- a/src/main/java/net/glease/ggfab/BlockIcons.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package net.glease.ggfab;
-
-import net.minecraft.client.renderer.texture.TextureMap;
-import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.interfaces.IIconContainer;
-
-public enum BlockIcons implements IIconContainer, Runnable {
-
- OVERLAY_FRONT_ADV_ASSLINE_ACTIVE,
- OVERLAY_FRONT_ADV_ASSLINE_ACTIVE_GLOW,
- OVERLAY_FRONT_ADV_ASSLINE_STUCK,
- OVERLAY_FRONT_ADV_ASSLINE_STUCK_GLOW,
- OVERLAY_FRONT_ADV_ASSLINE,
- OVERLAY_FRONT_ADV_ASSLINE_GLOW,;
-
- public static final String RES_PATH = GGConstants.MODID + ":";
- private IIcon mIcon;
-
- BlockIcons() {
- GregTech_API.sGTBlockIconload.add(this);
- }
-
- @Override
- public IIcon getIcon() {
- return mIcon;
- }
-
- @Override
- public IIcon getOverlayIcon() {
- return null;
- }
-
- @Override
- public ResourceLocation getTextureFile() {
- return TextureMap.locationBlocksTexture;
- }
-
- @Override
- public void run() {
- mIcon = GregTech_API.sBlockIcons.registerIcon(RES_PATH + "iconsets/" + this);
- }
-}
diff --git a/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java b/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java
deleted file mode 100644
index 5c121b205e..0000000000
--- a/src/main/java/net/glease/ggfab/ComponentRecipeLoader.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package net.glease.ggfab;
-
-import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
-import static gregtech.api.util.GT_RecipeBuilder.HOURS;
-import static gregtech.api.util.GT_RecipeBuilder.MINUTES;
-import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
-import static gregtech.api.util.GT_RecipeConstants.AssemblyLine;
-import static gregtech.api.util.GT_RecipeConstants.RESEARCH_ITEM;
-import static gregtech.api.util.GT_RecipeConstants.RESEARCH_TIME;
-
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-
-class ComponentRecipeLoader implements Runnable {
-
- @Override
- public void run() {
- Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140");
-
- GT_Values.RA.stdBuilder()
- .metadata(RESEARCH_ITEM, ItemList.Machine_Multi_Assemblyline.get(1L))
- .metadata(RESEARCH_TIME, 1 * HOURS + 6 * MINUTES)
- .itemInputs(
- ItemList.Machine_Multi_Assemblyline.get(1L),
- new Object[] { OrePrefixes.circuit.get(Materials.LuV), 2 },
- new Object[] { OrePrefixes.circuit.get(Materials.IV), 4 },
- new Object[] { OrePrefixes.circuit.get(Materials.EV), 8 },
- ItemList.Automation_ChestBuffer_LuV.get(1L))
- .fluidInputs(new FluidStack(solderIndalloy, 1296), Materials.Lubricant.getFluid(2000))
- .itemOutputs(GGItemList.AdvAssLine.get(1L))
- .eut(6_000)
- .duration(10 * MINUTES)
- .addTo(AssemblyLine);
-
- GT_Values.RA.stdBuilder()
- .itemInputs(
- ItemList.Hatch_Input_Bus_IV.get(1L),
- ItemList.Emitter_IV.get(1L),
- ItemList.Sensor_IV.get(1L),
- GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Enderium, 1L),
- GT_Utility.getIntegratedCircuit(12))
- .itemOutputs(GGItemList.LinkedInputBus.get(1L))
- .fluidInputs(Materials.Polybenzimidazole.getMolten(144L))
- .duration(30 * SECONDS)
- .eut(GT_Values.VP[5])
- .addTo(assemblerRecipes);
-
- }
-}
diff --git a/src/main/java/net/glease/ggfab/ConfigurationHandler.java b/src/main/java/net/glease/ggfab/ConfigurationHandler.java
deleted file mode 100644
index 5364b00941..0000000000
--- a/src/main/java/net/glease/ggfab/ConfigurationHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package net.glease.ggfab;
-
-import java.io.File;
-import java.util.Map;
-
-import net.minecraftforge.common.config.ConfigCategory;
-import net.minecraftforge.common.config.Configuration;
-import net.minecraftforge.common.config.Property;
-
-public enum ConfigurationHandler {
-
- INSTANCE;
-
- private Configuration config;
- private float laserOCPenaltyFactor;
-
- void init(File f) {
- config = new Configuration(f);
- loadConfig();
- setLanguageKeys();
- }
-
- private void setLanguageKeys() {
- for (String categoryName : config.getCategoryNames()) {
- ConfigCategory category = config.getCategory(categoryName);
- category.setLanguageKey("ggfab.config." + categoryName);
- for (Map.Entry<String, Property> entry : category.entrySet()) {
- entry.getValue()
- .setLanguageKey(String.format("%s.%s", category.getLanguagekey(), entry.getKey()));
- }
- }
- }
-
- private void loadConfig() {
- laserOCPenaltyFactor = config.getFloat(
- "advasslinePenaltyFactor",
- "common.balancing",
- 0.3f,
- 0f,
- 10f,
- "Laser overclock penalty factor. This will incredibly change the game balance. Even a small step from 0.2 to 0.3 can have very significant impact. Tweak with caution!");
- config.save();
- }
-
- public Configuration getConfig() {
- return config;
- }
-
- public float getLaserOCPenaltyFactor() {
- return laserOCPenaltyFactor;
- }
-}
diff --git a/src/main/java/net/glease/ggfab/GGConstants.java b/src/main/java/net/glease/ggfab/GGConstants.java
deleted file mode 100644
index 8547dfc857..0000000000
--- a/src/main/java/net/glease/ggfab/GGConstants.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package net.glease.ggfab;
-
-import net.minecraft.util.EnumChatFormatting;
-
-import gregtech.GT_Version;
-
-public class GGConstants {
-
- public static final String MODID = "ggfab";
- public static final String RES_PATH_ITEM = MODID + ":";
- public static final String MODNAME = "GigaGramFab";
- public static final String VERSION = GT_Version.VERSION;
-
- public static final String GGMARK = EnumChatFormatting.GOLD + "GigaGram" + EnumChatFormatting.RESET + "Fab";
- public static final String GGMARK_TOOLTIP = "Added by " + GGMARK;
-}
diff --git a/src/main/java/net/glease/ggfab/GGItemList.java b/src/main/java/net/glease/ggfab/GGItemList.java
deleted file mode 100644
index af5e610036..0000000000
--- a/src/main/java/net/glease/ggfab/GGItemList.java
+++ /dev/null
@@ -1,205 +0,0 @@
-package net.glease.ggfab;
-
-import static gregtech.api.enums.GT_Values.W;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.interfaces.IItemContainer;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-
-public enum GGItemList implements IItemContainer {
-
- LinkedInputBus,
- AdvAssLine,
- // region single use tool
- ToolCast_MV,
- ToolCast_HV,
- ToolCast_EV,
- // order matters, do not insert randomly like a n00b
- One_Use_craftingToolFile,
- One_Use_craftingToolWrench,
- One_Use_craftingToolCrowbar,
- One_Use_craftingToolWireCutter,
- One_Use_craftingToolHardHammer,
- One_Use_craftingToolSoftHammer,
- One_Use_craftingToolScrewdriver,
- One_Use_craftingToolSaw,
- Shape_One_Use_craftingToolFile,
- Shape_One_Use_craftingToolWrench,
- Shape_One_Use_craftingToolCrowbar,
- Shape_One_Use_craftingToolWireCutter,
- Shape_One_Use_craftingToolHardHammer,
- Shape_One_Use_craftingToolSoftHammer,
- Shape_One_Use_craftingToolScrewdriver,
- Shape_One_Use_craftingToolSaw,
- // ordered section ends
- // endregion
- //
- ;
-
- private ItemStack mStack;
- private boolean mHasNotBeenSet = true;
-
- @Override
- public IItemContainer set(Item aItem) {
- mHasNotBeenSet = false;
- if (aItem == null) {
- return this;
- }
- ItemStack aStack = new ItemStack(aItem, 1, 0);
- mStack = GT_Utility.copyAmount(1, aStack);
- return this;
- }
-
- @Override
- public IItemContainer hidden() {
- codechicken.nei.api.API.hideItem(get(1L));
- return this;
- }
-
- @Override
- public IItemContainer set(ItemStack aStack) {
- mHasNotBeenSet = false;
- mStack = GT_Utility.copyAmount(1, aStack);
- return this;
- }
-
- @Override
- public Item getItem() {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(mStack)) {
- return null;
- }
- return mStack.getItem();
- }
-
- @Override
- public Block getBlock() {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- return GT_Utility.getBlockFromStack(new ItemStack(getItem()));
- }
-
- @Override
- public final boolean hasBeenSet() {
- return !mHasNotBeenSet;
- }
-
- @Override
- public boolean isStackEqual(Object aStack) {
- return isStackEqual(aStack, false, false);
- }
-
- @Override
- public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT) {
- if (GT_Utility.isStackInvalid(aStack)) {
- return false;
- }
- return GT_Utility.areUnificationsEqual((ItemStack) aStack, aWildcard ? getWildcard(1) : get(1), aIgnoreNBT);
- }
-
- @Override
- public ItemStack get(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmount(aAmount, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getWildcard(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, W, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getUndamaged(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, 0, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getAlmostBroken(long aAmount, Object... aReplacements) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public ItemStack getWithName(long aAmount, String aDisplayName, Object... aReplacements) {
- ItemStack rStack = get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) {
- return null;
- }
- rStack.setStackDisplayName(aDisplayName);
- return GT_Utility.copyAmount(aAmount, rStack);
- }
-
- @Override
- public ItemStack getWithCharge(long aAmount, int aEnergy, Object... aReplacements) {
- ItemStack rStack = get(1, aReplacements);
- if (GT_Utility.isStackInvalid(rStack)) {
- return null;
- }
- GT_ModHandler.chargeElectricItem(rStack, aEnergy, Integer.MAX_VALUE, true, false);
- return GT_Utility.copyAmount(aAmount, rStack);
- }
-
- @Override
- public ItemStack getWithDamage(long aAmount, long aMetaValue, Object... aReplacements) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- if (GT_Utility.isStackInvalid(mStack)) {
- return GT_Utility.copyAmount(aAmount, aReplacements);
- }
- return GT_Utility.copyAmountAndMetaData(aAmount, aMetaValue, GT_OreDictUnificator.get(mStack));
- }
-
- @Override
- public IItemContainer registerOre(Object... aOreNames) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- for (Object tOreName : aOreNames) {
- GT_OreDictUnificator.registerOre(tOreName, get(1));
- }
- return this;
- }
-
- @Override
- public IItemContainer registerWildcardAsOre(Object... aOreNames) {
- if (mHasNotBeenSet) {
- throw new IllegalAccessError("The Enum '" + name() + "' has not been set to an Item at this time!");
- }
- for (Object tOreName : aOreNames) {
- GT_OreDictUnificator.registerOre(tOreName, getWildcard(1));
- }
- return this;
- }
-
-}
diff --git a/src/main/java/net/glease/ggfab/GigaGramFab.java b/src/main/java/net/glease/ggfab/GigaGramFab.java
deleted file mode 100644
index 412e1cd647..0000000000
--- a/src/main/java/net/glease/ggfab/GigaGramFab.java
+++ /dev/null
@@ -1,191 +0,0 @@
-package net.glease.ggfab;
-
-import static gregtech.api.enums.ToolDictNames.*;
-import static gregtech.common.items.GT_MetaGenerated_Tool_01.*;
-import static gregtech.common.items.ID_MetaTool_01.*;
-import static net.glease.ggfab.api.GGFabRecipeMaps.toolCastRecipes;
-
-import net.glease.ggfab.api.GigaGramFabAPI;
-import net.glease.ggfab.items.GGMetaItem_DumbItems;
-import net.glease.ggfab.mte.MTE_AdvAssLine;
-import net.glease.ggfab.mte.MTE_LinkedInputBus;
-import net.glease.ggfab.util.GGUtils;
-import net.minecraft.item.ItemStack;
-
-import cpw.mods.fml.common.Mod;
-import cpw.mods.fml.common.event.FMLInitializationEvent;
-import cpw.mods.fml.common.event.FMLPostInitializationEvent;
-import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.SoundResource;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe;
-import gregtech.api.util.GT_ProcessingArray_Manager;
-
-@Mod(
- modid = GGConstants.MODID,
- version = GGConstants.VERSION,
- name = GGConstants.MODNAME,
- acceptedMinecraftVersions = "[1.7.10]",
- dependencies = "required-after:IC2;required-before:gregtech")
-public class GigaGramFab {
-
- public GigaGramFab() {
- // initialize the textures
- // noinspection ResultOfMethodCallIgnored
- BlockIcons.OVERLAY_FRONT_ADV_ASSLINE.name();
- }
-
- @Mod.EventHandler
- public void preInit(FMLPreInitializationEvent event) {
- GregTech_API.sAfterGTPreload.add(() -> {
- GGItemList.AdvAssLine
- .set(new MTE_AdvAssLine(13532, "ggfab.machine.adv_assline", "Advanced Assembly Line").getStackForm(1));
- GGItemList.LinkedInputBus.set(
- new MTE_LinkedInputBus(13533, "ggfab.machine.linked_input_bus", "Linked Input Bus", 5).getStackForm(1));
- GGItemList.ToolCast_MV.set(
- new GT_MetaTileEntity_BasicMachine_GT_Recipe(
- 13534,
- "ggfab.toolcast.tier.mv",
- "Basic Tool Casting Machine",
- 2,
- "Cheap Crafting Tool for you!",
- toolCastRecipes,
- 1,
- 4,
- 32000,
- SoundResource.NONE,
- GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS,
- "TOOL_CAST",
- new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'P',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', ItemList.Shape_Empty.get(1L) })
- .getStackForm(1L));
- GGItemList.ToolCast_HV.set(
- new GT_MetaTileEntity_BasicMachine_GT_Recipe(
- 13535,
- "ggfab.toolcast.tier.hv",
- "Advanced Tool Casting Machine",
- 3,
- "Cheap Crafting Tool for you!",
- toolCastRecipes,
- 1,
- 4,
- 64000,
- SoundResource.NONE,
- GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS,
- "TOOL_CAST",
- new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'P',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', ItemList.Shape_Empty.get(1L) })
- .getStackForm(1L));
- GGItemList.ToolCast_EV.set(
- new GT_MetaTileEntity_BasicMachine_GT_Recipe(
- 13536,
- "ggfab.toolcast.tier.ev",
- "Master Tool Casting Machine",
- 4,
- "Cheap Crafting Tool for you!",
- toolCastRecipes,
- 1,
- 4,
- 128000,
- SoundResource.NONE,
- GT_MetaTileEntity_BasicMachine_GT_Recipe.SpecialEffects.MAIN_RANDOM_SPARKS,
- "TOOL_CAST",
- new Object[] { "PGP", "WMW", "CBC", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'P',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP, 'C',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE, 'G',
- GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS, 'B', ItemList.Shape_Empty.get(1L) })
- .getStackForm(1L));
- long plate = OrePrefixes.plate.mMaterialAmount, ingot = OrePrefixes.ingot.mMaterialAmount,
- screw = OrePrefixes.screw.mMaterialAmount, rod = OrePrefixes.stick.mMaterialAmount;
- GigaGramFabAPI.addSingleUseToolType(craftingToolFile, INSTANCE.mToolStats.get((short) FILE.ID), 2 * plate);
- GigaGramFabAPI
- .addSingleUseToolType(craftingToolWrench, INSTANCE.mToolStats.get((short) WRENCH.ID), 6 * ingot);
- GigaGramFabAPI
- .addSingleUseToolType(craftingToolCrowbar, INSTANCE.mToolStats.get((short) CROWBAR.ID), 3 * rod);
- GigaGramFabAPI.addSingleUseToolType(
- craftingToolWireCutter,
- INSTANCE.mToolStats.get((short) WIRECUTTER.ID),
- 3 * plate + 2 * rod + screw);
- GigaGramFabAPI.addSingleUseToolType(
- craftingToolHardHammer,
- INSTANCE.mToolStats.get((short) HARDHAMMER.ID),
- 6 * ingot);
- GigaGramFabAPI.addSingleUseToolType(
- craftingToolSoftHammer,
- INSTANCE.mToolStats.get((short) SOFTMALLET.ID),
- 6 * ingot);
- GigaGramFabAPI.addSingleUseToolType(
- craftingToolScrewdriver,
- INSTANCE.mToolStats.get((short) SCREWDRIVER.ID),
- 2 * rod);
- GigaGramFabAPI.addSingleUseToolType(craftingToolSaw, INSTANCE.mToolStats.get((short) SAW.ID), 2 * plate);
- GT_ProcessingArray_Manager.addRecipeMapToPA("ggfab.toolcast", toolCastRecipes);
- });
- GregTech_API.sBeforeGTPostload.add(new ComponentRecipeLoader());
- GregTech_API.sBeforeGTPostload.add(new SingleUseToolRecipeLoader());
- ConfigurationHandler.INSTANCE.init(event.getSuggestedConfigurationFile());
-
- initDumbItem1();
- }
-
- @Mod.EventHandler
- public void init(FMLInitializationEvent event) {}
-
- @Mod.EventHandler
- public void postInit(FMLPostInitializationEvent event) {}
-
- private void initDumbItem1() {
- GGMetaItem_DumbItems i1 = new GGMetaItem_DumbItems("ggfab.d1");
- int id = 0;
- {
- int idShape = 30;
- final int budget = idShape;
- String prefix = "One_Use_craftingTool";
- String prefix2 = "Shape_One_Use_craftingTool";
- for (GGItemList i : GGItemList.values()) {
- ItemStack stack = null;
- if (i.name()
- .startsWith(prefix)) {
- stack = i1.addItem(
- id++,
- "Single Use " + GGUtils.processSentence(
- i.name()
- .substring(prefix.length()),
- ' ',
- true,
- true),
- null,
- i,
- i.name()
- .substring("One_Use_".length()));
- } else if (i.name()
- .startsWith(prefix2)) {
- stack = i1.addItem(
- idShape++,
- "Tool Casting Mold (" + GGUtils.processSentence(
- i.name()
- .substring(prefix2.length()),
- ' ',
- true,
- true) + ")",
- null,
- i);
- }
- if (stack != null) {
- i.set(stack);
- }
- }
- if (id >= budget || idShape >= 2 * budget || idShape - id != budget) throw new AssertionError();
- id = budget * 2;
- }
- }
-}
diff --git a/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java b/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java
deleted file mode 100644
index aa2a72f71c..0000000000
--- a/src/main/java/net/glease/ggfab/SingleUseToolRecipeLoader.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package net.glease.ggfab;
-
-import static gregtech.api.enums.ToolDictNames.*;
-import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
-
-import net.glease.ggfab.api.GGFabRecipeMaps;
-import net.glease.ggfab.api.GigaGramFabAPI;
-
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.TierEU;
-import gregtech.api.enums.ToolDictNames;
-import gregtech.api.interfaces.IToolStats;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_Utility;
-
-class SingleUseToolRecipeLoader implements Runnable {
-
- @Override
- public void run() {
- ToolDictNames[] hardTools = new ToolDictNames[] { craftingToolHardHammer, craftingToolScrewdriver,
- craftingToolWrench, craftingToolCrowbar, craftingToolWireCutter, craftingToolFile, craftingToolSaw };
- ToolDictNames[] softTools = new ToolDictNames[] { craftingToolSoftHammer };
- addSingleUseToolRecipe(Materials.Steel, hardTools);
- addSingleUseToolRecipe(Materials.Silver, 5000, hardTools);
- addSingleUseToolRecipe(Materials.VanadiumSteel, hardTools);
- addSingleUseToolRecipe(Materials.TungstenSteel, hardTools);
- addSingleUseToolRecipe(Materials.HSSG, hardTools);
- addSingleUseToolRecipe(Materials.Rubber, softTools);
- addSingleUseToolRecipe(Materials.StyreneButadieneRubber, softTools);
- addSingleUseToolRecipe(Materials.Polybenzimidazole, softTools);
-
- String prefix = "Shape_One_Use_";
- for (GGItemList value : GGItemList.values()) {
- if (!value.name()
- .startsWith(prefix)) {
- continue;
- }
- ToolDictNames type = ToolDictNames.valueOf(
- value.name()
- .substring(prefix.length()));
- GT_ModHandler
- .addCraftingRecipe(value.get(1L), new Object[] { "h", "P", "I", 'P', ItemList.Shape_Empty, 'I', type });
- }
- }
-
- private void addSingleUseToolRecipe(Materials material, ToolDictNames... types) {
- addSingleUseToolRecipe(material, 10000, types);
- }
-
- private static long findNiceFactor(long fluids, long count) {
- long end = Math.min(fluids, count);
- for (long i = count / 256; i < end; i++) {
- if (fluids % i == 0 && count % i == 0 && count / i < 256) return i;
- }
- return -1;
- }
-
- private void addSingleUseToolRecipe(Materials material, int outputModifier, ToolDictNames... types) {
- if (material.mStandardMoltenFluid == null) {
- throw new IllegalArgumentException("material does not have molten fluid form");
- }
- for (ToolDictNames type : types) {
- IToolStats stats = GigaGramFabAPI.SINGLE_USE_TOOLS.get(type);
- Long cost = GigaGramFabAPI.COST_SINGLE_USE_TOOLS.get(type);
- if (stats == null || cost == null) {
- throw new IllegalArgumentException(type + " not registered");
- }
- long fluids = cost * GT_Values.L / GT_Values.M, duration = 6 * SECONDS;
- long count = (long) (material.mDurability * stats.getMaxDurabilityMultiplier()
- * outputModifier
- * 100
- / stats.getToolDamagePerContainerCraft()
- / 10000);
- if (count > 64 * 4) {
- long niceFactor = findNiceFactor(fluids, count);
- if (niceFactor < 0) {
- double mod = (double) count / (64 * 4L);
- fluids = Math.max((long) (fluids / mod), 1L);
- duration = Math.max((long) (duration / mod), 1L);
- count = 64 * 4;
- } else {
- fluids /= niceFactor;
- duration = Math.max(duration / niceFactor, 1);
- count /= niceFactor;
- }
- } else if (count < 128) {
- long mod = GT_Utility.ceilDiv(128, count);
- fluids *= mod;
- duration *= mod;
- count *= mod;
- }
- GT_Values.RA.stdBuilder()
- .fluidInputs(material.getMolten(fluids)) //
- .metadata(GGFabRecipeMaps.OUTPUT_TYPE, type) //
- .metadata(GGFabRecipeMaps.OUTPUT_COUNT, (int) count) //
- .eut(TierEU.RECIPE_MV)
- .duration(duration) //
- .addTo(GGFabRecipeMaps.toolCastRecipes);
- }
- }
-}
diff --git a/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java b/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java
deleted file mode 100644
index 039b9d2b58..0000000000
--- a/src/main/java/net/glease/ggfab/api/GGFabRecipeMaps.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package net.glease.ggfab.api;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-
-import net.glease.ggfab.GGItemList;
-import net.minecraft.item.ItemStack;
-
-import com.gtnewhorizons.modularui.common.widget.ProgressBar;
-
-import gregtech.api.enums.ToolDictNames;
-import gregtech.api.gui.modularui.GT_UITextures;
-import gregtech.api.recipe.RecipeMap;
-import gregtech.api.recipe.RecipeMapBackend;
-import gregtech.api.recipe.RecipeMapBuilder;
-import gregtech.api.recipe.RecipeMetadataKey;
-import gregtech.api.recipe.metadata.SimpleRecipeMetadataKey;
-import gregtech.api.util.GT_Recipe;
-
-public class GGFabRecipeMaps {
-
- public static final RecipeMetadataKey<ToolDictNames> OUTPUT_TYPE = SimpleRecipeMetadataKey
- .create(ToolDictNames.class, "output_type");
- public static final RecipeMetadataKey<Integer> OUTPUT_COUNT = SimpleRecipeMetadataKey
- .create(Integer.class, "output_count");
- public static final RecipeMap<RecipeMapBackend> toolCastRecipes = RecipeMapBuilder.of("ggfab.recipe.toolcast")
- .maxIO(1, 4, 1, 0)
- .minInputs(1, 1)
- .progressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .recipeEmitter(b -> {
- Optional<GT_Recipe> rr = b.noOptimize()
- .validateNoInput()
- .validateInputFluidCount(0, 1)
- .validateNoOutput()
- .validateNoOutputFluid()
- .build();
- if (!rr.isPresent()) return Collections.emptyList();
- ToolDictNames outputType = b.getMetadata(OUTPUT_TYPE);
- GT_Recipe r = rr.get();
- int outputSize = b.getMetadataOrDefault(OUTPUT_COUNT, 0);
- if (outputSize > 64 * 4 || outputSize <= 0) return Collections.emptyList();
- ItemStack shape, output;
- try {
- shape = GGItemList.valueOf("Shape_One_Use_" + outputType)
- .get(0L);
- output = GGItemList.valueOf("One_Use_" + outputType)
- .get(outputSize);
- } catch (IllegalArgumentException ex) {
- // this looks like python not java, but I don't have better way around this
- return Collections.emptyList();
- }
- output.stackSize = outputSize;
- List<ItemStack> outputs = new ArrayList<>();
- int maxStackSize = output.getMaxStackSize();
- while (output.stackSize > maxStackSize) outputs.add(output.splitStack(maxStackSize));
- outputs.add(output);
- r.mInputs = new ItemStack[] { shape };
- r.mOutputs = outputs.toArray(new ItemStack[0]);
- return Collections.singletonList(r);
- })
- .build();
-}
diff --git a/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java b/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java
deleted file mode 100644
index 6b35b26486..0000000000
--- a/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package net.glease.ggfab.api;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.loggi