Skip to content

Commit

Permalink
Merge branch 'master' into fix_convergence_nbt
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Nov 13, 2024
2 parents f21a1a5 + 479ab37 commit 775a197
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
20 changes: 20 additions & 0 deletions src/main/java/tectech/loader/ConfigHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class ConfigHandler {
public static Debug debug = new Debug();
public static TeslaTweaks teslaTweaks = new TeslaTweaks();

public static Visual visual = new Visual();

@Config.Comment("Debug section")
public static class Debug {

Expand Down Expand Up @@ -58,4 +60,22 @@ public static class TeslaTweaks {
@Config.DefaultBoolean(true)
public boolean TESLA_VISUAL_EFFECT;
}

@Config.Comment("Visual section")
public static class Visual {

@Config.Comment({ "Eye of Harmony energy input and output display:", " - 'Numerical': Shows the entire number",
" - 'Scientific': Uses scientific notation", " - 'SI': Uses the SI notation", })

@Config.DefaultEnum("Scientific")
@Config.RequiresMcRestart
public EOHNumberFormat EOH_NOTATION = EOHNumberFormat.Scientific;

public enum EOHNumberFormat {
Numerical,
Scientific,
SI
}
}

}
1 change: 0 additions & 1 deletion src/main/java/tectech/proxy/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@ public boolean isOnlineUUID(String uuid) {
}
return false;
}

}
26 changes: 18 additions & 8 deletions src/main/java/tectech/recipe/EyeOfHarmonyFrontend.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
import static tectech.util.CommonValues.EOH_TIER_FANCY_NAMES;
import static tectech.util.TTUtility.toExponentForm;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -33,6 +34,7 @@
import gregtech.nei.GTNEIDefaultHandler;
import gregtech.nei.RecipeDisplayInfo;
import gregtech.nei.formatter.INEISpecialInfoFormatter;
import tectech.loader.ConfigHandler;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
Expand Down Expand Up @@ -155,25 +157,33 @@ public List<String> format(RecipeDisplayInfo recipeInfo) {
GTLanguageManager.addStringLocalization("EOH.Recipe.SpacetimeTier", "Spacetime Tier") + ": "
+ EOH_TIER_FANCY_NAMES[(int) recipe.getSpacetimeCasingTierRequired()]);

if (recipe.getEUOutput() < TRILLION) {
result.add(
// Energy Output
switch (ConfigHandler.visual.EOH_NOTATION) {
case Numerical -> result.add(
GTLanguageManager.addStringLocalization("EOH.Recipe.EU.Out", "EU Output") + ": "
+ formatNumbers(recipe.getEUOutput())
+ " EU");
} else {
result.add(
case Scientific -> result.add(
GTLanguageManager.addStringLocalization("EOH.Recipe.EU.Out", "EU Output") + ": "
+ toExponentForm(recipe.getEUOutput())
+ " EU");
case SI -> result.add(
GTLanguageManager.addStringLocalization("EOH.Recipe.EU.Out", "EU Output") + ": "
+ ReadableNumberConverter.INSTANCE.toWideReadableForm(recipe.getEUOutput())
+ " EU");
}

if (recipe.getEUOutput() < TRILLION) {
result.add(
// Energy Input
switch (ConfigHandler.visual.EOH_NOTATION) {
case Numerical -> result.add(
GTLanguageManager.addStringLocalization("EOH.Recipe.EU.In", "EU Input") + ": "
+ formatNumbers(recipe.getEUStartCost())
+ " EU");
} else {
result.add(
case Scientific -> result.add(
GTLanguageManager.addStringLocalization("EOH.Recipe.EU.In", "EU Input") + ": "
+ toExponentForm(recipe.getEUStartCost())
+ " EU");
case SI -> result.add(
GTLanguageManager.addStringLocalization("EOH.Recipe.EU.In", "EU Input") + ": "
+ ReadableNumberConverter.INSTANCE.toWideReadableForm(recipe.getEUStartCost())
+ " EU");
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/tectech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1823,3 +1823,4 @@ tt.chat.debug.generator=Laser mode: %s
GT5U.gui.config.general.debug=Debug
GT5U.gui.config.general.features=Features
GT5U.gui.config.general.teslatweaks=Tesla Tweaks
GT5U.gui.config.general.visual=Visual

0 comments on commit 775a197

Please sign in to comment.