
Список изменений
Ornithe Standard Libraries 0.19.0
OSL 0.19.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
Core 0.8.0
- Added several internal utilities for other OSL APIs to use.
- Added
IOSupplier, aSupplierthat throwsIOExceptions. - Added
Unit, a singleton object.
Branding 0.4.3
Refactored some things to make use of new Core utilities.
Config 0.6.1
Fixed CLOSE_WORLD event not firing if the world is closed due to a level save conflict. This would lead to crashes upon joining another world.
Entrypoints 0.6.1
Suppressed a Mixin warning that would appear in logs.
Lifecycle Events 0.6.1
Fixed server STOP event firing twice on dedicated servers.
Localization 0.1.0
The Localization API split off from the Resource Loader API. It provides utilities for localizing text, and handles loading in mods' translation files.
Localizing Text
The L10n class provides utilities for localizing text.
// localizing a translation key
String localizedText = L10n.get("example.translationKey");
// localizing a translation key with formatting arguments
String localizedTextWithArgs = L10n.get("example.translationKey", "Some Arg", 1);
// localizing a translation key with a default value in case no localization exists
String localizedTextOrDefault = L10n.getOrDefault("example.translationKey", "Example Text");
// checking whether a localization for a translation key exists
boolean localizedTextExists = L10n.has("example.translationKey");
Providing Translations
Translation files can be added to your mod's resources and will be loaded automatically. While Minecraft natively only supports .lang files in versions 18w01a and below, and only .json files in 18w02a and above, the Localization API ensures both .lang and .json files are supported in any Minecraft version.
The Localization API also adds support for all-lowercase translation file names in 1.10.2 and below (e.g. en_us.lang instead of en_US.lang).
Localization in Minecraft Alpha and Beta
While Minecraft supports localization in Minecraft Beta, the only supported language is English (US). OSL's Localization API implements support for other languages, but none are provided by default and no GUI screen for switching languages is added.
Minecraft Alpha does not natively support localization at all, but OSL's Localization API implements the necessities for mods to make use of. Do note that OSL will not modify any Vanilla Minecraft text to localize it.
Resource Loader 0.7.0
This update to the Resource Loader API is a major rewrite. All internals and code APIs have changed, and mods that make use of them will most likely need to be updated. See the pull request for a detailed overview of the changes and update paths for mods that depend on the Resource Loader API.
Text Components 0.1 Alpha 2
- Added
TextComponents.builder()method for constructing components with a builder pattern. - Added
visitmethods toTextComponentfor reading components with a visitor pattern.