aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuXiu1997 <MuXiu1997@Gmail.com>2022-06-18 19:21:39 +0800
committerGitHub <noreply@github.com>2022-06-18 13:21:39 +0200
commit6d00f4e8d16133cf3ca132bb5903b47e7453a77e (patch)
tree82abd22bd00d8c15c40a92ebbed828152a03a18c
parenta1f9d28b85b0c31ae054fe30e53f66dcc2b80148 (diff)
downloadGT5-Unofficial-6d00f4e8d16133cf3ca132bb5903b47e7453a77e.tar.gz
GT5-Unofficial-6d00f4e8d16133cf3ca132bb5903b47e7453a77e.tar.bz2
GT5-Unofficial-6d00f4e8d16133cf3ca132bb5903b47e7453a77e.zip
Fix Werkstoff localization failure (#134)
Former-commit-id: 3403a331c17a7d62ed42afe40d873b2de3eb847a
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
index 119cf017d2..17b390713f 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
@@ -29,6 +29,7 @@ import com.github.bartimaeusnek.bartworks.util.MurmurHash3;
import com.github.bartimaeusnek.bartworks.util.NonNullWrappedHashMap;
import com.github.bartimaeusnek.bartworks.util.Pair;
import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler;
+import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.SubTag;
@@ -73,9 +74,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
private final HashSet<SubTag> SUBTAGS = new HashSet<>();
private byte[] rgb = new byte[3];
private final String defaultName;
- private final String localizedName;
+ private String localizedName;
private String toolTip;
- private final String localizedToolTip;
+ private String localizedToolTip;
private Werkstoff.Stats stats;
private final Werkstoff.Types type;
@@ -183,7 +184,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.mID = (short) mID;
this.defaultName = defaultName;
- this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName);
+ GregTech_API.sAfterGTPreload.add(() -> {
+ this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName);
+ });
this.stats = stats;
this.type = type;
this.generationFeatures = generationFeatures;
@@ -220,7 +223,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
// if (this.toolTip.length() > 25)
// this.toolTip = "The formula is to long...";
- this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip);
+ GregTech_API.sAfterGTPreload.add(() -> {
+ this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip);
+ });
if (this.stats.protons == 0) {
long tmpprotons = 0;