aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2023-12-04 22:50:37 +0800
committerGitHub <noreply@github.com>2023-12-04 15:50:37 +0100
commitdba8ca96b6a72941f7b4098dca5b2745ac500dc1 (patch)
tree34837d151e8512bface97433ba21a896b6f092c2 /src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java
parent271055e7229c6be6a5826a42e69d46bd43e8f27f (diff)
downloadGT5-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 ![image](https://github.com/GTNewHorizons/GigaGramFab/assets/4586901/b646e07b-64dc-4b5a-91e1-2564dea98090) HV ![image](https://github.com/GTNewHorizons/GigaGramFab/assets/4586901/2b19f72f-88b9-4cc7-9640-e6e3f6df11eb) EV ![image](https://github.com/GTNewHorizons/GigaGramFab/assets/4586901/2090ad41-2101-442b-89d7-3909756c378a) 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. ![image](https://github.com/GTNewHorizons/GigaGramFab/assets/4586901/8fd80c98-63be-4a26-a7c4-83421684416d) ![image](https://github.com/GTNewHorizons/GigaGramFab/assets/4586901/bf2a4347-d133-4bc2-b0d1-d2d968d19667) 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/api/GigaGramFabAPI.java')
-rw-r--r--src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java b/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java
new file mode 100644
index 0000000000..7797d037c3
--- /dev/null
+++ b/src/main/java/net/glease/ggfab/api/GigaGramFabAPI.java
@@ -0,0 +1,30 @@
+package net.glease.ggfab.api;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import gregtech.api.enums.ToolDictNames;
+import gregtech.api.interfaces.IToolStats;
+
+public class GigaGramFabAPI {
+
+ private static final Logger apiLogger = LogManager.getLogger("GigaGramFabAPI");
+
+ private static final Map<ToolDictNames, IToolStats> SINGLE_USE_TOOLS_STORE = new HashMap<>();
+ public static final Map<ToolDictNames, IToolStats> SINGLE_USE_TOOLS = Collections
+ .unmodifiableMap(SINGLE_USE_TOOLS_STORE);
+
+ private static final Map<ToolDictNames, Long> COST_SINGLE_USE_TOOLS_STORE = new HashMap<>();
+ public static final Map<ToolDictNames, Long> COST_SINGLE_USE_TOOLS = Collections
+ .unmodifiableMap(COST_SINGLE_USE_TOOLS_STORE);
+
+ public static void addSingleUseToolType(ToolDictNames type, IToolStats stat, long materialCost) {
+ if (SINGLE_USE_TOOLS_STORE.put(type, stat) != null)
+ apiLogger.warn("Replacing stat of single use tool {}", type);
+ COST_SINGLE_USE_TOOLS_STORE.put(type, materialCost);
+ }
+}