Ornithe Standard Libraries (OSL) provides tools for modding with Ornithe.
Libraries
Core API
The Core API provides common utilities used by other modules, such as an events system and registries.
Blocks API
The Blocks API provides events and utilities for creating custom blocks.
Branding API
This module patches the title screen with mod loader information in 16w05a and below, emulating what you would see in 16w05b and above. This is done by parsing the run args for the versionType option.
Config API
The Config API provides a framework for building and storing mod configs.
Entrypoints API
The Entrypoints API allows mod developers to submit entrypoints that are called before the game is initialized.
Executors API
This module patches the game instance so it can be used as an Executor, and provides a background executor service for background tasks.
Items API
The Items API provides events and utilities for creating custom items.
Keybinds API
The keybinds API provides events for registering keybinds.
Lifecycle Events API
The Lifecycle Events API provides events to track the lifecycle of the Minecraft client and server.
Localization
The Localization API provides utilities for localizing text and handles loading in mods' translation files.
Networking API
The Networking API provides a framework for client-server communication.
Resource Loader API
The Resource Loader API allows mods to load their own resources into the game.
Text Components API
This module provides an alternative to Minecraft's Text components.
Information for developers
Our Ploceus gradle plugin provides helper methods for adding OSL dependencies to your projects:
dependencies {
...
ploceus.dependOsl('0.20.1')
}
You can also add dependencies on individual OSL modules:
dependencies {
...
ploceus.dependOslModule('0.20.1', 'core')
ploceus.dependOslModule('0.20.1', 'entrypoints')
} How to Install Ornithe Standard Libraries (Mod)
Ornithe Standard Libraries by Unknown is verified for Ornithe across Minecraft versions 1.0, 1.1, 1.10, 1.10-pre1, 1.10-pre2, 1.10.1, 1.10.2, 1.11 (latest release: 0.22.2, file size: 5.1 MB). Follow the steps below to install it safely from ModCraft.tv:
- Click the Download button above and select your Minecraft version (1.0, 1.1, 1.10, 1.10-pre1, 1.10-pre2, 1.10.1, 1.10.2, 1.11) and platform (Ornithe).
- Make sure you have the compatible loader or environment installed for Ornithe.
- Move the downloaded Ornithe Standard Libraries file into your Minecraft
.minecraft/modsfolder and launch the game.
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
| 2mo ago | 120 | ||||
| 2mo ago | 60 | ||||
| 2mo ago | 40 | ||||
| 2mo ago | 30 | ||||
| 2mo ago | 24 | ||||
| 2mo ago | 20 | ||||
| 2mo ago | 17 | ||||
| 2mo ago | 15 | ||||
| 2mo ago | 13 | ||||
| 2mo ago | 12 | ||||
| 2mo ago | 11 | ||||
| 2mo ago | 10 | ||||
| 2mo ago | 9 | ||||
| 2mo ago | 9 | ||||
| 2mo ago | 8 | ||||
| 2mo ago | 8 | ||||
| 2mo ago | 7 | ||||
| 2mo ago | 7 | ||||
| 2mo ago | 6 | ||||
| 2mo ago | 6 | ||||
| 2mo ago | 6 | ||||
| 2mo ago | 5 | ||||
| 2mo ago | 5 | ||||
| 2mo ago | 5 | ||||
| 2mo ago | 5 | ||||
| 2mo ago | 5 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 4 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 3 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 2 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 |
OSL 0.22.2 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Block States 0.1.1
Fixed module for 15w47a-1.9.3-pre1 not loading, which prevented the Blocks and Items APIs to load for these versions as well.
## Localization 0.1.3
Fixed server-side translations in 1.1-1.5.
## Items 0.3.1
Fixed
ClassNotFoundException in b1.9-pre3.OSL 0.22.1 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Changes
OSL now bundles [Conditional Mixin](https://github.com/OrnitheMC/conditional-mixin/) 1.0.0.
## Entities 0.1.1
Fixes a crash in Alpha 1.1.x.
- note: to fix the crash, a Vanilla multiplayer bug was fixed where all sheep and cows appear as chickens on the client.
OSL 0.22.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Core 0.11.0
### Direction and BlockPos
The Core API now provides its own
Direction enum and BlockPos class. These provide the same functionality as the equivalent Vanilla classes in 1.8 and above, but are available for all supported Minecraft versions. They are utilized by the new Block States API in 1.7 and below.## Registries 0.2.0
### Registry Keys
Expanded the
RegistryKeys class with registry keys for biome, block entity, and entity registries.### Legacy String IDs
Namespaced IDs were introduced in 1.7 for blocks and items, and were slowly adopted for other registries in subsequent updates. Namespaced IDs are all lowercase and use snake\_case. Legacy
String IDs were not namespaced and were usually PascalCase instead. These legacy IDs cannot be used as namespaced IDs without some form of conversion.The
LegacyStringIds class provides methods to convert between namespaced IDs and the legacy format String IDs.For legacy ID -> namespaced ID conversion, this means:
- Converting strings from PascalCase to snake\_case. Consecutive uppercase letters are assumed to be an abbreviation and stick together:
TNTMinecart->tnt_minecart. - A
.-separated prefix is assumed to be a namespace:example.Cookie->example:cookie. If the ID has no such prefix, theminecraftnamespace is assumed.
For namespaced ID -> legacy ID conversion, this means:
- Converting strings from snake\_case to PascalCase:
minecart_tnt->MinecartTnt. - Namespaces are prefixed to the ID, separated by a
.-character:example:cookie->example.Cookie. For IDs with theminecraftnamespace no prefix is attached.
### Registry Sync
- Added new built-in ID-mapper:
DynamicInt2ObjectMapMapper, for maps whose contents may change throughout a world session. - When remapping registries, old numerical ID values will be re-used when possible, preventing unnecessary increase of numerical ID values.
- Improved logging of errors during remapping.
## Block States 0.1.0
The Block States API implements block states in 1.7.10 and below, and extends functionality in 1.8 and above.
### Block States in 1.7.10-
- Many methods in
Blockthat take inintparameters for block data values, directions and coordinates, are deprecated in favor of equivalent methods that take inBlockState,Direction, andBlockPosparameters. - The
WorldView,WorldChunk, andWorldChunkSectionclasses have been extended withBlockStategetters and setters. - A
StatefulBlockimplementation is provided that forwards calls to the deprecated methods to the equivalent methods that use block states. - The chunk format is not modified whatsoever. The block state getters and setters convert block states to/from block IDs and block data values and call the existing block ID and block data value getters and setters.
example usage:
```java
package com
...
OSL 0.21.1 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Networking 0.10.1
### Fixes
- Fixed memory leaks.
- Fixed crash when disconnected from the server before login.
## Resource Loader 0.8.1
### Fixes
- Improve logging of errors when reading
pack.mcmeta. - Fixes NPEs and crashes when resource pack summary cannot be parsed.
## Text Components 0.1 Alpha 6
The JSON format of OSL text components now supports hex color notation using a
# prefix.OSL 0.21.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Core 0.10.0
All of the Core API's registry classes (
SimpleIdRegistry, DefaultedIdRegistry, IdBiMap) have been deprecated in favor of the new Registries API introduced in this update. They will be removed in a future update.### Namespaced Identifiers
Namespaced identifiers created through
NamespacedIdentifiers factory methods no longer allow uppercase letters ([A-Z]).``
java
NamespacedIdentifiers.from("example", "Thing"); // this will now throw an error
NamespacedIdentifiers.from("example", "thing"); // this is still valid
`
New prefixed and suffixed methods have been added to create derivative namespaced identifiers with a prefix or suffix.
`java
NamespacedIdentifier id = NamespacedIdentifiers.parse("example:cookie");
NamespacedIdentifier prefixed = id.prefixed("blocks/"); // -> "example:blocks/cookie"
NamespacedIdentifier suffixed = id.suffixed(".json"); // -> "example:cookie.json"
`
## Registries 0.1.0
The Registries API provides an alternative to Vanilla's registry system, with a more modern feature set and available for all Minecraft versions. Not all of Vanilla's registries are registered in the new registry system (only the block and item registries are at this time), but this will change over time as OSL's feature set expands.
This update also provides a Registry Sync API for synchronizing numerical IDs between the server and client and across game sessions, to help avoid network desync and world corruption bugs.
I want to give a shoutout to [Cat Core](https://github.com/thecatcore/), who helped develop and test this API and the accompanying changes in the Blocks and Items APIs.
### Events
The BOOTSTRAP_REGISTRIES event is fired on game start-up, during bootstrapping. All registries should be loaded before this or in a listener to this event. Bootstrapping registries (i.e. populating their contents) may happen before this, but will be forced right after this event anyway.
`java
RegistryEvents.BOOTSTRAP_REGISTRIES.register(() -> {
...
});
`
### Registries
Registries should be created and registered in your mod's entrypoint:
`java
public class ExampleInitializer implements ModInitializer {
@Override
public void init() {
ExampleRegistries.init();
}
}
`
`java
public final class ExampleRegistries {
public static final ResourceKey<Registry<CookieRecipe>> COOKIE_RECIPE_REGISTRY = RegistryKeys.from(NamespacedIdentifiers.from("example", "cookie_recipe"));
public static final Registry<CookieRecipe> COOKIE_RECIPE = Registries.registerDefaulted(COOKIE_RECIPE_RECIPES, NamespacedIdentifiers.from("example", "chocolate_chip"), CookieRecipes::init);
public static void init() {
}
}
`
``javapublic final class CookieRecipes {
public static final CookieRecipe CHOCOLATE_CHIP = Registry.register(ExampleRegistries.COOKIE_RECIPE, NamespacedIdentifiers.from("example", "cho
...
OSL 0.20.3 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Resource Loader 0.7.4
- Fixed more texture pack issues.
OSL 0.20.2 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Resource Loader 0.7.3
- Fixed texture pack resetting to default on game start-up.
OSL 0.20.1 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Blocks 0.1.1
- Fixed being unable to place blocks in air in Minecraft 1.1 and below.
## Text Components 0.1 Alpha 3
Now supports Minecraft Alpha 1.0.1_01-1.0.17_04
OSL 0.20.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Core 0.9.0
Added new registry utilities for the Blocks and Items APIs.
## Blocks 0.1.0
The Blocks API provides events and utilities for registering blocks.
### Events
REGISTER_BLOCKS: this event is invoked right after Vanilla block registration is completed. Mods should register blocks in listeners to this event.
### Block Registry
The
BlockRegistry class provides public access to the block registry, including a helper method for registering blocks.``
java
int getId(Block)
NamespacedIdentifier getKey(Block)
Block getBlock(int)
Block getBlock(NamespacedIdentifier)
Set<NamespacedIdentifier> keySet()
// 17w46a-
Block register(int, NamespacedIdentifier, Block)
// 17w47a+
Block register(NamespacedIdentifier, Block)
`
### Block Extension
This API extends the Block class with some functionality from later Minecraft versions.
- Added
boolean isAir() method in 17w46a and below.Added boolean is(Block) method in 1.6.4 and below.
### Usage
`java
package com.example;
import net.ornithemc.osl.blocks.api.BlockEvents;
import net.ornithemc.osl.entrypoints.api.ModInitializer;
public class ExampleInitializer implements ModInitializer {
@Override
public void init() {
BlockEvents.REGISTER_BLOCKS.register(ExampleBlocks::init);
}
}
`
`java
package com.example;
import net.minecraft.block.Block;
import net.ornithemc.osl.blocks.api.BlockRegistry;
import net.ornithemc.osl.core.util.NamespacedIdentifiers;
public final class ExampleBlocks {
public static final CookieBlock COOKIE = BlockRegistry.register(NamespacedIdentifiers.from("example", "cookie"), new CookieBlock());
public static void init() {
}
}
`
## Items 0.1.0
The Items API provides events and utilities for registering items.
### Events
REGISTER_ITEMS: this event is invoked right after Vanilla item registration is completed. Mods should register items in listeners to this event.REGISTER_BLOCK_ITEMS (for 1.6.4 and below only): this event is invoked right after Vanilla block item registration is completed. Mods should register block items in listeners to this event.
### Item Registry
The ItemRegistry class provides public access to the item registry, including helper methods for registering items.
`java
int getId(Item)
NamespacedIdentifier getKey(Item)
Item getItem(int)
Item getItem(NamespacedIdentifier)
Set<NamespacedIdentifier> keySet()
Item register(Block)
Item register(Block, Item)
Item register(BlockItem)
// 17w46a-
Item register(int, NamespacedIdentifier, Item)
// 17w47a+
Item register(NamespacedIdentifier, Item)
`
### Usage
``javapackage com.example;
import net.ornithemc.osl.entrypoints.api.ModInitializer;
import net.ornithemc.osl.items.api.ItemEvents;
public class ExampleInitializer implements ModInitializer {
@Override
public void init() {
ItemEvents.REGISTER_ITEMS.register(ExampleItems::init);
...
OSL 0.19.3 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Resource Loader 0.7.2
Fixes direct path resource access from the default resource pack not working in 1.6-1.12.
OSL 0.19.2 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Config 0.6.2
Fixes a crash in b13-b1.7 when joining a multiplayer server, caused by the crash fix from 0.19.0.
OSL 0.19.1 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Resource Loader 0.7.1
Fixes a bug where only one mod resource pack would be used for a resource even if other mod resource packs provided that same resource as well.
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.``
java
// 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](https://github.com/OrnitheMC/ornithe-standard-libraries/pull/62) 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...OSL 0.18.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Core 0.7.1
The Core API now provides a transitive injected interface for Vanilla's
Identifier class implementing OSL's NamespacedIdentifier.## Branding 0.4.2
Fixes the version string used in Alpha 1.2.1_01 and earlier. The format now matches that used in following versions.
## Entrypoints 0.6.0
The
init entrypoint is now invoked *before* client-init and -server-init. This change was made in order to match behavior from Fabric Loader's entrypoints.
## Lifecycle Events
Now supports Beta 1.3.
## Executors 0.1.0
This new API provides access to the main game instances as java.util.concurrent.Executors, and supplies a background executor for running tasks off the main game thread.
The Minecraft and MinecraftServer classes are made to implement Executor. Any tasks submitted are guaranteed to run on the main game thread. If called from a different thread, the task will be queued to be run at the start of the next tick. Instances can be acquired using the Lifecycle Events API.
`java
MinecraftInstance.get().execute(
// this code is guaranteed to be run on the main client thread!
);
`
The background executor can be acquired through the net.ornithemc.osl.executors.api.BackgroundExecutor class.
`java
BackgroundExecutor.get().execute(
// this code is guaranteed to be run on a background thread!
);
`
## Networking Implementation 0.1.1
Fixes a crash due to a Mixin injection failure in late 1.7 snapshots.
## Text Components 0.1 Alpha 1
This new API provides an alternative to Vanilla's chat component system. This is an Alpha release of this API and changes are very likely, so use with caution!
Text components can be made using factory methods in the net.ornithemc.osl.text.api.TextComponents class. Text components can be converted into legacy formatted strings as well.
`java
TextComponent text = TextComponents.literal("this is a text component")
.format(Formatting.BOLD)
.append(" - and this is another one!");
String string = text.buildFormattedString();
``OSL 0.17.2 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
## Resource Loader 0.6.1
- Fixes crashes when mod resources are accessed before the game is done initializing.
- Fixes crashes in
findResourcesif the search directory does not exist.