aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core
diff options
context:
space:
mode:
author梅天佑 <52530814+MeiTianyou@users.noreply.github.com>2023-05-16 23:20:41 +0800
committerGitHub <noreply@github.com>2023-05-16 17:20:41 +0200
commitcf0afb6f8246408293f5702c27487cc19aa16b41 (patch)
treebf84cf614e282cab72023cf05fa80762cd911c9a /src/main/java/gtPlusPlus/core
parent04514282c08ebefdb3e68a46db34092f72be2316 (diff)
downloadGT5-Unofficial-cf0afb6f8246408293f5702c27487cc19aa16b41.tar.gz
GT5-Unofficial-cf0afb6f8246408293f5702c27487cc19aa16b41.tar.bz2
GT5-Unofficial-cf0afb6f8246408293f5702c27487cc19aa16b41.zip
Fixes several minor bugs (#630)
* Always store at least 2048 EU regardless of tier, so that the machine can work properly should close #11190 in GTNewHorizons/GT-New-Horizons-Modpack * change tooltip to match real formula should close #13238 in GTNewHorizons GT-New-Horizons-Modpack * shot in the dark to fix some chemical formulas * Fix hardcoded formula for ZrF_4 * fix nitinol formula * Add a method to count uppercase characters * A better shot at fixing chemical formulas Added ghetto detection of when there is more than 1 element in a grouping, even when their symbols combined don't exceed three characters (like hydroxide) * fix material components in ammonium tetrafluoroberyllate last in a series of commits designed to resolve #11340 in GTNewHorizons/GT-New-Horizons-Modpack * Add a method that only exposes the data orb selected by the circuot * Make the duplicator only check for recipes with the selected data orb Should close #11583 in GTNewHorizons/GT-New-Horizons-Modpack * Change TGS tooltip to reflect real behavior * Change TGS info in NEI to reflect true behavior Should close #11650 in GTNewHorizons/GT-New-Horizons-Modpack * Don't remove energy from the PSS when it attempts to fill a full hatch should resolve #13317 in GTNewHorizons/GT-New-Horizons-Modpack, where the issues was mistakenly identified as the PSS accepting power when it is full. In fact, it does stop accepting power when full, but it is constantly leaking power into hatches. However it should be noted that unless the PSS has no hatches, it pays a tax each tick which will of course mean that it is almost never going to be filled up. * Fix some minor errors due to writing all previous commmits with github's file-view edit feature try it sometime and suffer! also spotless apply * better formatting * off by one * add a line for power loss in the gui * fix 0iq moment * Revert "Don't remove energy from the PSS when it attempts to fill a full hatch" This reverts commit c20cc0b3a528872c8003bea2944aa1ad7a020e01. * typo * additional typo * Delete layout.json merp
Diffstat (limited to 'src/main/java/gtPlusPlus/core')
-rw-r--r--src/main/java/gtPlusPlus/core/material/ELEMENT.java2
-rw-r--r--src/main/java/gtPlusPlus/core/material/Material.java6
-rw-r--r--src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java7
-rw-r--r--src/main/java/gtPlusPlus/core/util/data/StringUtils.java4
4 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/gtPlusPlus/core/material/ELEMENT.java b/src/main/java/gtPlusPlus/core/material/ELEMENT.java
index 666de12f53..1ee1b79cdd 100644
--- a/src/main/java/gtPlusPlus/core/material/ELEMENT.java
+++ b/src/main/java/gtPlusPlus/core/material/ELEMENT.java
@@ -651,7 +651,7 @@ public final class ELEMENT {
40,
51,
true,
- "⚷⚙⚷ Ni4Ti6",
+ StringUtils.subscript("⚷⚙⚷ Ni4Ti6"),
0); // Not a GT Inherited Material
public static final Material HYPOGEN = new Material(
"Hypogen",
diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java
index 1d926742cb..6e1c9b8b92 100644
--- a/src/main/java/gtPlusPlus/core/material/Material.java
+++ b/src/main/java/gtPlusPlus/core/material/Material.java
@@ -1342,7 +1342,8 @@ public class Material {
if (!aChemSymbol.equals("??")) {
if (dummyFormulaArray[e] > 1) {
- if (aChemFormula.length() > 3) {
+ if (aChemFormula.length() > 3
+ || StringUtils.uppercaseCount(aChemFormula) > 1) {
dummyFormula = dummyFormula + "("
+ aChemFormula
+ ")"
@@ -1351,7 +1352,8 @@ public class Material {
dummyFormula = dummyFormula + aChemFormula + dummyFormulaArray[e];
}
} else if (dummyFormulaArray[e] == 1) {
- if (aChemFormula.length() > 3) {
+ if (aChemFormula.length() > 3
+ || StringUtils.uppercaseCount(aChemFormula) > 1) {
dummyFormula = dummyFormula + "(" + aChemFormula + ")";
} else {
dummyFormula = dummyFormula + aChemFormula;
diff --git a/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
index fab71be1bf..0e2e0b7e76 100644
--- a/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
+++ b/src/main/java/gtPlusPlus/core/material/nuclear/FLUORIDES.java
@@ -95,7 +95,7 @@ public class FLUORIDES {
-1,
-1,
false,
- "ZrF4",
+ "ZrF\u2084",
-1,
true,
false,
@@ -169,7 +169,7 @@ public class FLUORIDES {
new MaterialStack[] { new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1),
new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2) });
- // (NH4)2Be(OH)2 / (NH4)2BeF4
+ // (NH4)2BeF4
public static final Material AMMONIUM_TETRAFLUOROBERYLLATE = new Material(
"Ammonium Tetrafluoroberyllate", // Material Name
MaterialState.PURE_LIQUID, // State
@@ -181,7 +181,8 @@ public class FLUORIDES {
false, // Uses Blast furnace?
// Material Stacks with Percentage of required elements.
new MaterialStack[] { new MaterialStack(MISC_MATERIALS.AMMONIUM, 2),
- new MaterialStack(FLUORIDES.BERYLLIUM_HYDROXIDE, 1) });
+ new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1),
+ new MaterialStack(ELEMENT.getInstance().FLUORINE, 4) });
// LFTR Output
public static final Material NEPTUNIUM_HEXAFLUORIDE = new Material(
diff --git a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
index d837901ea8..76cd82b096 100644
--- a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java
@@ -222,4 +222,8 @@ public class StringUtils {
return aFound;
}
}
+
+ public static long uppercaseCount(String aString) {
+ return aString.chars().filter((c) -> Character.isUpperCase(c)).count();
+ }
}