Skip to content

Commit

Permalink
fix: remove toLowerCase from CelestialObject
Browse files Browse the repository at this point in the history
  • Loading branch information
ROMVoid95 committed Oct 16, 2022
1 parent 5cd1443 commit fd255f9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/*
* Copyright (c) 2022 Team Galacticraft
*
* Licensed under the MIT license.
* See LICENSE file in the project root for details.
*/

package micdoodle8.mods.galacticraft.api.galaxies;

import java.util.Locale;
import java.util.function.Predicate;
import lombok.Setter;
import micdoodle8.mods.galacticraft.annotations.ReplaceWith;
import micdoodle8.mods.galacticraft.core.util.TranslateUtil;
import net.minecraft.util.text.translation.I18n;

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

public CelestialObject(String bodyName)
{
this.bodyName = bodyName.toLowerCase(Locale.ENGLISH);
this.bodyName = bodyName;
}

@Override
Expand All @@ -34,14 +39,7 @@ public String getName()

public String getTranslationKey()
{
return this.getCelestialType().getPrefix() + bodyName;
}

@Deprecated
@ReplaceWith("getCelestialType().getPrefix()")
public String getTranslationKeyPrefix()
{
return this.getCelestialType().getPrefix();
return this.getCelestialType().toString() + "." + bodyName;
}

public CelestialType getCelestialType()
Expand All @@ -56,7 +54,7 @@ public String getOwnerId()

public String getTranslatedName()
{
return TranslateUtil.getInstance().translate(this.getTranslationKey());
return I18n.translateToLocal(this.getTranslationKey());
}

public static Predicate<CelestialObject> filter(String modId)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/*
* Copyright (c) 2022 Team Galacticraft
*
* Licensed under the MIT license.
* See LICENSE file in the project root for details.
*/

package micdoodle8.mods.galacticraft.api.galaxies;

import java.util.Locale;
import micdoodle8.mods.galacticraft.annotations.ReplaceWith;
import micdoodle8.mods.galacticraft.api.vector.Vector3;
import micdoodle8.mods.galacticraft.core.util.TranslateUtil;

public class SolarSystem extends CelestialObject
{
Expand All @@ -14,7 +19,7 @@ public class SolarSystem extends CelestialObject

public SolarSystem(String solarSystem, String parentGalaxy)
{
super(CelestialType.SOLARSYSTEM, solarSystem.toLowerCase(Locale.ENGLISH));
super(CelestialType.SOLARSYSTEM, solarSystem);
this.unlocalizedGalaxyName = parentGalaxy;
}

Expand Down Expand Up @@ -49,7 +54,7 @@ public SolarSystem setMainStar(Star star)

public String getTranslatedParentGalaxyName()
{
return TranslateUtil.getInstance().translate(this.getTranslationKey());
return super.getTranslatedName();
}

public String getParentGalaxyTranslationKey()
Expand Down

This file was deleted.

0 comments on commit fd255f9

Please sign in to comment.