aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMuXiu1997 <MuXiu1997@Gmail.com>2022-07-02 11:21:44 +0800
committerGitHub <noreply@github.com>2022-07-02 10:21:44 +0700
commit279bbc9c42ea9f51ad107d94e1e36bd25fc0f665 (patch)
tree4190d34a47eef8b65c56ee524a44a00e20cef81a /src/main/java
parent746f08dacdbf6be5e239e9ce1856395a1bcef7ec (diff)
downloadGT5-Unofficial-279bbc9c42ea9f51ad107d94e1e36bd25fc0f665.tar.gz
GT5-Unofficial-279bbc9c42ea9f51ad107d94e1e36bd25fc0f665.tar.bz2
GT5-Unofficial-279bbc9c42ea9f51ad107d94e1e36bd25fc0f665.zip
Fix Werkstoff localization failure (#145)
Former-commit-id: 63da58dca81194b18c428ed12c45215d99c68407
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java12
1 files changed, 6 insertions, 6 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 49672d3706..9555b91ac5 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
@@ -75,9 +75,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
private final HashSet<SubTag> SUBTAGS = new HashSet<>();
private byte[] rgb = new byte[3];
private final String defaultName;
- private String localizedName;
private String toolTip;
- private String localizedToolTip;
private Werkstoff.Stats stats;
private final Werkstoff.Types type;
@@ -185,8 +183,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.mID = (short) mID;
this.defaultName = defaultName;
+ // Ensure that localization key are written to the lang file
GregTech_API.sAfterGTPreload.add(() -> {
- this.localizedName = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName);
+ this.getLocalizedName();
});
this.stats = stats;
this.type = type;
@@ -224,8 +223,9 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
// if (this.toolTip.length() > 25)
// this.toolTip = "The formula is to long...";
+ // Ensure that localization key are written to the lang file
GregTech_API.sAfterGTPreload.add(() -> {
- this.localizedToolTip = GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip);
+ this.getLocalizedToolTip();
});
if (this.stats.protons == 0) {
@@ -408,7 +408,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public String getLocalizedName() {
- return this.localizedName;
+ return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.name", this.mID), defaultName, !GregTech_API.sPostloadFinished);
}
public String getVarName() {
@@ -420,7 +420,7 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
}
public String getLocalizedToolTip() {
- return this.localizedToolTip;
+ return GT_LanguageManager.addStringLocalization(String.format("bw.werkstoff.%05d.tooltip", this.mID), toolTip, !GregTech_API.sPostloadFinished);
}
public Werkstoff.Stats getStats() {