Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Creators
Details
Changelog
Ornithe Standard Libraries 0.17.0
OSL 0.17.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
OSL is now on Gen2!
From this point forward, all OSL releases will be for Gen2. Information on how to install Gen2 instances can be found on the Wiki.
Core 0.7.0
Namespaced Identifiers
This update brings namespaced identifiers, an OSL alternative for Vanilla's Identifier, available for all supported Minecraft versions. The base of this API is the NamespacedIdentifier interface. It defines the namespace and identifier components, which are equivalent to Identifiers namespace and path respectively.
The valid chars for namespace components are a-zA-Z0-9-_.. The valid chars for identifier components are a-zA-Z0-9-_./.
Factory methods for NamespacedIdentifiers can be found in the NamespacedIdentifiers class, along with validation methods. The NamespacedIdentifiers.from methods will throw exceptions if the constructed identifier is invalid.
For improved interoperability with Vanilla, Identifier is made to implement NamespacedIdentifier. This means you can pass Identifier objects in places in OSL's APIs where NamespacedIdentifier is expected.
Entrypoints 0.5.0
Custom Run Arguments
The API for parsing custom run arguments has been unified across Minecraft versions as well as between the client and server. JOptSimple is now used everywhere.
Keybinds 0.2.0
Minecraft versions below 1.3 are now supported.
Lifecycle Events 0.6.0
Minecraft game instance
Access to the Minecraft game instance is now provided through the MinecraftInstance class. An exception is thrown if the instance is not available (before initialization or after shutddown).
Minecraft server instance
Access to the MinecraftServer instance is now provided through the MinecraftServerInstance class. An exception is thrown if the instance is not available (before initialization or after shutddown).
Networking 0.9.0
The Networking API has been overhauled to be more consistent across Minecraft versions.
Custom payload channels
In previous versions, OSL relied entirely on Vanilla's definitions of custom payload channels. This meant Strings were used before 1.13 and Identifiers were used after 1.13. From this version on, the API uses NamespacedIdentifiers for channels, and OSL will handle the conversion internally.
To create a channel, use the factory methods in ChannelIdentifiers and register it in ChannelRegistry. For example:
NamespacedIdentifier COOKIE_CHANNEL = ChannelRegistry.register(ChannelIdentifiers.from("example", "cookie"))
Packet serialization
In previous versions, OSL relied on serialization methods provided by Vanilla. This meant DataInput and DataOutput were used before 1.7, and PacketByteBuf, a wrapper around Netty's ByteBuf, were used after 1.7. From this version on, the API provides its own ByteBuf implementation: PacketBuffer. It contains many of the same convenience methods PacketByteBuf does, but is used for every Minecraft version supported by the Networking API.
Packet listener context
Packet listeners are no longer given direct access to the game instance, network handler, or player instance. Instead, a context is provided though which these can be accessed. The context is also used to control asynchronous packet handling. For example:
ServerPlayNetworking.register(CookiePayload.CHANNEL, CookiePayload::new, (ctx, payload) -> {
// ensure following code is only executed from the main thread
ctx.ensureOnMainThread();
// access the current server, network handler, and player through the context
MinecraftServer server = ctx.server();
ServerPlayNetworkHandler networkHandler = ctx.networkHandler();
ServerPlayerEntity player = ctx.player();
})



