From 975bf105794ac48b1415d4e78946449fbb68bcaf Mon Sep 17 00:00:00 2001 From: Tec Date: Tue, 18 Jan 2022 22:25:23 +0100 Subject: Cleanup some Locale --- .../tectech/loader/recipe/RecipeLoader.java | 2 +- .../core/definitions/EMPrimitiveTemplate.java | 11 +++++----- .../definitions/complex/EMAtomDefinition.java | 7 +++--- .../definitions/complex/EMHadronDefinition.java | 25 +++++++++++----------- .../definitions/primitive/EMBosonDefinition.java | 3 ++- .../definitions/primitive/EMLeptonDefinition.java | 3 ++- .../primitive/EMNeutrinoDefinition.java | 3 ++- .../primitive/EMPrimitiveDefinition.java | 3 ++- .../definitions/primitive/EMQuarkDefinition.java | 3 ++- 9 files changed, 34 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java b/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java index 3572e601e4..b5333c8e0d 100644 --- a/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/recipe/RecipeLoader.java @@ -35,7 +35,7 @@ public class RecipeLoader implements Runnable { @Override public void run() { - EMAtomDefinition.setTransformation(); + EMAtomDefinition.setTransformations(); EMHadronDefinition.setTransformations(); // =================================================================================================== diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java index f3ce34dd1d..b529b79cc0 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/core/definitions/EMPrimitiveTemplate.java @@ -1,5 +1,6 @@ package com.github.technus.tectech.mechanics.elementalMatter.core.definitions; +import com.github.technus.tectech.mechanics.elementalMatter.core.EMException; import com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay; import com.github.technus.tectech.mechanics.elementalMatter.core.maps.EMConstantStackMap; import com.github.technus.tectech.mechanics.elementalMatter.core.transformations.EMFluidDequantizationInfo; @@ -61,11 +62,6 @@ public abstract class EMPrimitiveTemplate extends EMComplexTemplate { EMDefinitionsRegistry.registerForDisplay(this); } - @Override - public String getLocalizedName() { - return "Undefined: " + getName(); - } - @Override public String getSymbol() { return symbol; @@ -183,6 +179,11 @@ public abstract class EMPrimitiveTemplate extends EMComplexTemplate { return nbt; } + @Override + protected final int getIndirectTagValue() { + throw new EMException("This class should only be used directly!"); + } + @Override public final byte getClassType() { return getClassTypeStatic(); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java index 666249f408..878c2a6627 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMAtomDefinition.java @@ -33,6 +33,7 @@ import static com.github.technus.tectech.mechanics.elementalMatter.definitions.p import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; import static com.github.technus.tectech.util.XSTR.XSTR_INSTANCE; import static gregtech.api.enums.OrePrefixes.dust; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 18.11.2016. @@ -348,7 +349,7 @@ public final class EMAtomDefinition extends EMComplexTemplate { if (DEBUG_MODE) { e.printStackTrace(); } - return (negative ? "Element: ~" : "Element: ") + element; + return translateToLocal("tt.keyword.Element")+(negative ? ": ~" : ": ") + element; } } @@ -1476,7 +1477,7 @@ public final class EMAtomDefinition extends EMComplexTemplate { } } - public static void setTransformation(){ + public static void setTransformations(){ /*----STABLE ATOMS----**/ refMass = getFirstStableIsotope(1).getMass() * AVOGADRO_CONSTANT_144; @@ -1666,7 +1667,7 @@ public final class EMAtomDefinition extends EMComplexTemplate { @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { - lines.add("CLASS = " + nbtType + ' ' + getClassType()); + lines.add("CLASS = " + getIndirectTagValue() + ' ' + getClassType()); } if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = "+ getLocalizedName()); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java index a901f5c8fc..70092aa735 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/complex/EMHadronDefinition.java @@ -31,6 +31,7 @@ import static com.github.technus.tectech.mechanics.elementalMatter.core.transfor import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMBosonDefinition.boson_Y__; import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_scanner.*; import static gregtech.api.enums.OrePrefixes.dust; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 17.11.2016. @@ -141,7 +142,7 @@ public final class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize public String getLocalizedName() { StringBuilder name= new StringBuilder(getSimpleName()); name.append(':'); - String sym= NAME_MAP.get(this); + String sym= translateToLocal(NAME_MAP.get(this)); if(sym!=null){ name.append(' ').append(sym); }else { @@ -155,17 +156,17 @@ public final class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize private String getSimpleName() { switch (getAmount()) { case 2: - return "Meson"; + return translateToLocal("tt.keyword.Meson"); case 3: - return "Baryon"; + return translateToLocal("tt.keyword.Baryon"); case 4: - return "Tetraquark"; + return translateToLocal("tt.keyword.Tetraquark"); case 5: - return "Pentaquark"; + return translateToLocal("tt.keyword.Pentaquark"); case 6: - return "Hexaquark"; + return translateToLocal("tt.keyword.Hexaquark"); default: - return "Hadron"; + return translateToLocal("tt.keyword.Hadron"); } } @@ -413,22 +414,22 @@ public final class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize //redefine the proton with proper lifetime (the lifetime is based on mass comparison) hadron_p = new EMHadronDefinition(new EMConstantStackMap(EMQuarkDefinition.quark_u.getStackForm(2), EMQuarkDefinition.quark_d.getStackForm(1))); SYMBOL_MAP.put(hadron_p,"p"); - NAME_MAP.put(hadron_p,"Proton"); + NAME_MAP.put(hadron_p,translateToLocal("tt.keyword.Proton")); EMDefinitionsRegistry.getStacksRegisteredForDisplay().add(hadron_p); hadron_p_ = (EMHadronDefinition) hadron_p.getAnti(); SYMBOL_MAP.put(hadron_p_,"~p"); - NAME_MAP.put(hadron_p_,"Anti Proton"); + NAME_MAP.put(hadron_p_,translateToLocal("tt.keyword.AntiProton")); EMDefinitionsRegistry.getStacksRegisteredForDisplay().add(hadron_p_); hadron_n = new EMHadronDefinition(new EMConstantStackMap(EMQuarkDefinition.quark_u.getStackForm(1), EMQuarkDefinition.quark_d.getStackForm(2))); neutronMass = hadron_n.getMass(); //redefine the neutron with proper lifetime (the lifetime is based on mass comparison) hadron_n = new EMHadronDefinition(new EMConstantStackMap(EMQuarkDefinition.quark_u.getStackForm(1), EMQuarkDefinition.quark_d.getStackForm(2))); SYMBOL_MAP.put(hadron_n, "n"); - NAME_MAP.put(hadron_n, "Neutron"); + NAME_MAP.put(hadron_n,translateToLocal("tt.keyword.Neutron")); EMDefinitionsRegistry.getStacksRegisteredForDisplay().add(hadron_n); hadron_n_ = (EMHadronDefinition) hadron_n.getAnti(); SYMBOL_MAP.put(hadron_n_,"~n"); - NAME_MAP.put(hadron_n_,"Anti Neutron"); + NAME_MAP.put(hadron_n_,translateToLocal("tt.keyword.AntiNeutron")); EMDefinitionsRegistry.getStacksRegisteredForDisplay().add(hadron_n_); } catch (EMException e) { if (DEBUG_MODE) { @@ -491,7 +492,7 @@ public final class EMHadronDefinition extends EMComplexTemplate {//TODO Optimize @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) { - lines.add("CLASS = " + nbtType + ' ' + getClassType()); + lines.add("CLASS = " + getIndirectTagValue() + ' ' + getClassType()); } if(Util.areBitsSet(SCAN_GET_NOMENCLATURE|SCAN_GET_CHARGE|SCAN_GET_MASS|SCAN_GET_TIMESPAN_INFO, capabilities)) { lines.add("NAME = "+getSimpleName()); diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMBosonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMBosonDefinition.java index 5f14eefcdb..f20f872a6e 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMBosonDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMBosonDefinition.java @@ -7,6 +7,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMP import static com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay.*; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMLeptonDefinition.*; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMQuarkDefinition.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 22.10.2016. @@ -35,7 +36,7 @@ public final class EMBosonDefinition extends EMPrimitiveTemplate { @Override public String getLocalizedName() { - return "Boson: " + getName(); + return translateToLocal("tt.keyword.Boson")+": " + getName(); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java index 0f9898775f..38e537ec59 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMLeptonDefinition.java @@ -7,6 +7,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMP import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMBosonDefinition.*; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMBosonDefinition.boson_Y__; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMNeutrinoDefinition.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 22.10.2016. @@ -59,7 +60,7 @@ public final class EMLeptonDefinition extends EMPrimitiveTemplate { @Override public String getLocalizedName() { - return "Lepton: " + getName(); + return translateToLocal("tt.keyword.Lepton")+": " + getName(); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java index ac06a80728..9af7b97cb4 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMNeutrinoDefinition.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.EMDefini import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMPrimitiveTemplate; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMBosonDefinition.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 22.10.2016. @@ -49,7 +50,7 @@ public final class EMNeutrinoDefinition extends EMPrimitiveTemplate { @Override public String getLocalizedName() { - return "Lepton: " + getName(); + return translateToLocal("tt.keyword.Neutrino")+": " + getName(); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java index e4a92fbae1..41da06567d 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMPrimitiveDefinition.java @@ -3,6 +3,7 @@ package com.github.technus.tectech.mechanics.elementalMatter.definitions.primiti import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMPrimitiveTemplate; import static com.github.technus.tectech.mechanics.elementalMatter.core.decay.EMDecay.NO_DECAY; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 22.10.2016. @@ -29,7 +30,7 @@ public final class EMPrimitiveDefinition extends EMPrimitiveTemplate { @Override public String getLocalizedName() { - return "Primitive: " + getName(); + return translateToLocal("tt.keyword.Primitive")+": " + getName(); } @Override diff --git a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMQuarkDefinition.java b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMQuarkDefinition.java index 9afa04d243..3f19205aeb 100644 --- a/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMQuarkDefinition.java +++ b/src/main/java/com/github/technus/tectech/mechanics/elementalMatter/definitions/primitive/EMQuarkDefinition.java @@ -5,6 +5,7 @@ import com.github.technus.tectech.mechanics.elementalMatter.core.definitions.EMP import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMLeptonDefinition.*; import static com.github.technus.tectech.mechanics.elementalMatter.definitions.primitive.EMNeutrinoDefinition.*; +import static net.minecraft.util.StatCollector.translateToLocal; /** * Created by danie_000 on 22.10.2016. @@ -96,7 +97,7 @@ public final class EMQuarkDefinition extends EMPrimitiveTemplate { @Override public String getLocalizedName() { - return "Quark: " + getName(); + return translateToLocal("tt.keyword.Quark")+": " + getName(); } @Override -- cgit