aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>2022-12-21 21:13:24 +0000
committerGTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>2022-12-21 21:13:24 +0000
commitad91d1f902646d0d858cc61b4b85408f69b00ba1 (patch)
tree76401ab9c98631f7a253f33ff6cbad2aa1e50d75 /src/main
parenta75b2c4f9d9c2169434a75195ce7bf64d1e552ea (diff)
downloadGT5-Unofficial-ad91d1f902646d0d858cc61b4b85408f69b00ba1.tar.gz
GT5-Unofficial-ad91d1f902646d0d858cc61b4b85408f69b00ba1.tar.bz2
GT5-Unofficial-ad91d1f902646d0d858cc61b4b85408f69b00ba1.zip
Recipe appears in NEI, even if a mess
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java10
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java43
-rw-r--r--src/main/java/com/github/technus/tectech/recipe/TT_recipe.java27
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java16
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java4
5 files changed, 87 insertions, 13 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 aa71c388d8..69064a1ee4 100644
--- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
+++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java
@@ -8,6 +8,7 @@ import gregtech.api.enums.Materials;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -32,6 +33,8 @@ public class EyeOfHarmonyRecipe {
private final long miningTimeSeconds;
+ private final ItemStack recipeTriggerItem;
+
public EyeOfHarmonyRecipe(
GT5OreLayerHelper.NormalOreDimensionWrapper normalOreDimensionWrapper,
GT5OreSmallHelper.SmallOreDimensionWrapper smallOreDimensionWrapper,
@@ -40,9 +43,12 @@ public class EyeOfHarmonyRecipe {
long heliumRequirement,
long miningTimeSeconds,
long spacetimeCasingTierRequired,
+ Block block,
long euOutput,
double baseSuccessChance) {
+ recipeTriggerItem = new ItemStack(block);
+
// 6 * 64 = 6 stacks/second for VM tier 3 + Og gas.
ArrayList<Pair<Materials, Long>> materialList =
processDimension(normalOreDimensionWrapper, smallOreDimensionWrapper, miningTimeSeconds, 6 * 64);
@@ -115,6 +121,10 @@ public class EyeOfHarmonyRecipe {
return spacetimeCasingTierRequired;
}
+ public ItemStack getRecipeTriggerItem() {
+ return recipeTriggerItem;
+ }
+
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.
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 3f063ab1d2..781d5e5f8d 100644
--- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java
+++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipeStorage.java
@@ -1,6 +1,10 @@
package com.github.technus.tectech.recipe;
+import static com.github.technus.tectech.recipe.TT_recipe.GT_Recipe_MapTT.sEyeofHarmonyRecipes;
+
+import com.github.technus.tectech.util.ItemStackLong;
import com.google.common.math.LongMath;
+import java.util.ArrayList;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
@@ -43,9 +47,10 @@ public class EyeOfHarmonyRecipeStorage {
// (blockDimensionDisplay.getDimensionRocketTier() + 1),
// BILLION *
// (blockDimensionDisplay.getDimensionRocketTier() + 1),
-// 36_000L,
+ // 36_000L,
2000L, // todo: debug only
blockDimensionDisplay.getDimensionRocketTier(),
+ blockDimensionDisplay,
0,
1.0 - blockDimensionDisplay.getDimensionRocketTier() / 10.0));
} catch (Exception e) {
@@ -61,4 +66,40 @@ public class EyeOfHarmonyRecipeStorage {
String dimAbbreviation = blocksMapInverted.get(Block.getBlockFromItem(aStack.getItem()));
return recipeHashMap.get(dimAbbreviation);
}
+
+ public EyeOfHarmonyRecipeStorage() {
+
+ for (EyeOfHarmonyRecipe recipe : recipeHashMap.values()) {
+
+ // todo sort items by fake long stack size.
+ ArrayList<ItemStack> outputItems = new ArrayList<>();
+ for (ItemStackLong itemStackLong : recipe.getOutputItems()) {
+ outputItems.add(itemStackLong.itemStack);
+ }
+
+ // GT_Recipe addRecipe(
+ // boolean aOptimize,
+ // ItemStack[] aInputs,
+ // ItemStack[] aOutputs,
+ // Object aSpecial,
+ // int[] aOutputChances,
+ // FluidStack[] aFluidInputs,
+ // FluidStack[] aFluidOutputs,
+ // int aDuration,
+ // int aEUt,
+ // int aSpecialValue) {
+
+ sEyeofHarmonyRecipes.addRecipe(
+ false,
+ new ItemStack[] {recipe.getRecipeTriggerItem()},
+ outputItems.toArray(new ItemStack[0]),
+ recipe,
+ null,
+ null,
+ recipe.getOutputFluids(),
+ (int) recipe.getRecipeTimeInTicks(),
+ 0,
+ 0);
+ }
+ }
}
diff --git a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java
index 1de1648406..a0d08c6412 100644
--- a/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java
+++ b/src/main/java/com/github/technus/tectech/recipe/TT_recipe.java
@@ -1,11 +1,16 @@
package com.github.technus.tectech.recipe;
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.IEMDefinition;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.maps.IEMMapRead;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.IEMStack;
+import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.util.GT_Recipe;
import java.util.ArrayList;
import java.util.Collection;
@@ -238,6 +243,28 @@ public class TT_recipe extends GT_Recipe {
}
public static class GT_Recipe_MapTT extends GT_Recipe.GT_Recipe_Map {
+
+ public static final GT_Recipe_Map sEyeofHarmonyRecipes = new GT_Recipe_Map(
+ new HashSet<>(250),
+ "gt.recipe.eyeofharmony",
+ "Eye of Harmony",
+ null,
+ RES_PATH_GUI + "basicmachines/Extractor",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM);
+
public static GT_Recipe_MapTT sResearchableFakeRecipes = new GT_Recipe_MapTT(
new HashSet<>(32),
"gt.recipe.researchStation",
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 362bf98038..74650c1930 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
@@ -21,7 +21,6 @@ import com.github.technus.tectech.util.ItemStackLong;
import com.google.common.collect.ImmutableList;
import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
-import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Materials;
@@ -33,17 +32,12 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus;
-import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME;
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME;
-
import java.util.*;
-
-import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
@@ -1445,7 +1439,9 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
// = 3%*3% = 5.91% discount.
long spacetimeCasingDifference = (recipeSpacetimeCasingRequired - spacetimeCompressionFieldMetadata);
- double recipeTimeDiscounted = recipeTime * pow(2.0, -timeAccelerationFieldMetadata) * pow(1 - spacetimeCasingDifferenceDiscountPercentage, spacetimeCasingDifference);
+ double recipeTimeDiscounted = recipeTime
+ * pow(2.0, -timeAccelerationFieldMetadata)
+ * pow(1 - spacetimeCasingDifferenceDiscountPercentage, spacetimeCasingDifference);
return (int) Math.max(recipeTimeDiscounted, 1.0);
}
@@ -1695,7 +1691,8 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
public boolean processRecipe(EyeOfHarmonyRecipe recipeObject) {
// todo: fix changing the tier of block causing multi to unform
- if ((getHydrogenStored() < currentRecipe.getHydrogenRequirement()) || (getHeliumStored() < currentRecipe.getHeliumRequirement())) {
+ if ((getHydrogenStored() < currentRecipe.getHydrogenRequirement())
+ || (getHeliumStored() < currentRecipe.getHeliumRequirement())) {
return false;
}
@@ -1709,7 +1706,8 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
return false;
}
- mMaxProgresstime = recipeProcessTimeCalculator(recipeObject.getRecipeTimeInTicks(), recipeObject.getSpacetimeCasingTierRequired());
+ mMaxProgresstime = recipeProcessTimeCalculator(
+ recipeObject.getRecipeTimeInTicks(), recipeObject.getSpacetimeCasingTierRequired());
calculateHydrogenHeliumInputExcessValues(
recipeObject.getHydrogenRequirement(), recipeObject.getHeliumRequirement());
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
index c5f25f6aa8..09c0c19735 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
@@ -991,9 +991,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt
}
/**
- * if u want to use gt recipe maps...
- *
- * @return
+ * If you want to use GT recipe maps.
*/
@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {