Tags
Creators
Details
0.23.0
Compatibility
Changes
Ornithe Standard Libraries 0.23.0
OSL 0.23.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
Core 0.12.0
Namespaced Identifiers
New functionality has been added to namespaced identifiers, and a change has been made to equality checks.
NamespacedIdentifier {
// Returns the char used as the separator in the String-representation of the namespaced identifier.
// This separator is also used to check equality of namespaced identifiers.
char separator();
// Returns a copy of this namespaced identifier with the given namespace.
NamespacedIdentifier namespaced(String namespace);
// Returns a copy of this namespaced identifier where the identifier is a substring of this identifier.
NamespacedIdentifier subidentifier(int beginIndex);
// Returns a copy of this namespaced identifier where the identifier is a substring of this identifier.
NamespacedIdentifier subidentifier(int beginIndex, int endIndex);
}
New functionality has also been added to the NamespacedIdentifiers utility class, in the form of various isValid methods that return a boolean result. These complement the various validate methods that throw an exception on invalid input.
NamespacedIdentifiers {
// Returns whether the given namespaced identifier conforms to spec (only chars a-z0-9-._/ allowed).
static boolean isValid(NamespacedIdentifier identifier);
// Returns whether the given String is a valid namespace.
static boolean isValidNamespace(String namespace);
// Returns whether the given String is a valid identifier.
static boolean isValidIdentifier(String identifier);
// Returns whether the given char is allowed in the String representation of a namespaced identifier.
static boolean isCharAllowed(char chr);
}
A change has been made to the NamespacedIdentifiers#equals(NamespacedIdentifier, NamespacedIdentifier) method. It now also checks equality of the NamespacedIdentifier#separator() result in addition to equality of the NamespacedIdentifier#namespace() and NamespacedIdentifier#identifier results.
Topological Sorting
Added TopoSort utility class, which can perform as topological sort on a list of nodes, given all the incoming edges for each node.
Executors 0.1.1
Added ReentrantDirectExecutor, an Executor that handles reentrance with a queue. This is internal API for the Resource Loader API.
Block States 0.2.0
Block Entity Extension
- Fixed several server-side Mixin issues that caused crashes in dedicated server environments in 12w42a and below.
- To aid in fixing above issue, some methods were added to
BlockEntityon the server side in 12w42a and below.
BlockEntity {
// Returns the block at this block entity's position in the world.
Block getBlock();
// Returns the metadata of the block at this block entity's position in the world.
int getBlockMetadata();
}
Entities 0.1.2
Fixed a NoSuchMethodError in 1.9-1.10 when registering a spawn egg through EntityTypeRegistry#registerSpawnEgg(EntityType, int, int).
Networking 0.11.0 & 0.12.0
Channel Identifiers
Serialization of channel identifiers has been changed to be more consistent and versatile.
Previously, the way channels identifiers were converted to and from Strings was different in 1.13-pre2 and below vs 1.13-pre4 and above.
In 1.13-pre4 and above, Vanilla uses Identifiers for custom payload channels, and OSL does as well. As such, there is no special handling for String conversions, and the standard colon-separated format is used: <namespace>:<identifier>.
ChannelIdentifiers.from("example", "cookie"); // String representation -> "example:cookie"
In 1.13-pre2 and below, Vanilla uses Strings for custom payload channels, with no validation exception for limiting the length to 20 (or 16 in older versions). However, by convention, a sort of namespaced identifier is used with a vertical bar separator (|). All channel identifiers made through OSL were serialized to this legacy format.
ChannelIdentifiers.from("EXAMPLE", "Cookie"); // String representation -> "EXAMPLE|Cookie"
Changes
- Channel identifiers created through
ChannelIdentifiers.from()now ALWAYS serialize to the standard colon-separated format. - New factory
ChannelIdentifiers.legacy()methods have been added that create channel identifiers that ALWAYS serialize to the legacy vertical-bar-separated format. StringChannelIdentifierParsercan now parse both kinds of identifiers fromStrings.
ChannelIdentifiers.from("example", "cookie"); // String representation -> "example:cookie"
ChannelIdentifiers.legacy("example", "cookie"); // String representation -> "example|cookie"
New register methods have been added as well as a short-hand for channel construction and registration.
ChannelIdentifiers.register("example", "cookie");
// the line above is equivalent to the line below
ChannelRegistry.register(ChannelIdentifiers.from("example", "cookie"));
Packet Buffers
New (de)serialization methods have been added to PacketBuffer.
PacketBuffer {
// Reads a collection from this PacketBuffer.
// The constructor takes in the size of the collection as an int.
// The reader reads individual elements from this PacketBuffer.
<T, C extends Collection<T>> C readCollection(IntFunction<C> constructor, Function<PacketBuffer, T> reader);
// Similar to readCollection, but pre-configured to return a List
<T> List<T> readCollection(Function<PacketBuffer, T> reader);
// Writes the given collection to this PacketBuffer.
// The writer takes in this PacketBuffer and an element and writes that element to the buffer.
<T> ByteBuf writeCollection(Collection<T> collection, BiConsumer<PacketBuffer, T> writer);
// Reads an OSL TextComponent from this PacketBuffer.
// The TextComponent is parsed from stringified JSON.
TextComponent readTextComponent();
// Writes the given OSL TextComponent to this PacketBuffer.
// The text component is written as stringified JSON.
ByteBuf writeTextComponent(TextComponent text);
}
Client Connection Events
A new method has been added to client connection context objects.
ConnectionContext {
// still exists but deprecated and may be removed in the future
@Deprecated
default boolean isServerLocal() {
return !this.isMultiplayer();
}
// Returns whether connected to a multiplayer game or a singleplayer game.
boolean isMultiplayer();
}
Registries 0.3.0 & 0.3.1
Networking
The Registry Sync packet now used ID osl:registries in all versions (was previously osl|registries in 1.13-pre2 and below).
Fixes
Fixed several Mixin issues in dedicated server environments in 12w17a and below, which lead to crashes.
Resource Loader 0.9.0
Fixes
- Improved behavior on game start-up. Previously resource reloads would run twice in certain versions below 1.6.
- Fixed profiling giving incorrect data on reload times for individual reloaders in 1.13 and below.
- Fixed vanilla reload listeners not being profiled during game start-up.
- Fixed
NoSuchMethodErrorwhen opening the resource packs screen in 13w26a-1.7.10 when mod-provided virtual resource packs were present.
Triggering Resource Reloads.
A reloadResources() method has been added to Minecraft with the same purpose and function as the existing Vanilla method in 1.6 and above: it refreshes the pack repository, triggers a full resource reload, and updates the world renderer if necessary.
Texture Packs In Early Alpha
- Support for loading texture packs from the
.minecraft/texturepacks/folder has been added to early Alpha versions (a1.2.1_01 and below).- No texture packs screen has been added, but a texture pack is selected from the
skinoption inoptions.txtjust like in a1.2.2-1.5.2.
- No texture packs screen has been added, but a texture pack is selected from the
- Support for loading folder texture packs has been added to 12w07a and below.
- Fixed issues with folder texture packs in 12w08a-1.2.5, where the pack description and icon would not load in the texture packs screen.
Resource Reloader Dependencies
A dependency system for resource reloaders has been implemented that allows modders to control the order in which their reloaders are run. The old API still exists but is deprecated and may be removed in the future.
New API has been added to ReloadableResourceManager.
ReloadableResourceManager {
// still exists, but is now deprecated
// all reloaders added through this method will be run last
void addReloader(ResourceReloader reloader);
// registers the given reloader to the given identifier
void registerReloader(NamespacedIdentifier identifier, ResourceReloader reloader);
// declares a dependency on the reloaders with given identifiers
// this will ensure the given reloader will run *after* all its dependencies
void registerReloaderDependencies(NamespacedIdentifier identifier, NamespacedIdentifier... dependencies);
}
All Vanilla reload listeners are registered as identifiable reloaders to ensure correct ordering between them, and to allow modders to insert their own reloaders anywhere in between. The identifiers used are public API in the AssetsReloaders and DataReloaders classes. These classes also list before_vanilla and after_vanilla markers that can be used to ensure your reloaders run before or after all Vanilla reload listeners.
resourceManager.registerReloader(EarlyReloader.IDENTIFIER, new EarlyReloader());
resourceManager.registerReloader(LateReloader.IDENTIFIER, new LateRelloader());
// BEFORE_VANILLA marker runs before all Vanilla reload listeners
// register a dependency from it on your own reloader to ensure your own reloader runs first
resourceManager.registerReloaderDependencies(AssetsReloaders.BEFORE_VANILLA, EarlyReloader.IDENTIFIER);
// AFTER_VANILLA marker runs after all Vanilla reload listeners
// register a dependency from your own reloader on it to ensure your own reloader runs last
resourceManager.registerReloaderDependencies(LateReloader.IDENTIFIER, AssetsReloaders.AFTER_VANILLA);
Localization 0.2.0
The language reloader in 11w48a-1.5.2 is now registered to minecraft:languages.
Text Components 0.1.0
This API is now finally out of Alpha.
0.1 Alpha 7
TextComponents#resolve(Object) can now correctly resolve Vanilla Text components in 13w21a-1.6.4.
0.1 Alpha 8
- Added
TextComponents.convert(TextComponent, Class<T>)that converts the given text component to the given type. Converters forStringand VanillaTextcomponents have been added.Stringconversion is identical to callingTextComponent#buildFormattedString().
- Added
MessageConsumerinterface withsendMessage(TextComponent)method and implemented it in Vanilla'sCommandSource.- For now, the implementation will simply forward calls to Vanilla's
sendMessage(String)(1.5-) orsendMessage(Text)(1.6+) methods, converting theTextComponentto aStringor VanillaTextcomponent respectively. In the future this may be changed to support features that OSLTextComponents have that formattedStrings or VanillaTextcomponents do not.
- For now, the implementation will simply forward calls to Vanilla's
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:EHGtwpJv:TJti12Rn"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:EHGtwpJv:TJti12Rn"
}

