diff --git a/src/main/java/magicbees/bees/BeeMutation.java b/src/main/java/magicbees/bees/BeeMutation.java index 53ff5e2..e349306 100644 --- a/src/main/java/magicbees/bees/BeeMutation.java +++ b/src/main/java/magicbees/bees/BeeMutation.java @@ -493,7 +493,7 @@ public class BeeMutation implements IBeeMutation if (moonPhaseStart != moonPhaseEnd) { conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhase"), - moonPhaseStart.getLocalizedName(), moonPhaseEnd.getLocalizedName())); + moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt())); } else { diff --git a/src/main/java/magicbees/main/utils/MoonPhase.java b/src/main/java/magicbees/main/utils/MoonPhase.java index 6a6c9c2..d1ad42a 100644 --- a/src/main/java/magicbees/main/utils/MoonPhase.java +++ b/src/main/java/magicbees/main/utils/MoonPhase.java @@ -5,8 +5,7 @@ import net.minecraft.world.World; /** * Class to abstract the moon phase from the world time a bit. */ -public enum MoonPhase -{ +public enum MoonPhase { FULL("full"), WANING_GIBBOUS("gibbousWaning"), WANING_HALF("halfWaning"), @@ -18,22 +17,18 @@ public enum MoonPhase private String phaseName; - private MoonPhase(String name) - { + private MoonPhase(String name) { this.phaseName = name; } - public boolean isBetween(MoonPhase first, MoonPhase second) - { + public boolean isBetween(MoonPhase first, MoonPhase second) { boolean flag = false; - if (first.ordinal() <= second.ordinal()) - { + if (first.ordinal() <= second.ordinal()) { // Straightforward. flag = first.ordinal() <= this.ordinal() && this.ordinal() <= second.ordinal(); } - else - { + else { // Wraps around the boundary. flag = (first.ordinal() <= this.ordinal() && this.ordinal() <= WAXING_GIBBOUS.ordinal()) || (FULL.ordinal() <= this.ordinal() && this.ordinal() <= second.ordinal()); @@ -42,18 +37,23 @@ public enum MoonPhase return flag; } - public String getLocalizedName() - { + public String getLocalizedName() { return LocalizationManager.getLocalizedString("moon." + this.phaseName); } + + public String getLocalizedNameAlt() { + String response = LocalizationManager.getLocalizedString("moon.alt." + this.phaseName); + if (response.isEmpty()) { + return getLocalizedName(); + } + return response; + } - public static MoonPhase getMoonPhase(World w) - { + public static MoonPhase getMoonPhase(World w) { return getMoonPhaseFromTime(w.getWorldTime()); } - public static MoonPhase getMoonPhaseFromTime(long time) - { + public static MoonPhase getMoonPhaseFromTime(long time) { return MoonPhase.values()[(int)((time - 6000) / 24000L) % 8]; } } diff --git a/src/main/resources/assets/magicbees/lang/en_US.lang b/src/main/resources/assets/magicbees/lang/en_US.lang index 697d211..3c887bc 100644 --- a/src/main/resources/assets/magicbees/lang/en_US.lang +++ b/src/main/resources/assets/magicbees/lang/en_US.lang @@ -172,7 +172,7 @@ liquid.cryotheum=Gelid Cryotheum liquid.mana=Primal Mana liquid.coal=Liquifacted Coal -#Moondial +#Moondial & Mutation moon phase conditions moon.full=Full Moon moon.gibbousWaning=Waning Gibbous moon.gibbousWaxing=Waxing Gibbous @@ -182,6 +182,17 @@ moon.crescentWaning=Waning Crescent moon.crescentWaxing=Waxing Crescent moon.new=New Moon +# Alternate moon names for languages that require a different kind of localization. Remove # to activate. +# If missing, will fall back on the non-alternate versions. +#moon.alt.full= +#moon.alt.gibbousWaning= +#moon.alt.gibbousWaxing= +#moon.alt.halfWaning= +#moon.alt.halfWaxing= +#moon.alt.crescentWaning= +#moon.alt.crescentWaxing= +#moon.alt.new= + #Backpack backpack.thaumaturge=Thaumaturge's Backpack