aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>2022-12-18 05:17:45 +0000
committerGTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>2022-12-18 05:17:45 +0000
commitee76de225f16018fb9aa7a437608df2f7ee0f67c (patch)
tree48839ea9548da3883f5892e8a3f016748c4625ed /src/main/java
parentdcdf7a6c811de445eb1f551effcbab397fb76780 (diff)
downloadGT5-Unofficial-ee76de225f16018fb9aa7a437608df2f7ee0f67c.tar.gz
GT5-Unofficial-ee76de225f16018fb9aa7a437608df2f7ee0f67c.tar.bz2
GT5-Unofficial-ee76de225f16018fb9aa7a437608df2f7ee0f67c.zip
Working output of fluids/items.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java22
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java19
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java14
3 files changed, 32 insertions, 23 deletions
diff --git a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
index 1a6ba57bf2..0da39589ee 100644
--- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
+++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
@@ -43,9 +43,7 @@ public class EyeOfHarmonyRecipe {
long euOutput,
double baseSuccessChance
) {
- System.out.println("TEST12345MKFWA");
-
- ArrayList<Pair<Materials, Long>> materialList = processDimension(dimensionWrapper, miningTime, 6);
+ ArrayList<Pair<Materials, Long>> materialList = processDimension(dimensionWrapper, miningTime, 6 * 64);
this.outputItems = validDustGenerator(materialList);
this.outputFluids = validPlasmaGenerator(materialList, 0.1);
@@ -100,11 +98,12 @@ public class EyeOfHarmonyRecipe {
return spacetimeCasingTierRequired;
}
- static final double primaryMultiplier = (0.1 + 1.0/9.0);
- static final double secondaryMultiplier = (1.0/9.0);
- static final double tertiaryMultiplier = (0.1);
+ static final double primaryMultiplier = (0.1 + 1.0/9.0); // Byproduct from macerating/washing chance.
+ static final double secondaryMultiplier = (1.0/9.0); // Thermal centrifuge byproduct chance.
+ static final double tertiaryMultiplier = (0.1); // Macerating thermal centrifuged byproduct chance.
+ static final double quaternaryMultiplier = (0.7); // Mercury/chem bath processing chance.
- static final double[] oreMultiplier = {primaryMultiplier, secondaryMultiplier, tertiaryMultiplier};
+ static final double[] oreMultiplier = {primaryMultiplier, secondaryMultiplier, tertiaryMultiplier, quaternaryMultiplier};
private static class HashMapHelper extends HashMap<Materials, Double> {
@@ -122,11 +121,11 @@ public class EyeOfHarmonyRecipe {
}
static void processHelper(HashMapHelper outputMap, Materials material, double mainMultiplier, double probability) {
- outputMap.add(material, material.mOreMultiplier * mainMultiplier * probability);
+ outputMap.add(material, (material.mOreMultiplier * 2) * mainMultiplier * probability);
int index = 0;
for (Materials byProductMaterial : material.mOreByProducts) {
- outputMap.add(byProductMaterial, mainMultiplier * oreMultiplier[index++]);
+ outputMap.add(byProductMaterial, mainMultiplier * (oreMultiplier[index++] * 2) * probability);
}
}
@@ -166,7 +165,10 @@ public class EyeOfHarmonyRecipe {
List<Pair<ItemStack, Long>> dust_list = new ArrayList<>();
for (Pair<Materials, Long> pair : planetList) {
- dust_list.add(Pair.of(pair.getLeft().getDust(1), pair.getRight()));
+ ItemStack dust = pair.getLeft().getDust(1);
+ if (dust != null) {
+ dust_list.add(Pair.of(dust, pair.getRight()));
+ }
}
return dust_list;
}
diff --git a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java
index de27967ce3..9d490168e4 100644
--- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java
+++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java
@@ -3,7 +3,7 @@ package com.github.technus.tectech.recipe;
import static com.google.common.math.IntMath.pow;
import static pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper.dimToOreWrapper;
-public abstract class EyeOfHarmonyRecipeStorage {
+public class EyeOfHarmonyRecipeStorage {
// static final long MILLION = pow(10, 6); // Fix, these take int, not long, overflow occurring.
// static final long BILLION = pow(10, 9);
@@ -12,13 +12,12 @@ public abstract class EyeOfHarmonyRecipeStorage {
// static final long QUINTILLION = pow(10, 18);
static final long SEXTILLION = pow(10, 21);
-//
- public static EyeOfHarmonyRecipe overworld = new EyeOfHarmonyRecipe(dimToOreWrapper.get("Ow"),
- 1.0,
- 100,
- 100,
- 36_000L,
- 0,
- 100 * 10,
- 0.4);
+ public EyeOfHarmonyRecipe overworld = new EyeOfHarmonyRecipe(dimToOreWrapper.get("Ow"),
+ 1.0,
+ 100,
+ 100,
+ 36_000L,
+ 0,
+ 100 * 10,
+ 0.4);
}
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
index 93f56e64f5..3772f7e82f 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
@@ -1,6 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.recipe.EyeOfHarmonyRecipe;
+import com.github.technus.tectech.recipe.EyeOfHarmonyRecipeStorage;
import com.github.technus.tectech.thing.casing.TT_Block_SpacetimeCompressionFieldGenerators;
import com.github.technus.tectech.thing.casing.TT_Block_StabilisationFieldGenerators;
import com.github.technus.tectech.thing.casing.TT_Block_TimeAccelerationFieldGenerators;
@@ -34,7 +35,6 @@ import org.apache.commons.lang3.tuple.Pair;
import java.util.*;
-import static com.github.technus.tectech.recipe.EyeOfHarmonyRecipeStorage.overworld;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
@@ -43,6 +43,7 @@ import static gregtech.api.enums.GT_Values.AuthorColen;
import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static java.lang.Math.*;
import static net.minecraft.util.EnumChatFormatting.*;
+import static pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper.dimToOreWrapper;
@SuppressWarnings("SpellCheckingInspection")
public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable, IGlobalWirelessEnergy {
@@ -50,6 +51,8 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
private static Textures.BlockIcons.CustomIcon ScreenOFF;
private static Textures.BlockIcons.CustomIcon ScreenON;
+ private static EyeOfHarmonyRecipeStorage recipes;
+
private int SpacetimeCompressionFieldMetadata = -1;
private int TimeAccelerationFieldMetadata = -1;
private int StabilisationFieldMetadata = -1;
@@ -398,8 +401,8 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
long hydrogen_stored = validFluidMap.get(Materials.Hydrogen.getGas(1));
long helium_stored = validFluidMap.get(Materials.Helium.getGas(1));
- if ((hydrogen_stored >= overworld.getHydrogenRequirement()) & (helium_stored >= overworld.getHeliumRequirement())) {
- return processRecipe(overworld);
+ if ((hydrogen_stored >= recipes.overworld.getHydrogenRequirement()) & (helium_stored >= recipes.overworld.getHeliumRequirement())) {
+ return processRecipe(recipes.overworld);
}
return false;
@@ -504,6 +507,11 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
user_uuid = String.valueOf(getBaseMetaTileEntity().getOwnerUuid());
user_name = getBaseMetaTileEntity().getOwnerName();
strongCheckOrAddUser(user_uuid, user_name);
+
+ // Move into tick == 1 after debug.
+ if (recipes == null) {
+ recipes = new EyeOfHarmonyRecipeStorage();
+ }
}
// Add computation to stack. Prevents small interruptions causing issues.