aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe
diff options
context:
space:
mode:
authorNotAPenguin <michiel.vandeginste@gmail.com>2024-09-02 23:17:17 +0200
committerGitHub <noreply@github.com>2024-09-02 23:17:17 +0200
commit1b820de08a05070909a267e17f033fcf58ac8710 (patch)
tree02831a025986a06b20f87e5bcc69d1e0c639a342 /src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe
parentafd3fd92b6a6ab9ab0d0dc3214e6bc8ff7a86c9b (diff)
downloadGT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.gz
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.tar.bz2
GT5-Unofficial-1b820de08a05070909a267e17f033fcf58ac8710.zip
The Great Renaming (#3014)
* move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names
Diffstat (limited to 'src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe')
-rw-r--r--src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java166
-rw-r--r--src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java194
-rw-r--r--src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java53
-rw-r--r--src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java72
-rw-r--r--src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java24
-rw-r--r--src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java109
6 files changed, 0 insertions, 618 deletions
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java
deleted file mode 100644
index 59c14940d6..0000000000
--- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeAdder2.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package com.elisis.gtnhlanth.common.tileentity.recipe.beamline;
-
-import java.util.Arrays;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-
-import com.elisis.gtnhlanth.common.beamline.Particle;
-
-import gregtech.api.gui.modularui.GT_UITextures;
-import gregtech.api.recipe.RecipeMap;
-import gregtech.api.recipe.RecipeMapBackend;
-import gregtech.api.recipe.RecipeMapBuilder;
-import gregtech.api.util.GT_Utility;
-
-public class BeamlineRecipeAdder2 {
-
- public static final BeamlineRecipeAdder2 instance = new BeamlineRecipeAdder2();
-
- public final RecipeMap<RecipeMapBackend> SourceChamberRecipes = RecipeMapBuilder.of("gtnhlanth.recipe.sc")
- .minInputs(0, 0)
- .maxIO(1, 2, 0, 0)
- .amperage(1)
- .frontend(SourceChamberFrontend::new)
- .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1)
- .neiSpecialInfoFormatter((recipeInfo) -> {
-
- RecipeSC recipe = (RecipeSC) recipeInfo.recipe;
-
- float focus = recipe.focus;
- float maxEnergy = recipe.maxEnergy;
-
- int amount = recipe.rate;
-
- Particle particle = Particle.getParticleFromId(recipe.particleId);
-
- return Arrays.asList(
-
- // StatCollector.translateToLocal("beamline.particle") + ": " + particle.getLocalisedName(),
-
- StatCollector.translateToLocal("beamline.energy") + ": <="
- + GT_Utility.formatNumbers(Math.min(maxEnergy, particle.maxSourceEnergy()))
- + " keV",
-
- StatCollector.translateToLocal("beamline.focus") + ": " + GT_Utility.formatNumbers(focus),
-
- StatCollector.translateToLocal("beamline.rate") + ": " + GT_Utility.formatNumbers(amount)
-
- );
- })
- // .slotOverlays(null)
-
- .build();
-
- public final RecipeMap<RecipeMapBackend> TargetChamberRecipes = RecipeMapBuilder.of("gtnhlanth.recipe.tc")
- .minInputs(0, 0)
- .maxIO(3, 4, 0, 0)
- .frontend(TargetChamberFrontend::new)
- .neiSpecialInfoFormatter(((recipeInfo) -> {
-
- RecipeTC recipe = (RecipeTC) recipeInfo.recipe;
-
- float minEnergy = recipe.minEnergy;
- float maxEnergy = recipe.maxEnergy;
-
- float minFocus = recipe.minFocus;
-
- float amount = recipe.amount;
-
- Particle particle = Particle.getParticleFromId(recipe.particleId);
-
- return Arrays.asList(
-
- // StatCollector.translateToLocal("beamline.particle") + ": " + particle.getLocalisedName(),
-
- StatCollector.translateToLocal("beamline.energy") + ": "
- + GT_Utility.formatNumbers(minEnergy * 1000)
- + "-"
- + GT_Utility.formatNumbers(maxEnergy * 1000)
- + " eV", // Note the eV unit
-
- StatCollector.translateToLocal("beamline.focus") + ": >=" + GT_Utility.formatNumbers(minFocus),
-
- StatCollector.translateToLocal("beamline.amount") + ": " + GT_Utility.formatNumbers(amount)
-
- );
- }))
- // .slotOverlays(null)
- .progressBar(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1)
- .progressBarPos(108, 22)
- .neiTransferRect(100, 22, 28, 18)
- .build();
-
- /***
- *
- * @param itemInputs - duh
- * @param itemOutputs - duh
- * @param particleId - The ID of the {@link com.elisis.gtnhlanth.common.beamline.Particle} generated by the recipe.
- * It is recommended to use Particle#ordinal()
- * @param rate - The rate/amount of particles generated
- * @param maxEnergy - The maximum energy particles generated by this recipe can possess (keV). Set this value >=
- * max particle energy to limit it to the latter
- * @param focus - Focus of the particle generated
- * @param energyRatio - Set high for little-to-no EUt energy scaling, low for the opposite
- * @param minEUt - Minimum EUt required for the recipe. ! May not output if input energy is equal to minimum !
- */
- public boolean addSourceChamberRecipe(ItemStack[] itemInputs, ItemStack[] itemOutputs, int particleId, int rate,
- float maxEnergy, float focus, float energyRatio, int minEUt) {
-
- return (SourceChamberRecipes.addRecipe(
- new RecipeSC(
- false,
- itemInputs,
- itemOutputs,
- null,
- new int[] {},
- null,
- null,
- 20,
- minEUt,
- particleId,
- rate,
- maxEnergy,
- focus,
- energyRatio))
- != null);
- }
-
- /***
- *
- * @param itemInput - The item to be used as a target. Should have durability
- * @param itemOutput - duh
- * @param particleId - The ID of the {@link com.elisis.gtnhlanth.common.beamline.Particle} used by the recipe. It
- * is recommended to use Particle#ordinal()
- * @param amount - The total amount of particles required for the recipe to come to completion. The duration of
- * the recipe will be determined by this and the input particle rate.
- * @param minEnergy - The minimum energy amount required by this recipe in keV (inclusive)
- * @param maxEnergy - The maximum energy amount allowed by this recipe in keV (inclusive)
- * @param minFocus - Minimum focus allowed by the recipe
- * @param energyRatio - Set high for little-to-no EUt energy scaling, low for the opposite
- * @param minEUt - Minimum EUt required for the recipe to start
- */
-
- public boolean addTargetChamberRecipe(ItemStack itemInput, ItemStack itemOutput, ItemStack itemFocus,
- int particleId, int amount, float minEnergy, float maxEnergy, float minFocus, float energyRatio, int minEUt) {
-
- return (TargetChamberRecipes.addRecipe(
- new RecipeTC(
- false,
- itemInput,
- itemOutput,
- itemFocus,
- particleId,
- amount,
- minEnergy,
- maxEnergy,
- minFocus,
- energyRatio,
- minEUt),
- false,
- false,
- false) != null);
-
- }
-
-}
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java
deleted file mode 100644
index 2c5eef4ea0..0000000000
--- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/BeamlineRecipeLoader.java
+++ /dev/null
@@ -1,194 +0,0 @@
-package com.elisis.gtnhlanth.common.tileentity.recipe.beamline;
-
-import java.util.Arrays;
-import java.util.HashMap;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidRegistry;
-
-import com.elisis.gtnhlanth.common.beamline.Particle;
-import com.elisis.gtnhlanth.common.item.MaskList;
-import com.elisis.gtnhlanth.common.register.LanthItemList;
-import com.elisis.gtnhlanth.common.register.WerkstoffMaterialPool;
-
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.material.ELEMENT;
-
-public class BeamlineRecipeLoader {
-
- public static final HashMap<String, Fluid> coolantMap = new HashMap<>();
-
- private static final ItemList[] VIABLE_WAFERS = new ItemList[] { ItemList.Circuit_Silicon_Wafer,
- ItemList.Circuit_Silicon_Wafer2, ItemList.Circuit_Silicon_Wafer3, ItemList.Circuit_Silicon_Wafer4,
- ItemList.Circuit_Silicon_Wafer5, ItemList.Circuit_Silicon_Wafer6, ItemList.Circuit_Silicon_Wafer7 };
-
- public static void load() {
-
- /*
- * Coolant list
- */
-
- coolantMap.put(
- Materials.LiquidNitrogen.getGas(1L)
- .getFluid()
- .getName(),
- Materials.Nitrogen.getGas(1L)
- .getFluid());
- coolantMap.put(
- Materials.LiquidOxygen.getGas(1L)
- .getFluid()
- .getName(),
- Materials.Oxygen.getGas(1L)
- .getFluid());
- coolantMap.put("ic2coolant", FluidRegistry.getFluid("ic2hotcoolant"));
- coolantMap.put(
- Materials.SuperCoolant.getFluid(1L)
- .getFluid()
- .getName(),
- Materials.Water.getFluid(1L)
- .getFluid());
-
- /*
- * ELECTRON
- */
- BeamlineRecipeAdder2.instance.addSourceChamberRecipe(
- new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Tungsten, 1) },
- null,
- Particle.ELECTRON.ordinal(),
- 20,
- 1000,
- 98,
- 0.1f,
- 7680);
-
- BeamlineRecipeAdder2.instance.addSourceChamberRecipe(
- new ItemStack[] { WerkstoffMaterialPool.LanthanumHexaboride.get(OrePrefixes.stickLong, 1) },
- null,
- Particle.ELECTRON.ordinal(),
- 60,
- 5000,
- 99,
- 0.3f,
- 7680);
-
- /*
- * NEUTRON
- */
- BeamlineRecipeAdder2.instance.addSourceChamberRecipe(
- new ItemStack[] { ELEMENT.getInstance().CALIFORNIUM.getDust(1) },
- null,
- Particle.NEUTRON.ordinal(),
- 10,
- 9000,
- 95,
- 999,
- 1920);
-
- /*
- * ALPHA
- */
- BeamlineRecipeAdder2.instance.addSourceChamberRecipe(
- new ItemStack[] { Materials.Uranium.getDust(1) },
- new ItemStack[] { WerkstoffMaterialPool.Thorium234.get(OrePrefixes.dust, 1) },
- Particle.ALPHA.ordinal(),
- 1,
- 4270,
- 90,
- 999,
- 480);
-
- /*
- * TARGET CHAMBER
- */
-
- for (MaskList mask : MaskList.values()) {
-
- if (mask.getProducedItem() == null) // Blank or error
- continue;
-
- int index = 0;
- for (ItemList wafer : VIABLE_WAFERS) {
-
- index++;
-
- if (!Arrays.asList(mask.getForbiddenWafers())
- .contains(wafer)) {
-
- BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
- wafer.get(1),
- GT_Utility.copyAmountUnsafe((int) Math.pow(2, index + 2), mask.getProducedItem()),
- new ItemStack(LanthItemList.maskMap.get(mask), 0),
- 1,
- mask.getBaselineAmount() * (int) Math.pow(Math.sqrt(3), index - 1), // 3x recipe amount increase
- // per 2 increases in wafer
- // tier. This greatly
- // incentivises the use of
- // higher tier boule wafer
- // recipes
- mask.getMinEnergy(),
- mask.getMaxEnergy(),
- mask.getMinFocus(),
- 1,
- 1920);
-
- }
-
- }
-
- /*
- * if (!Arrays.asList(MaskList.CPU.getForbiddenWafers()).contains(wafer)) {
- * BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1), GT_Utility.copyAmountUnsafe((int)
- * Math.pow(2, index + 2), ItemList.Circuit_Wafer_CPU.get(1)), //Varies new
- * ItemStack(LanthItemList.maskMap.get(MaskList.CPU), 0), // Varies 0, 10 * (int) Math.pow(2, index - 1), //
- * Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); } /* PPIC
- */
-
- /*
- * if (!Arrays.asList(MaskList.PPIC.getForbiddenWafers()).contains(wafer)) {
- * GT_Log.out.print("Adding recipe for PPIC with " + wafer.get(1).getUnlocalizedName() + " amount: " + 40 *
- * (int) Math.pow(2, index - 1)); BeamlineRecipeAdder.instance.addTargetChamberRecipe( wafer.get(1),
- * ItemList.Circuit_Wafer_PPIC.get((int) Math.pow(2, index + 2)), //Varies new
- * ItemStack(LanthItemList.maskMap.get(MaskList.PPIC), 0), // Varies 0, 40 * (int) Math.pow(2, index - 1),
- * // Varies 1, //Varies 10000000, //Varies 50, //Varies 1, 1920 ); }
- */
-
- }
- /*
- * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new
- * ItemStack(Items.diamond, 1), null, 1, 20, 100, 1000, 60, 1, 1920);
- * BeamlineRecipeAdder2.instance.addTargetChamberRecipe( new ItemStack(Items.coal, 1), new
- * ItemStack(Items.cooked_chicken, 1), null, 1, 20, 1, 10, 60, 1, 1920);
- */
-
- BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
- new ItemStack(Items.chicken, 1),
- new ItemStack(Items.cooked_chicken),
- null,
- Particle.PHOTON.ordinal(),
- 400,
- 5,
- 20,
- 80,
- 1,
- 7864320);
-
- BeamlineRecipeAdder2.instance.addTargetChamberRecipe(
- new ItemStack(Items.chicken, 1),
- new ItemStack(Items.egg),
- null,
- Particle.PHOTON.ordinal(),
- 400,
- 21,
- 600,
- 80,
- 1,
- 7864320);
-
- }
-}
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java
deleted file mode 100644
index 0d65421e67..0000000000
--- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeSC.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.elisis.gtnhlanth.common.tileentity.recipe.beamline;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-
-import com.elisis.gtnhlanth.common.register.LanthItemList;
-
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-
-public class RecipeSC extends GT_Recipe {
-
- public int particleId;
- public int rate;
- public float maxEnergy;
- public float focus;
- public float energyRatio;
-
- public RecipeSC(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances,
- FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int particleId, int rate,
- float maxEnergy, float focus, float energyRatio) {
-
- super(aOptimize, aInputs, aOutputs, null, aChances, null, null, aDuration, aEUt, 0);
-
- this.particleId = particleId;
- this.rate = rate;
- this.maxEnergy = maxEnergy;
- this.focus = focus;
- this.energyRatio = energyRatio;
- }
-
- @Override
- public ItemStack getRepresentativeOutput(int aIndex) {
-
- ArrayList<ItemStack> mOutputsWithParticle = new ArrayList<>();
-
- ItemStack particleStack = new ItemStack(LanthItemList.PARTICLE_ITEM);
-
- Items.ender_pearl.setDamage(particleStack, this.particleId);
-
- mOutputsWithParticle.addAll(Arrays.asList(mOutputs));
- mOutputsWithParticle.add(particleStack);
-
- ItemStack[] mOutputsWithParticleArray = mOutputsWithParticle.toArray(new ItemStack[0]);
-
- if (aIndex < 0 || aIndex >= mOutputsWithParticleArray.length) return null;
- return GT_Utility.copyOrNull(mOutputsWithParticleArray[aIndex]);
- }
-}
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java
deleted file mode 100644
index 49a5b64e1d..0000000000
--- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/RecipeTC.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.elisis.gtnhlanth.common.tileentity.recipe.beamline;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-
-import com.elisis.gtnhlanth.common.register.LanthItemList;
-
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
-
-public class RecipeTC extends GT_Recipe {
-
- public int particleId;
- public int amount;
-
- public float minEnergy;
- public float maxEnergy;
-
- public float minFocus;
- public float energyRatio;
-
- public ItemStack focusItem;
-
- public RecipeTC(boolean aOptimize, ItemStack aInput, ItemStack aOutput, ItemStack aFocusItem, int particleId,
- int amount, float minEnergy, float maxEnergy, float minFocus, float energyRatio, int aEUt) {
-
- super(
- aOptimize,
- new ItemStack[] { aFocusItem, aInput },
- new ItemStack[] { aOutput },
- null,
- null,
- null,
- null,
- 1,
- aEUt,
- 0);
-
- this.particleId = particleId;
- this.amount = amount;
-
- this.minEnergy = minEnergy;
- this.maxEnergy = maxEnergy;
-
- this.minFocus = minFocus;
-
- this.energyRatio = energyRatio;
-
- this.focusItem = aFocusItem;
- }
-
- @Override
- public ItemStack getRepresentativeInput(int aIndex) {
-
- ArrayList<ItemStack> mInputsWithParticle = new ArrayList<>();
-
- ItemStack particleStack = new ItemStack(LanthItemList.PARTICLE_ITEM);
- Items.ender_pearl.setDamage(particleStack, this.particleId);
-
- mInputsWithParticle.add(particleStack);
- mInputsWithParticle.addAll(Arrays.asList(mInputs));
-
- ItemStack[] mInputsWithParticleArray = mInputsWithParticle.toArray(new ItemStack[0]);
-
- if (aIndex < 0 || aIndex >= mInputsWithParticleArray.length) return null;
- return GT_Utility.copyOrNull(mInputsWithParticleArray[aIndex]);
- }
-
-}
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java
deleted file mode 100644
index 24282e54c6..0000000000
--- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/SourceChamberFrontend.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.elisis.gtnhlanth.common.tileentity.recipe.beamline;
-
-import gregtech.api.recipe.BasicUIPropertiesBuilder;
-import gregtech.api.recipe.NEIRecipePropertiesBuilder;
-import gregtech.api.recipe.RecipeMapFrontend;
-import gregtech.nei.RecipeDisplayInfo;
-
-public class SourceChamberFrontend extends RecipeMapFrontend {
-
- public SourceChamberFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
- NEIRecipePropertiesBuilder neiPropertiesBuilder) {
- super(uiPropertiesBuilder, neiPropertiesBuilder);
- }
-
- @Override
- public void drawDescription(RecipeDisplayInfo recipeInfo) {
- drawEnergyInfo(recipeInfo);
- // drawDurationInfo(recipeInfo); Unnecessary and misleading
- drawSpecialInfo(recipeInfo);
- drawMetadataInfo(recipeInfo);
- drawRecipeOwnerInfo(recipeInfo);
- }
-
-}
diff --git a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java b/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java
deleted file mode 100644
index 58b73fb58d..0000000000
--- a/src/main/java/com/elisis/gtnhlanth/common/tileentity/recipe/beamline/TargetChamberFrontend.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.elisis.gtnhlanth.common.tileentity.recipe.beamline;
-
-import static gregtech.api.util.GT_Utility.trans;
-
-import java.util.List;
-
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-
-import com.elisis.gtnhlanth.util.Util;
-import com.gtnewhorizons.modularui.api.math.Pos2d;
-
-import gregtech.api.recipe.BasicUIPropertiesBuilder;
-import gregtech.api.recipe.NEIRecipePropertiesBuilder;
-import gregtech.api.recipe.RecipeMapFrontend;
-import gregtech.api.util.GT_OverclockCalculator;
-import gregtech.api.util.GT_Utility;
-import gregtech.common.gui.modularui.UIHelper;
-import gregtech.nei.GT_NEI_DefaultHandler;
-import gregtech.nei.RecipeDisplayInfo;
-
-public class TargetChamberFrontend extends RecipeMapFrontend {
-
- public TargetChamberFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
- NEIRecipePropertiesBuilder neiPropertiesBuilder) {
- super(uiPropertiesBuilder, neiPropertiesBuilder);
- }
-
- public void drawDescription(RecipeDisplayInfo recipeInfo) {
- drawEnergyInfo(recipeInfo);
- // drawDurationInfo(recipeInfo);
- drawSpecialInfo(recipeInfo);
- drawMetadataInfo(recipeInfo);
- drawRecipeOwnerInfo(recipeInfo);
- }
-
- @Override
- protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) {
- if (stack.isNotConsumed()) { // The stack actually takes damage, but is technically still not considered to be
- // consumed by the code
- drawNEIOverlayText("PC", stack);
- }
- }
-
- @Override
- protected List<String> handleNEIItemInputTooltip(List<String> currentTip,
- GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
- if (pStack.isNotConsumed()) { // See above
- currentTip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("gtnhlanth.tt.pc")); // Partially
- // consumed:
- // Takes damage
- // in the
- // process
- }
- return currentTip;
- }
-
- @Override
- public void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {
- if (recipeInfo.calculator.getConsumption() <= 0) return;
-
- // recipeInfo.drawText(trans("152", "Total: ") + getTotalPowerString(recipeInfo.calculator));
-
- recipeInfo.drawText(trans("153", "Usage: ") + getEUtDisplay(recipeInfo.calculator));
- recipeInfo.drawText(trans("154", "Voltage: ") + getVoltageString(recipeInfo.calculator));
- recipeInfo.drawText(trans("155", "Amperage: ") + getAmperageString(recipeInfo.calculator));
-
- }
-
- @Override
- public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
- return UIHelper.getGridPositions(itemOutputCount, 128, 24, 1, 3); // Make output items display vertically, not
- // in a square
- }
-
- @Override
- public List<Pos2d> getItemInputPositions(int itemInputCount) {
-
- /*
- * Pos2d posParticle = new Pos2d(8, 28); // Particle item ArrayList<Pos2d> posList = new ArrayList<>();
- * posList.add(posParticle); posList.addAll(UIHelper.getGridPositions(itemInputCount - 1, 36, 28, 3));
- */
-
- List<Pos2d> posList = Util.getGridPositions(itemInputCount, 8, 20, 3, 1, 20);
- return posList;
- }
-
- private String getEUtDisplay(GT_OverclockCalculator calculator) {
- return getEUtWithoutTier(calculator);
- }
-
- private String getEUtWithoutTier(GT_OverclockCalculator calculator) {
- return GT_Utility.formatNumbers(calculator.getConsumption()) + " EU/t";
- }
-
- private String getVoltageString(GT_OverclockCalculator calculator) {
- long voltage = computeVoltageForEURate(calculator.getConsumption());
- return GT_Utility.formatNumbers(voltage) + " EU/t" + GT_Utility.getTierNameWithParentheses(voltage);
- }
-
- private long computeVoltageForEURate(long euPerTick) {
- return euPerTick;
- }
-
- private String getAmperageString(GT_OverclockCalculator calculator) {
- return GT_Utility.formatNumbers(1);
- }
-
-}