diff options
author | GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> | 2022-12-23 23:12:41 +0000 |
---|---|---|
committer | GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> | 2022-12-23 23:12:41 +0000 |
commit | 018bd02af26725c2f45f7141867c795b3614084e (patch) | |
tree | 063cb78d21a526057dd8203085ddec5d41e30f91 /src | |
parent | ffdccadd464f19dc1f985ea17f7346be674a2c21 (diff) | |
download | GT5-Unofficial-018bd02af26725c2f45f7141867c795b3614084e.tar.gz GT5-Unofficial-018bd02af26725c2f45f7141867c795b3614084e.tar.bz2 GT5-Unofficial-018bd02af26725c2f45f7141867c795b3614084e.zip |
NEI progress
Diffstat (limited to 'src')
9 files changed, 188 insertions, 142 deletions
diff --git a/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java index 07fbacb87a..9d4087ab7e 100644 --- a/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java +++ b/src/main/java/com/github/technus/tectech/nei/NEI_TT_Config.java @@ -19,11 +19,6 @@ public class NEI_TT_Config implements IConfigureNEI { // must be NEI*Config TT_RH = new TT_NEI_ResearchHandler(TT_recipe.GT_Recipe_MapTT.sResearchableFakeRecipes); TT_SH = new TT_NEI_ScannerHandler(TT_recipe.GT_Recipe_MapTT.sScannableFakeRecipes); TT_EOH = new TT_NEI_EyeOfHarmonyHandler(TT_recipe.GT_Recipe_MapTT.sEyeofHarmonyRecipes); - - sendHandler("gt.recipe.eyeofharmony", "gregtech:gt.blockmachines:15410", 1); - sendCatalyst("gt.recipe.eyeofharmony", "gregtech:gt.blockmachines:15410"); - - } sIsAdded = true; } @@ -38,33 +33,4 @@ public class NEI_TT_Config implements IConfigureNEI { // must be NEI*Config return "(1.0)"; } - private static void sendHandler(String aName, String aBlock, int aMaxRecipesPerPage) { - NBTTagCompound aNBT = new NBTTagCompound(); - aNBT.setString("handler", aName); - aNBT.setString("modName", "GregTech"); - aNBT.setString("modId", "gregtech"); - aNBT.setBoolean("modRequired", true); - aNBT.setString("itemName", aBlock); - aNBT.setInteger("handlerHeight", 135); - aNBT.setInteger("handlerWidth", 166); - aNBT.setInteger("maxRecipesPerPage", aMaxRecipesPerPage); - aNBT.setInteger("yShift", 6); - FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT); - } - - private static void sendHandler(String aName, String aBlock) { - sendHandler(aName, aBlock, 2); - } - - private static void sendCatalyst(String aName, String aStack, int aPriority) { - NBTTagCompound aNBT = new NBTTagCompound(); - aNBT.setString("handlerID", aName); - aNBT.setString("itemName", aStack); - aNBT.setInteger("priority", aPriority); - FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT); - } - - private static void sendCatalyst(String aName, String aStack) { - sendCatalyst(aName, aStack, 0); - } } diff --git a/src/main/java/com/github/technus/tectech/nei/TT_NEI_EyeOfHarmonyHandler.java b/src/main/java/com/github/technus/tectech/nei/TT_NEI_EyeOfHarmonyHandler.java index 76b264d3f2..13822059cd 100644 --- a/src/main/java/com/github/technus/tectech/nei/TT_NEI_EyeOfHarmonyHandler.java +++ b/src/main/java/com/github/technus/tectech/nei/TT_NEI_EyeOfHarmonyHandler.java @@ -1,35 +1,27 @@ package com.github.technus.tectech.nei; -import appeng.core.localization.GuiColors; +import static com.github.technus.tectech.Reference.MODID; +import static com.github.technus.tectech.util.CommonValues.EOH_TIER_FANCY_NAMES; +import static gregtech.api.util.GT_Utility.formatNumbers; + import appeng.util.ReadableNumberConverter; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; import com.github.technus.tectech.recipe.EyeOfHarmonyRecipe; -import com.github.technus.tectech.util.ItemStackLong; -import com.gtnewhorizons.modularui.api.GlStateManager; import cpw.mods.fml.common.event.FMLInterModComms; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import gregtech.nei.GT_NEI_DefaultHandler; -import gtPlusPlus.core.util.minecraft.ItemUtils; +import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; -import java.util.List; - -import static com.github.technus.tectech.Reference.MODID; -import static gregtech.api.util.GT_Utility.formatNumbers; - public class TT_NEI_EyeOfHarmonyHandler extends GT_NEI_DefaultHandler { public TT_NEI_EyeOfHarmonyHandler(final GT_Recipe.GT_Recipe_Map tMap) { @@ -46,15 +38,14 @@ public class TT_NEI_EyeOfHarmonyHandler extends GT_NEI_DefaultHandler { } } - @Override public TemplateRecipeHandler newInstance() { return new TT_NEI_EyeOfHarmonyHandler(this.mRecipeMap); } @Override - public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack aStack, List<String> currentToolTip, int aRecipeIndex) { - super.handleItemTooltip(gui, aStack, currentToolTip, aRecipeIndex); + public List<String> handleItemTooltip( + GuiRecipe<?> gui, ItemStack aStack, List<String> currentToolTip, int aRecipeIndex) { if (aStack == null) { return currentToolTip; @@ -70,10 +61,14 @@ public class TT_NEI_EyeOfHarmonyHandler extends GT_NEI_DefaultHandler { if (percentage != -1.0) { currentToolTip.add(EnumChatFormatting.GRAY + "Percentage of Solid Mass: " + percentage + "%"); - currentToolTip.add(EnumChatFormatting.GRAY + "Item Count: " + formatNumbers(currentRecipe.getItemStackToTrueStackSizeMap().get(aStack))); + currentToolTip.add(EnumChatFormatting.GRAY + "Item Count: " + + formatNumbers( + currentRecipe.getItemStackToTrueStackSizeMap().get(aStack))); } } + // So elements are displayed at bottom, call super method after. + super.handleItemTooltip(gui, aStack, currentToolTip, aRecipeIndex); return currentToolTip; } @@ -85,13 +80,11 @@ public class TT_NEI_EyeOfHarmonyHandler extends GT_NEI_DefaultHandler { EyeOfHarmonyRecipe EOHRecipe = (EyeOfHarmonyRecipe) recipe.mRecipe.mSpecialItems; if (EOHRecipe.getItemStackToTrueStackSizeMap().containsKey(stack.item)) { - drawOverlayForStack((FixedPositionedStack) stack, EOHRecipe.getItemStackToTrueStackSizeMap().get(stack.item)); + drawOverlayForStack( + (FixedPositionedStack) stack, + EOHRecipe.getItemStackToTrueStackSizeMap().get(stack.item)); } } -// for (PositionedStack stack : recipe.mOutputs) { -// if (!(stack instanceof FixedPositionedStack)) continue; -// drawOverlayForStack((FixedPositionedStack) stack); -// } } protected void drawOverlayForStack(FixedPositionedStack stack, long stackSize) { @@ -121,5 +114,29 @@ public class TT_NEI_EyeOfHarmonyHandler extends GT_NEI_DefaultHandler { super.drawOverlayForStack(stack); } -} + @Override + public void drawExtras(int aRecipeIndex) { + GT_NEI_DefaultHandler.CachedDefaultRecipe cachedRecipe = + ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)); + EyeOfHarmonyRecipe recipe = ((EyeOfHarmonyRecipe) cachedRecipe.mRecipe.mSpecialItems); + + int index = 0; + drawLine(index++, "Time: " + formatNumbers(recipe.getRecipeTimeInTicks() / 20) + " secs"); + drawLine(index++, "Hydrogen: " + formatNumbers(recipe.getHydrogenRequirement()) + " L"); + drawLine(index++, "Helium: " + formatNumbers(recipe.getHydrogenRequirement()) + " L"); + drawLine( + index++, + "Spacetime Tier: " + + EOH_TIER_FANCY_NAMES[(int) recipe.getSpacetimeCasingTierRequired()]); + drawLine(index++, "EU Output: " + formatNumbers(recipe.getEUOutput()) + " EU"); + drawLine(index++, "EU Input: " + formatNumbers(recipe.getEUStartCost()) + " EU"); + drawLine(index++, "Base Recipe Chance: " + formatNumbers(100 * recipe.getBaseRecipeSuccessChance()) + "%"); + drawLine(index, "Recipe Energy Efficiency: " + formatNumbers(100 * recipe.getRecipeEnergyEfficiency()) + "%"); + drawOverlays(cachedRecipe); + } + @Override + protected void drawLine(int lineNumber, String line) { + drawText(4, getDescriptionYOffset() + 30 + lineNumber * 9, line, 0xFF000000); + } +} 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 db30f9cc08..c323790288 100644 --- a/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java +++ b/src/main/java/com/github/technus/tectech/recipe/EyeOfHarmonyRecipe.java @@ -1,10 +1,9 @@ package com.github.technus.tectech.recipe; -import static com.google.common.math.LongMath.pow; +import static com.github.technus.tectech.recipe.EyeOfHarmonyRecipeStorage.BILLION; import static gregtech.api.util.GT_Utility.getPlasmaFuelValueInEUPerLiterFromMaterial; import com.github.technus.tectech.util.ItemStackLong; -import com.gtnewhorizons.modularui.api.math.Pos2d; import gnu.trove.map.TMap; import gnu.trove.map.hash.TCustomHashMap; import gnu.trove.strategy.HashingStrategy; @@ -14,7 +13,6 @@ 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; import org.apache.commons.lang3.tuple.Pair; import pers.gwyog.gtneioreplugin.util.GT5OreLayerHelper; @@ -40,8 +38,8 @@ public class EyeOfHarmonyRecipe { private final TMap<ItemStack, Double> itemStackToProbabilityMap = new TCustomHashMap<>(itemStackHashingStrategy); private final TMap<ItemStack, Long> itemStackToTrueStackSizeMap = new TCustomHashMap<>(itemStackHashingStrategy); - private final List<ItemStackLong> outputItems; - private final FluidStack[] outputFluids; + private final ArrayList<ItemStackLong> outputItems; + private final ArrayList<FluidStack> outputFluids; private final long hydrogenRequirement; private final long heliumRequirement; @@ -55,6 +53,8 @@ public class EyeOfHarmonyRecipe { private final long miningTimeSeconds; + private final double recipeEnergyEfficiency; + private final ItemStack recipeTriggerItem; public TMap<ItemStack, Double> getItemStackToProbabilityMap() { @@ -65,20 +65,28 @@ public class EyeOfHarmonyRecipe { return itemStackToTrueStackSizeMap; } + public double getRecipeEnergyEfficiency() { + return recipeEnergyEfficiency; + } + + private final long standardRecipeEUPerTick = 500 * BILLION; + public EyeOfHarmonyRecipe( - GT5OreLayerHelper.NormalOreDimensionWrapper normalOreDimensionWrapper, - GT5OreSmallHelper.SmallOreDimensionWrapper smallOreDimensionWrapper, - double recipeEnergyEfficiency, // E.g. 90% efficient = 0.9 = lose 10% EU from plasma + EU output. - long hydrogenRequirement, - long heliumRequirement, - long miningTimeSeconds, - long spacetimeCasingTierRequired, - Block block, - long euOutput, - double baseSuccessChance) { + final GT5OreLayerHelper.NormalOreDimensionWrapper normalOreDimensionWrapper, + final GT5OreSmallHelper.SmallOreDimensionWrapper smallOreDimensionWrapper, + final double recipeEnergyEfficiency, // E.g. 90% efficient = 0.9 = lose 10% EU from plasma + EU output. + final long hydrogenRequirement, + final long heliumRequirement, + final long miningTimeSeconds, + final long spacetimeCasingTierRequired, + final Block block, + final double baseSuccessChance) { + + this.euOutput = (long) ((recipeEnergyEfficiency / 2) * standardRecipeEUPerTick * miningTimeSeconds * 20); recipeTriggerItem = new ItemStack(block); + // Process recipes output items. // 6 * 64 = 6 stacks/second for VM tier 3 + Og gas. ArrayList<Pair<Materials, Long>> materialList = processDimension(normalOreDimensionWrapper, smallOreDimensionWrapper, miningTimeSeconds, 6 * 64); @@ -87,9 +95,8 @@ public class EyeOfHarmonyRecipe { this.outputItems.sort(Comparator.comparingLong(ItemStackLong::getStackSize)); Collections.reverse(this.outputItems); - long sumOfItems = this.outputItems.stream() - .map(ItemStackLong::getStackSize) - .reduce(0L, Long::sum); + long sumOfItems = + this.outputItems.stream().map(ItemStackLong::getStackSize).reduce(0L, Long::sum); for (ItemStackLong itemStackLong : outputItems) { double stackSize = (double) itemStackLong.getStackSize(); @@ -98,23 +105,47 @@ public class EyeOfHarmonyRecipe { itemStackToProbabilityMap.put(itemStackLong.itemStack, probability); itemStackToTrueStackSizeMap.put(itemStackLong.itemStack, itemStackLong.stackSize); } + // End item processing. + + // --- Output and process fluids of the recipe. + + // The idea behind this is to generate + + Pair<Long, ArrayList<FluidStack>> pair = validPlasmaGenerator(materialList); + // The idea behind this is to get e.g. + // totalEuOutput = timeRun * standardRecipeEUPerTick. + // recipeEnergyEfficiency * (10 EU * plasmaAmount + 100 EU * plasmaAmount) = totalEuOutput. + // Where 10 EU and 100 EU are the (plasmaFuelValues * maxTurbineEfficiency) of 1L of that specific plasma. + // Then we solve for plasmaAmount, so that each plasma has the same output amount. + long totalEUSumOfIndividualPlasmaFuels = pair.getLeft(); + ArrayList<FluidStack> fluidStackArrayList = pair.getRight(); + + for (FluidStack fluidStack : fluidStackArrayList) { + if (this.euOutput / totalEUSumOfIndividualPlasmaFuels < Integer.MAX_VALUE) { + // EU is split between Plasma output and EU output, hence /2. + // recipeEnergyEfficiency > 1 determines if this recipe makes more EU than you put in when you sum the + // EU in the plasma + the EU output. + fluidStack.amount = (int) ((recipeEnergyEfficiency * 0.01) * this.euOutput / totalEUSumOfIndividualPlasmaFuels); + } else { + // Hopefully won't happen but just in case. + fluidStack.amount = Integer.MAX_VALUE; + } + } - // --- Output fluids and sort them. - ArrayList<FluidStack> tmpFluidOutputs = validPlasmaGenerator(materialList, 0.1); - tmpFluidOutputs.sort(Comparator.comparingLong((FluidStack fluid) -> fluid.amount)); - Collections.reverse(tmpFluidOutputs); + // Add a bonus fluid of compressed star matter which is equal to 10% of 1 plasma fluid stacks output. + if (fluidStackArrayList.size() > 0) { + // todo replace with Bonus star matter when added to GT5. + fluidStackArrayList.add(Materials.Infinity.getMolten((long) (0.1 * fluidStackArrayList.get(0).amount))); + } - outputFluids = tmpFluidOutputs.toArray(new FluidStack[0]); - // End. +// Sort fluids by stack size. +// fluidStackArrayList.sort(Comparator.comparingLong((FluidStack fluid) -> fluid.amount)); +// Collections.reverse(fluidStackArrayList); - this.spacetimeCasingTierRequired = spacetimeCasingTierRequired; + outputFluids = fluidStackArrayList; + // End fluid processing. - // 20 ticks, 2^19 (1A UV) eu/t, mining - long euOfVMRunning = miningTimeSeconds * 20 * pow(2, 19); - long euValueOfPlasmas = plasmaCostCalculator(this.outputFluids); - - this.euStartCost = euOfVMRunning + euValueOfPlasmas; - this.euOutput = euOutput; + this.spacetimeCasingTierRequired = spacetimeCasingTierRequired; this.hydrogenRequirement = hydrogenRequirement; this.heliumRequirement = heliumRequirement; @@ -122,6 +153,10 @@ public class EyeOfHarmonyRecipe { this.baseSuccessChance = baseSuccessChance; this.miningTimeSeconds = miningTimeSeconds; + this.recipeEnergyEfficiency = recipeEnergyEfficiency; + + long a = (long) (recipeEnergyEfficiency * (plasmaCostCalculator(outputFluids) + this.euOutput) / 2); + this.euStartCost = a; } // Return clone of list. Deep copy. Maybe a better way to do this? @@ -134,6 +169,7 @@ public class EyeOfHarmonyRecipe { return copyOutputList; } + // Deep copy. public FluidStack[] getOutputFluids() { ArrayList<FluidStack> copyOutputList = new ArrayList<>(); @@ -200,7 +236,7 @@ public class EyeOfHarmonyRecipe { } } - static void processHelper(HashMapHelper outputMap, Materials material, double mainMultiplier, double probability) { + private static void processHelper(HashMapHelper outputMap, Materials material, double mainMultiplier, double probability) { outputMap.add(material.mDirectSmelting, (material.mOreMultiplier * 2) * mainMultiplier * probability); int index = 0; @@ -210,7 +246,7 @@ public class EyeOfHarmonyRecipe { } } - static ArrayList<Pair<Materials, Long>> processDimension( + private static ArrayList<Pair<Materials, Long>> processDimension( GT5OreLayerHelper.NormalOreDimensionWrapper normalOreDimWrapper, GT5OreSmallHelper.SmallOreDimensionWrapper smallOreDimWrapper, long timeInSeconds, @@ -239,20 +275,25 @@ public class EyeOfHarmonyRecipe { return outputList; } - static ArrayList<FluidStack> validPlasmaGenerator( - final List<Pair<Materials, Long>> planetList, final double percentageOfPlasma) { + private static Pair<Long, ArrayList<FluidStack>> validPlasmaGenerator( + final List<Pair<Materials, Long>> planetList) { ArrayList<FluidStack> plasmaList = new ArrayList<>(); + long sumOfPlasmasEU = 0; + for (Pair<Materials, Long> pair : planetList) { if (validPlasmas.contains(pair.getLeft())) { - plasmaList.add(pair.getLeft().getPlasma((int) (pair.getRight() * percentageOfPlasma))); + plasmaList.add(pair.getLeft().getPlasma(1)); + String plasmaString = pair.getLeft().getPlasma(1).getFluid().getUnlocalizedName(); + sumOfPlasmasEU += plasmaEnergyMap.getOrDefault(plasmaString, -100000000000000000L); } } - return plasmaList; + + return Pair.of(sumOfPlasmasEU, plasmaList); } - static ArrayList<ItemStackLong> validDustGenerator(final ArrayList<Pair<Materials, Long>> planetList) { + private static ArrayList<ItemStackLong> validDustGenerator(final ArrayList<Pair<Materials, Long>> planetList) { ArrayList<ItemStackLong> dustList = new ArrayList<>(); @@ -265,44 +306,50 @@ public class EyeOfHarmonyRecipe { return dustList; } - static long plasmaCostCalculator(FluidStack[] plasmas) { + private static long plasmaCostCalculator(ArrayList<FluidStack> plasmas) { long total = 0; for (FluidStack plasma : plasmas) { - total += (plasmaEnergyMap.get(plasma.getFluid()) * plasma.amount); + try { + String plasmaName = plasma.getFluid().getUnlocalizedName(); + total += plasmaEnergyMap.get(plasmaName) * plasma.amount; + } catch(Exception e) { + e.printStackTrace(); + } } return (long) (total * getMaxPlasmaTurbineEfficiency()); } - public static double getMaxPlasmaTurbineEfficiency() { + private static double getMaxPlasmaTurbineEfficiency() { // I hate Shirabon. -// return getMaxPlasmaTurbineEfficiency(); + // return getMaxPlasmaTurbineEfficiency(); return 3.85; } - static final List<Materials> validPlasmas = Stream.of( + private static final List<Materials> validPlasmas = Stream.of( Materials.Helium, - Materials.Boron, - Materials.Nitrogen, - Materials.Oxygen, - Materials.Sulfur, - Materials.Calcium, - Materials.Titanium, Materials.Iron, - Materials.Nickel, + Materials.Calcium, + Materials.Niobium, + Materials.Nitrogen, Materials.Zinc, Materials.Silver, - Materials.Tin, - Materials.Bismuth, + Materials.Titanium, + Materials.Radon, + Materials.Nickel, + Materials.Boron, + Materials.Sulfur, Materials.Americium, - Materials.Niobium) + Materials.Bismuth, + Materials.Oxygen, + Materials.Tin) .collect(Collectors.toList()); - static HashMap<Fluid, Long> plasmaEnergyMap = new HashMap<Fluid, Long>() { + private static final HashMap<String, Long> plasmaEnergyMap = new HashMap<String, Long>() { { validPlasmas.forEach((material -> put( - material.getPlasma(1).getFluid(), (long) getPlasmaFuelValueInEUPerLiterFromMaterial(material)))); + material.getPlasma(1).getFluid().getUnlocalizedName(), (long) (getPlasmaFuelValueInEUPerLiterFromMaterial(material) * getMaxPlasmaTurbineEfficiency())))); } }; } 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 00a3aec8b9..b03e032d2b 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,7 @@ package com.github.technus.tectech.recipe; import static com.github.technus.tectech.recipe.TT_recipe.GT_Recipe_MapTT.sEyeofHarmonyRecipes; +import static java.lang.Math.pow; import com.github.technus.tectech.util.ItemStackLong; import com.google.common.math.LongMath; @@ -16,7 +17,7 @@ import pers.gwyog.gtneioreplugin.util.GT5OreSmallHelper; public class EyeOfHarmonyRecipeStorage { - private static final long BILLION = LongMath.pow(10, 9); + public static final long BILLION = LongMath.pow(10, 9); // Map is unique so this is fine. HashMap<Block, String> blocksMapInverted = new HashMap<Block, String>() { @@ -39,19 +40,15 @@ public class EyeOfHarmonyRecipeStorage { new EyeOfHarmonyRecipe( GT5OreLayerHelper.dimToOreWrapper.get(dimAbbreviation), GT5OreSmallHelper.dimToSmallOreWrapper.get(dimAbbreviation), - 0.5 + blockDimensionDisplay.getDimensionRocketTier() / 10.0, - 100, - 100, // todo: DEBUG ONLY - - // BILLION * - // (blockDimensionDisplay.getDimensionRocketTier() + 1), - // BILLION * - // (blockDimensionDisplay.getDimensionRocketTier() + 1), - // 36_000L, - 2000L, // todo: debug only + 0.6 + blockDimensionDisplay.getDimensionRocketTier() / 10.0, + // 100, + // 100, // todo: DEBUG ONLY + BILLION * (blockDimensionDisplay.getDimensionRocketTier() + 1), + BILLION * (blockDimensionDisplay.getDimensionRocketTier() + 1), + (long) (18_000L * pow(1.4, blockDimensionDisplay.getDimensionRocketTier())), + // 2000L, // todo: debug only blockDimensionDisplay.getDimensionRocketTier(), blockDimensionDisplay, - 0, 1.0 - blockDimensionDisplay.getDimensionRocketTier() / 10.0)); } catch (Exception e) { e.printStackTrace(); 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 7fe66d4af9..ba2e68a7dd 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 @@ -260,10 +260,11 @@ public class TT_recipe extends GT_Recipe { 1, "", true, - false) // Custom NEI handler means this must be false. - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.DOWN) + false) // Custom NEI handler means this must be false. + .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN) + .setProgressBarPos(78+1, 24+2) .setUsualFluidOutputCount(18) - .setLogoPos(10,10); + .setLogoPos(10, 10).setNEIBackgroundSize(172, 82 + (9 + 10) * 18); public static GT_Recipe_MapTT sResearchableFakeRecipes = new GT_Recipe_MapTT( new HashSet<>(32), @@ -557,7 +558,7 @@ public class TT_recipe extends GT_Recipe { @Override public List<Pos2d> getFluidOutputPositions(int fluidOutputCount) { - return UIHelper.getItemGridPositions(fluidOutputCount, 8, yOrigin + 13 * 17 - 4, xDirMaxCount, 3); + return UIHelper.getItemGridPositions(fluidOutputCount, 8, yOrigin + 13 * 17 - 5, xDirMaxCount, 3); } @Override diff --git a/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java b/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java index ec1af39d80..dcc8bcb867 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/StabilisationFieldCasing.java @@ -16,6 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; @@ -36,7 +37,7 @@ public class StabilisationFieldCasing extends GT_Block_Casings_Abstract { for (int i = 0; i < maxBlockTier; i++) { GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + i + ".name", - EOH_TIER_FANCY_NAMES[i] + " Stabilisation Field Generator"); + EOH_TIER_FANCY_NAMES[i] + EnumChatFormatting.RESET + " Stabilisation Field Generator"); } CustomItemList.StabilisationFieldGeneratorTier0.set(new ItemStack(this, 1, 0)); diff --git a/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java b/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java index 6265084d5d..bb26f73228 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/TimeAccelerationFieldCasing.java @@ -16,6 +16,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; @@ -39,7 +40,7 @@ public class TimeAccelerationFieldCasing extends GT_Block_Casings_Abstract { for (int i = 0; i < maxBlockTier; i++) { GT_LanguageManager.addStringLocalization( getUnlocalizedName() + "." + i + ".name", - EOH_TIER_FANCY_NAMES[i] + " Time Dilation Field Generator"); + EOH_TIER_FANCY_NAMES[i] + EnumChatFormatting.RESET + " Time Dilation Field Generator"); } CustomItemList.TimeAccelerationFieldGeneratorTier0.set(new ItemStack(this, 1, 0)); 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 a45d121dd2..c1dad91583 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 @@ -6,6 +6,7 @@ import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBloc import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_Values.AuthorColen; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; +import static gregtech.api.util.GT_Utility.formatNumbers; import static java.lang.Math.*; import static net.minecraft.util.EnumChatFormatting.*; @@ -1531,14 +1532,14 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType("Spacetime Manipulator") .addInfo(GOLD + "--------------------------------------------------------------------------------") - .addInfo("Creates a pocket of spacetime that is bigger on the inside using") - .addInfo("transdimensional engineering. Certified Time Lord regulation compliant.") - .addInfo("This multi outputs too much EU to be handled with conventional means.") - .addInfo("All EU requirements are handled directly by your wireless EU network.") + .addInfo("Creates a pocket of spacetime that is bigger on the inside using transdimensional") + .addInfo("engineering. Certified Time Lord regulation compliant. This multi uses too much EU") + .addInfo("to be handled with conventional means. All EU requirements are handled directly by your") + .addInfo("your wireless EU network.") .addInfo(GOLD + "--------------------------------------------------------------------------------") - .addInfo("This multiblock will constantly consume hydrogen and helium when it is") - .addInfo("not running. It will store this internally, you can see the totals by") - .addInfo("using a scanner. This multi also has three tiered blocks with " + RED + "9" + GRAY + " tiers") + .addInfo("This multiblock will constantly consume hydrogen and helium when it is not running a") + .addInfo("recipe as fast as it can. It will store this internally, you can see the totals by") + .addInfo("using a scanner. This multi also has three tiered blocks with " + RED + 9 + GRAY + " tiers") .addInfo("each. They are as follows and have the associated effects on the multi.") .addInfo(BLUE + "Spacetime Compression Field Generator:") .addInfo("- The tier of this block determines what recipes can be run. If the multiblocks") @@ -1557,7 +1558,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl .addInfo(" Decreases the yield of a recipe by " + RED + "5%" + GRAY + " per tier (additive). ") .addInfo(GOLD + "--------------------------------------------------------------------------------") .addInfo("Computation/s provided to the multiblock can increase the chance by up to " + RED - + GT_Utility.formatNumbers(maxPercentageChanceGainFromComputationPerSecond * 100) + GRAY + + formatNumbers(maxPercentageChanceGainFromComputationPerSecond * 100) + GRAY + "%.") .addInfo("The associated formula is " + GREEN + "additional_chance = 0.3 * exp(10^(-5) * computation_per_second)" + GRAY + ".") @@ -1757,7 +1758,12 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl private double successChance; - private void outputFailedChance() {} + private void outputFailedChance() { + // todo Replace with proper fluid once added to GT. + int exoticMaterialOutputAmount = (int) ((successChance) * 1440 * (getHydrogenStored() + getHeliumStored()) / 1_000_000_000.0); + mOutputFluids = new FluidStack[] { Materials.Infinity.getFluid(exoticMaterialOutputAmount)}; + super.outputAfterRecipe_EM(); + } @Override public void stopMachine() { @@ -1863,8 +1869,18 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl str.add("Stabilisation Field Grade: " + BLUE + stabilisationFieldMetadata); str.add(GOLD + "----------------- Internal Fluids Stored ----------------"); validFluidMap.forEach((key, value) -> - str.add(BLUE + key.getLocalizedName() + RESET + " : " + RED + GT_Utility.formatNumbers(value))); - str.add(GOLD + "-----------------------------------------------------"); + str.add(BLUE + key.getLocalizedName() + RESET + " : " + RED + formatNumbers(value))); + str.add(GOLD + "---------------------- Other Stats ---------------"); + if (recipeRunning) { + str.add("Recipe Success Chance: " + formatNumbers(100 * successChance) + "%"); + str.add("Recipe Yield: " + formatNumbers(100 * successChance) + "%"); + str.add("EU Output: " + formatNumbers(euOutput)); + if (mOutputFluids.length > 0) { + // Star matter is always the last element in the array. + str.add("Estimated Star Matter Output: " + formatNumbers(mOutputFluids[mOutputFluids.length-1].amount)); + } + str.add(GOLD + "-----------------------------------------------------"); + } return str.toArray(new String[0]); } diff --git a/src/main/java/com/github/technus/tectech/util/CommonValues.java b/src/main/java/com/github/technus/tectech/util/CommonValues.java index a42ffa7f9b..e3456eafe2 100644 --- a/src/main/java/com/github/technus/tectech/util/CommonValues.java +++ b/src/main/java/com/github/technus/tectech/util/CommonValues.java @@ -32,7 +32,7 @@ public final class CommonValues { public static final long[] V = GT_Values.V; public static final String[] EOH_TIER_FANCY_NAMES = { - "Crude", "Primitive", "Stable", "Advanced", "Superb", "Exotic", "Perfect", "Tipler", "Gallifreyan" + "Crude", "Primitive", "Stable", "Advanced", "Superb", "Exotic", "Perfect", "Tipler", EnumChatFormatting.BOLD + "Gallifreyan" }; private CommonValues() {} |