Skip to content

Commit fd255f9

Browse files
committed
fix: remove toLowerCase from CelestialObject
1 parent 5cd1443 commit fd255f9

File tree

3 files changed

+20
-92
lines changed

3 files changed

+20
-92
lines changed

src/main/java/micdoodle8/mods/galacticraft/api/galaxies/CelestialObject.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
/*
2+
* Copyright (c) 2022 Team Galacticraft
3+
*
4+
* Licensed under the MIT license.
5+
* See LICENSE file in the project root for details.
6+
*/
7+
18
package micdoodle8.mods.galacticraft.api.galaxies;
29

3-
import java.util.Locale;
410
import java.util.function.Predicate;
511
import lombok.Setter;
6-
import micdoodle8.mods.galacticraft.annotations.ReplaceWith;
7-
import micdoodle8.mods.galacticraft.core.util.TranslateUtil;
12+
import net.minecraft.util.text.translation.I18n;
813

914
public abstract class CelestialObject implements ICelestial
1015
{
@@ -23,7 +28,7 @@ public CelestialObject(CelestialType type, String bodyName)
2328

2429
public CelestialObject(String bodyName)
2530
{
26-
this.bodyName = bodyName.toLowerCase(Locale.ENGLISH);
31+
this.bodyName = bodyName;
2732
}
2833

2934
@Override
@@ -34,14 +39,7 @@ public String getName()
3439

3540
public String getTranslationKey()
3641
{
37-
return this.getCelestialType().getPrefix() + bodyName;
38-
}
39-
40-
@Deprecated
41-
@ReplaceWith("getCelestialType().getPrefix()")
42-
public String getTranslationKeyPrefix()
43-
{
44-
return this.getCelestialType().getPrefix();
42+
return this.getCelestialType().toString() + "." + bodyName;
4543
}
4644

4745
public CelestialType getCelestialType()
@@ -56,7 +54,7 @@ public String getOwnerId()
5654

5755
public String getTranslatedName()
5856
{
59-
return TranslateUtil.getInstance().translate(this.getTranslationKey());
57+
return I18n.translateToLocal(this.getTranslationKey());
6058
}
6159

6260
public static Predicate<CelestialObject> filter(String modId)

src/main/java/micdoodle8/mods/galacticraft/api/galaxies/SolarSystem.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
/*
2+
* Copyright (c) 2022 Team Galacticraft
3+
*
4+
* Licensed under the MIT license.
5+
* See LICENSE file in the project root for details.
6+
*/
7+
18
package micdoodle8.mods.galacticraft.api.galaxies;
29

3-
import java.util.Locale;
410
import micdoodle8.mods.galacticraft.annotations.ReplaceWith;
511
import micdoodle8.mods.galacticraft.api.vector.Vector3;
6-
import micdoodle8.mods.galacticraft.core.util.TranslateUtil;
712

813
public class SolarSystem extends CelestialObject
914
{
@@ -14,7 +19,7 @@ public class SolarSystem extends CelestialObject
1419

1520
public SolarSystem(String solarSystem, String parentGalaxy)
1621
{
17-
super(CelestialType.SOLARSYSTEM, solarSystem.toLowerCase(Locale.ENGLISH));
22+
super(CelestialType.SOLARSYSTEM, solarSystem);
1823
this.unlocalizedGalaxyName = parentGalaxy;
1924
}
2025

@@ -49,7 +54,7 @@ public SolarSystem setMainStar(Star star)
4954

5055
public String getTranslatedParentGalaxyName()
5156
{
52-
return TranslateUtil.getInstance().translate(this.getTranslationKey());
57+
return super.getTranslatedName();
5358
}
5459

5560
public String getParentGalaxyTranslationKey()

src/main/java/micdoodle8/mods/galacticraft/core/util/TranslateUtil.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)