diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2023-12-04 22:50:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 15:50:37 +0100 |
commit | dba8ca96b6a72941f7b4098dca5b2745ac500dc1 (patch) | |
tree | 34837d151e8512bface97433ba21a896b6f092c2 /src/main/java/net/glease/ggfab/GigaGramFab.java | |
parent | 271055e7229c6be6a5826a42e69d46bd43e8f27f (diff) | |
download | GT5-Unofficial-dba8ca96b6a72941f7b4098dca5b2745ac500dc1.tar.gz GT5-Unofficial-dba8ca96b6a72941f7b4098dca5b2745ac500dc1.tar.bz2 GT5-Unofficial-dba8ca96b6a72941f7b4098dca5b2745ac500dc1.zip |
single use tool (#23)
close
https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/14102
recipes and balance are subject to discussions. Currently there is no
matching multiblock for this except PA, but the sheer throughput from
HSS-G should invalidate any need of parallelizing/OC. I intend on adding
a smart multiblock for this (can respond to ME crafting request
dynamically) once first fully functioning MuTE multiblock is out.
MV

HV

EV

shapes looks like this. neither tool used will not get consumed. They
will only get weared out slightly just like any other crafting. I can't
say this is a very brilliant recipe, but IMO it's enough as a
placeholder until someone can come up with more interesting ones.


Currently the count of tools crafted is the durability of each tool with
given tool material divided by durability cost per craft. The only
exception is silver (which is added purely as a meme), whose durability
is halved during calculation.
https://github.com/GTNewHorizons/GigaGramFab/pull/23/commits/79499aab82a72d1d180ca2ea2fdc8a8252d8c3fe
introduced a slightly less stupid algorithm. As a result most of the
tool recipes now require a multiple of 16 of fluids as input.
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: miozune <miozune@gmail.com>
Diffstat (limited to 'src/main/java/net/glease/ggfab/GigaGramFab.java')
-rw-r--r-- | src/main/java/net/glease/ggfab/GigaGramFab.java | 140 |
1 files changed, 139 insertions, 1 deletions
diff --git a/src/main/java/net/glease/ggfab/GigaGramFab.java b/src/main/java/net/glease/ggfab/GigaGramFab.java index af911b9bbd..b30204ac39 100644 --- a/src/main/java/net/glease/ggfab/GigaGramFab.java +++ b/src/main/java/net/glease/ggfab/GigaGramFab.java @@ -1,13 +1,33 @@ package net.glease.ggfab; +import static gregtech.api.enums.ToolDictNames.*; +import static gregtech.common.items.GT_MetaGenerated_Tool_01.*; +import static net.glease.ggfab.api.GGFabRecipeMaps.toolCastRecipes; + +import java.util.stream.IntStream; + +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.init.Items; +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.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.TierEU; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; +import gregtech.api.util.GT_ProcessingArray_Manager; +import gregtech.api.util.GT_RecipeConstants; @Mod( modid = GGConstants.MODID, @@ -31,15 +51,133 @@ public class GigaGramFab { 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, + 2400, + 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, + 3200, + 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, + 2400, + 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(FILE), 2 * plate); + GigaGramFabAPI.addSingleUseToolType(craftingToolWrench, INSTANCE.mToolStats.get(WRENCH), 6 * ingot); + GigaGramFabAPI.addSingleUseToolType(craftingToolCrowbar, INSTANCE.mToolStats.get(CROWBAR), 3 * rod); + GigaGramFabAPI.addSingleUseToolType( + craftingToolWireCutter, + INSTANCE.mToolStats.get(WIRECUTTER), + 3 * plate + 2 * rod + screw); + GigaGramFabAPI.addSingleUseToolType(craftingToolHardHammer, INSTANCE.mToolStats.get(HARDHAMMER), 6 * ingot); + GigaGramFabAPI.addSingleUseToolType(craftingToolSoftHammer, INSTANCE.mToolStats.get(SOFTMALLET), 6 * ingot); + GigaGramFabAPI.addSingleUseToolType(craftingToolScrewdriver, INSTANCE.mToolStats.get(SCREWDRIVER), 2 * rod); + 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) {} + public void postInit(FMLPostInitializationEvent event) { + GT_Values.RA.stdBuilder().itemInputs( + IntStream.range(0, 16).mapToObj(ignored -> new ItemStack(Items.diamond)).toArray(ItemStack[]::new)) + .fluidInputs(Materials.SolderingAlloy.getMolten(1)).itemOutputs(ItemList.Pump_EV.get(1L)) + .metadata(GT_RecipeConstants.RESEARCH_ITEM, ItemList.Pump_LV.get(1)) + .metadata(GT_RecipeConstants.RESEARCH_TIME, 1).eut(TierEU.RECIPE_IV).duration(160000) + .addTo(GT_RecipeConstants.AssemblyLine); + } + 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; + } + } } |