Class TemperatureUnitLookup
java.lang.Object
com.github.thedeathlycow.thermoo.api.util.TemperatureUnitLookup
-
Method Summary
Modifier and TypeMethodDescriptionstatic TemperatureUnitGets the currently selected temperature unit from the player's currently selected language.static TemperatureUnitfromLanguageCode(String mcLanguageCode) Gets the temperature unit from the given language Minecraft language code.static TemperatureUnitGets the temperature unit from the default locale.static TemperatureUnitfromLocale(Locale locale) Gets the temperature unit from the given locale.
-
Method Details
-
fromCurrentLanguage
Gets the currently selected temperature unit from the player's currently selected language. For languages based on a language from the United States locale, this will be Fahrenheit. For all other locales, this is Celsius.Currently, the languages that will return Fahrenheit are English (U.S.), Hawaiian, and LOLCAT.
This method is only available on the client.
- Returns:
- Returns Fahrenheit if the currently selected language is from a US-based locale.
-
fromLanguageCode
Gets the temperature unit from the given language Minecraft language code. For languages based on a language from the United States locale, this will be Fahrenheit. For all other locales, this is Celsius.Currently, the languages that will return Fahrenheit are English (U.S.), Hawaiian, and LOLCAT.
- Returns:
- Returns Fahrenheit if the language code is from a US-based locale.
-
fromLocale
Gets the temperature unit from the default locale. For the United States, Liberia, and a few Caribbean countries, this is Fahrenheit. For all others it is Celsius.- Returns:
- Returns the temperature unit associated with the default locale
-
fromLocale
Gets the temperature unit from the given locale. For the United States, Liberia, and a few Caribbean countries, this is Fahrenheit. For all others it is Celsius.- Returns:
- Returns the temperature unit associated with the given locale
-