aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/logic/ProcessingLogic.java
diff options
context:
space:
mode:
authorBlueWeabo <ilia.iliev2005@gmail.com>2023-04-01 17:06:06 +0300
committerGitHub <noreply@github.com>2023-04-01 16:06:06 +0200
commit655cc902d3df19a1ac2bfaa38cc928ed629d0171 (patch)
tree25e34b45705b8473e20af3f9b92af25cc87a1e0d /src/main/java/gregtech/api/logic/ProcessingLogic.java
parenta01d019ed97101936210f16c7a362d852f081f09 (diff)
downloadGT5-Unofficial-655cc902d3df19a1ac2bfaa38cc928ed629d0171.tar.gz
GT5-Unofficial-655cc902d3df19a1ac2bfaa38cc928ed629d0171.tar.bz2
GT5-Unofficial-655cc902d3df19a1ac2bfaa38cc928ed629d0171.zip
Implement Power Logic, Pollution Logic and Processing Logic for MuTEs and many other things (#1823)
* update bs 2 * fuel consumption and energy implementation. clean up * don't register XD * some clean up * coke oven work * semi-working coke oven somehow i broke the activating of the multiblock * power logic * PowerLogic * clean up, saving loading nbt * small cleanup and pollution * pollution working :P * Energy mostly working, wallsharing * processing logic * fix npe and deregister * review requests * missed one * remove extra 0
Diffstat (limited to 'src/main/java/gregtech/api/logic/ProcessingLogic.java')
-rw-r--r--src/main/java/gregtech/api/logic/ProcessingLogic.java97
1 files changed, 97 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/logic/ProcessingLogic.java b/src/main/java/gregtech/api/logic/ProcessingLogic.java
new file mode 100644
index 0000000000..fa0d285401
--- /dev/null
+++ b/src/main/java/gregtech/api/logic/ProcessingLogic.java
@@ -0,0 +1,97 @@
+package gregtech.api.logic;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
+public abstract class ProcessingLogic {
+
+ protected GT_Recipe_Map recipeMap;
+ protected ItemStack[] inputItems;
+ protected ItemStack[] outputItems;
+ protected ItemStack[] currentOutputItems;
+ protected FluidStack[] inputFluids;
+ protected FluidStack[] outputFluids;
+ protected FluidStack[] currentOutputFluids;
+ protected long eut;
+ protected long duration;
+
+ public ProcessingLogic() {}
+
+ public ProcessingLogic setInputItems(ItemStack... itemInputs) {
+ this.inputItems = itemInputs;
+ return this;
+ }
+
+ public ProcessingLogic setInputFluids(FluidStack... fluidInputs) {
+ this.inputFluids = fluidInputs;
+ return this;
+ }
+
+ public ProcessingLogic setOutputItems(ItemStack... itemOutputs) {
+ this.outputItems = itemOutputs;
+ return this;
+ }
+
+ public ProcessingLogic setOutputFluids(FluidStack... fluidOutputs) {
+ this.outputFluids = fluidOutputs;
+ return this;
+ }
+
+ public ProcessingLogic setCurrentOutputItems(ItemStack... currentOutputItems) {
+ this.currentOutputItems = currentOutputItems;
+ return this;
+ }
+
+ public ProcessingLogic setCurrentOutputFluids(FluidStack... currentOutputFluids) {
+ this.currentOutputFluids = currentOutputFluids;
+ return this;
+ }
+
+ public ProcessingLogic setRecipeMap(GT_Recipe_Map recipeMap) {
+ this.recipeMap = recipeMap;
+ return this;
+ }
+
+ public ProcessingLogic setDuration(long duration) {
+ this.duration = duration;
+ return this;
+ }
+
+ public ProcessingLogic setEut(long eut) {
+ this.eut = eut;
+ return this;
+ }
+
+ /**
+ * Clears everything stored in the Processing Logic other than the Recipe map used
+ */
+ public ProcessingLogic clear() {
+ this.inputItems = null;
+ this.inputFluids = null;
+ this.outputItems = null;
+ this.outputFluids = null;
+ this.eut = 0;
+ this.duration = 0;
+ return this;
+ }
+
+ public abstract boolean process();
+
+ public ItemStack[] getOutputItems() {
+ return outputItems;
+ }
+
+ public FluidStack[] getOutputFluids() {
+ return outputFluids;
+ }
+
+ public long getDuration() {
+ return duration;
+ }
+
+ public long getEut() {
+ return eut;
+ }
+}