Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
214d13e
make Core a regular library with versioned modules
SpaceWalkerRS May 30, 2026
fe3a353
[core] add IOSupplier
SpaceWalkerRS Mar 28, 2026
822376e
[core] add Unit
SpaceWalkerRS Mar 28, 2026
e8cc06e
[core] add some async utils
SpaceWalkerRS Mar 28, 2026
bf0170f
[resource loader] initial work on V2
SpaceWalkerRS Mar 28, 2026
52c7935
[resource loader] run custom reloaders on game start-up
SpaceWalkerRS May 3, 2026
b45fd62
[resource loader] fix crash in findResources
SpaceWalkerRS May 3, 2026
d05e2ce
[resource loader] use Mixin plugin instead of abusing Pseudo
SpaceWalkerRS May 5, 2026
c31a263
[resource loader] fix mc dep for the 1.3-1.5 impl
SpaceWalkerRS May 5, 2026
d130dae
[resource loader] some fixes
SpaceWalkerRS May 5, 2026
75a471c
[resource loader] add context to events
SpaceWalkerRS May 7, 2026
95b4c68
[resource loader] yeet unnecessary generics
SpaceWalkerRS May 7, 2026
1002768
[resource loader] add ClientPackSource/ServerPackSource
SpaceWalkerRS May 7, 2026
a50e653
[resource loader] 1.13+ ClientPackSource/ServerPackSource
SpaceWalkerRS May 8, 2026
c8609e3
[resource loader] resolve pack format through mc version
SpaceWalkerRS May 8, 2026
69abffb
[resource loader] fix version range for LegacyResourcePack mixin
SpaceWalkerRS May 8, 2026
7ef8fa8
[resource loader] some clean up
SpaceWalkerRS May 9, 2026
d8db45c
[resource loader] fix errors during reloads being suppressed
SpaceWalkerRS May 9, 2026
aad7eb1
[resource loader] add ProfiledResourceReload
SpaceWalkerRS May 9, 2026
4207a3a
[resource loader] fix ProfiledResourceReload
SpaceWalkerRS May 9, 2026
0b0d55f
[resource loader] add ResourceManager.getResourcePacks
SpaceWalkerRS May 11, 2026
ab30ba7
[resource loader] fix resource manager/pack repository not resetting …
SpaceWalkerRS May 13, 2026
1f3e45e
[core] add ModLoader for querying current mod loader
SpaceWalkerRS May 17, 2026
ee9d57e
[resource loader] improve handling of pack ids
SpaceWalkerRS May 15, 2026
672a7f3
[resource loader] remove unnecessary casts
SpaceWalkerRS May 30, 2026
3a4f529
[resource loader] fix crash in 1.6
SpaceWalkerRS May 31, 2026
95310b1
[resource loader] reload resource manager on startup in 1.5.2-
SpaceWalkerRS May 31, 2026
6428017
[resource loader] fix error when getting server pack entry in 1.8
SpaceWalkerRS May 31, 2026
a0ea3db
[resource loader] fix texture manager reloading too early
SpaceWalkerRS May 31, 2026
39c0d87
[localization] initial work on API and two impls
SpaceWalkerRS May 12, 2026
43d7682
[localization] use only loaded packs when reloading lang manager
SpaceWalkerRS May 13, 2026
08b1aab
[localization] fix fallback translations
SpaceWalkerRS May 13, 2026
a2ae0ce
[localization] getId -> getName
SpaceWalkerRS May 17, 2026
f1122e7
[localization] remove unnecessary casts
SpaceWalkerRS May 30, 2026
73610d7
[localization] register resource reloaders in 1.5.2-
SpaceWalkerRS May 31, 2026
b13e059
[localization] fix NPE due to initialization issue
SpaceWalkerRS May 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
82 changes: 38 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def fillModJson(project, task) {
}

def setUpLibrary(project) {
def isCore = (project.path == ':libraries:core')

project.apply plugin: 'java-library'
project.apply plugin: 'eclipse'
project.apply plugin: 'idea'
Expand Down Expand Up @@ -209,21 +211,31 @@ def setUpLibrary(project) {
def libraries = []
def modules = []

findLibraryDependencies(project, libraries, modules)
if (!isCore) {
findLibraryDependencies(project, libraries, modules)
}

project.dependencies {
implementation "net.fabricmc:fabric-loader:${project.rootProject.loader_version}"

implementation "org.apache.logging.log4j:log4j-api:2.19.0"
implementation "org.apache.logging.log4j:log4j-core:2.19.0"

implementation project.dependencies.project(path: ':libraries:core', configuration: 'namedElements')
implementation "org.quiltmc.parsers:json:${project.rootProject.quilt_parsers_version}"

libraries.each { libraryPath ->
implementation project.dependencies.project(path: libraryPath)

if (libraryPath == ':libraries:core') {
evaluationDependsOn libraryPath
}
}
modules.each { modulePath ->
implementation project.dependencies.project(path: modulePath, configuration: 'namedElements')

if (modulePath.startsWith(':libraries:core')) {
evaluationDependsOn modulePath
}
}
}

Expand All @@ -247,11 +259,8 @@ def setUpLibrary(project) {
}

def setUpModule(project) {
// normally modules have a 'root' and subprojects
// for different mc version ranges
// the Core API is the only exception to this
def isCore = (project.path == ':libraries:core')
def library = (isCore) ? project : project.parent
def library = project.parent
def isCore = (library.path == ':libraries:core')

project.apply plugin: 'java-library'
project.apply plugin: 'eclipse'
Expand All @@ -263,13 +272,9 @@ def setUpModule(project) {
project.base {
archivesName = "${project.rootProject.mod_id_short}-${library.library_id}"
}
project.version = "${library.library_version}"
project.version = "${library.library_version}+mc${project.min_mc_version}-mc${project.max_mc_version}"
project.group = "${project.rootProject.library_maven_group}"

if (!isCore) {
project.version += "+mc${project.min_mc_version}-mc${project.max_mc_version}"
}

def ctfile = project.file("src/main/resources/${project.rootProject.mod_id_short}.${library.library_id}.classtweaker")

project.loom {
Expand All @@ -291,7 +296,9 @@ def setUpModule(project) {
def libraries = []
def modules = []

findModuleDependencies(project, libraries, modules)
if (!isCore) {
findModuleDependencies(project, libraries, modules)
}

project.dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand Down Expand Up @@ -336,11 +343,21 @@ def setUpModule(project) {
include "org.quiltmc.parsers:json:${project.rootProject.quilt_parsers_version}"
}

implementation project.dependencies.project(path: library.path)

libraries.each { libraryPath ->
implementation project.dependencies.project(path: libraryPath)

if (libraryPath == ':libraries:core') {
evaluationDependsOn libraryPath
}
}
modules.each { modulePath ->
implementation project.dependencies.project(path: modulePath, configuration: 'namedElements')

if (modulePath.startsWith(':libraries:core')) {
evaluationDependsOn modulePath
}
}
}

Expand All @@ -351,14 +368,10 @@ def setUpModule(project) {
project.sourceSets {
main {
java {
if (!isCore) {
srcDirs += project.parent.sourceSets.main.java.srcDirs
}
srcDirs += project.parent.sourceSets.main.java.srcDirs
}
resources {
if (!isCore) {
srcDirs += project.parent.sourceSets.main.resources.srcDirs
}
srcDirs += project.parent.sourceSets.main.resources.srcDirs
}
}
}
Expand Down Expand Up @@ -399,9 +412,7 @@ def setUpModule(project) {
environment = '*'
}

if (!isCore) {
depends "minecraft", "${project.minecraft_dependency}"
}
depends "minecraft", "${project.minecraft_dependency}"

if (!isCore && library.hasProperty('osl_dependencies')) {
for (def dependency : library.osl_dependencies.split(',')) {
Expand Down Expand Up @@ -447,10 +458,7 @@ def setUpModule(project) {
project.publishing {
publications {
mavenJava(MavenPublication) {
if (!isCore) {
artifactId project.parent.name
}

artifactId library.library_id
from project.components.java

pom.withXml {
Expand Down Expand Up @@ -480,10 +488,6 @@ def setUpModule(project) {
}
}

if (isCore) {
addPomDependency(project)
}

setUpJavadoc(project)
}

Expand All @@ -493,13 +497,8 @@ def findLibraryDependencies(project, libraries, modules) {

for (dep : deps) {
def libraryName = dep.substring(0, dep.indexOf(':'))

if (libraryName != 'core') {
libraries.add(":libraries:${libraryName}")
}
libraries.add(":libraries:${libraryName}")
}

modules.add(':libraries:core')
}
}

Expand All @@ -509,18 +508,13 @@ def findModuleDependencies(project, libraries, modules) {

for (dep : deps) {
def libraryName = dep.substring(0, dep.indexOf(':'))
def moduleName = findModuleDependency(project, libraryName)

if (libraryName != 'core') {
def moduleName = findModuleDependency(project, libraryName)

if (moduleName != null) {
libraries.add(":libraries:${libraryName}")
if (moduleName != null) {
modules.add(":libraries:${libraryName}:${moduleName}")
}
modules.add(":libraries:${libraryName}:${moduleName}")
}
}

modules.add(':libraries:core')
}
}

Expand Down
7 changes: 6 additions & 1 deletion libraries/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
setUpModule(project)
setUpLibrary(project)

dependencies {
implementation 'org.jetbrains:annotations:24.0.1'
implementation 'it.unimi.dsi:fastutil:8.5.9'
}
5 changes: 5 additions & 0 deletions libraries/core/core-mc14w27a-mc1.14.4/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
min_mc_version = 14w27a
max_mc_version = 1.14.4
minecraft_dependency = >=1.8-alpha.14.27.a <=1.14.4

minecraft_version = 1.14.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package net.ornithemc.osl.core.impl.mixin.common;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import net.minecraft.resource.Identifier;

import net.ornithemc.osl.core.api.util.NamespacedIdentifier;
import net.ornithemc.osl.core.api.util.NamespacedIdentifiers;

@Mixin(Identifier.class)
public class IdentifierMixin implements NamespacedIdentifier {

@Shadow
private String namespace;
@Shadow
private String path;

@Inject(
method = "equals",
remap = false,
cancellable = true,
at = @At(
value = "HEAD"
)
)
private void osl$core$equalsNamespacedIdentifier(Object o, CallbackInfoReturnable<Boolean> cir) {
if (o instanceof NamespacedIdentifier) {
cir.setReturnValue(NamespacedIdentifiers.equals(this, (NamespacedIdentifier) o));
}
}

@Override
public String namespace() {
return namespace;
}

@Override
public String identifier() {
return path;
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"schemaVersion": 1,
"id": "osl-core",
"version": "0.7.1",
"version": "0.7.1+mc14w27a-mc1.14.4",
"environment": "*",
"mixins": [
"osl.core.mixins.json"
],
"accessWidener": "osl.core.classtweaker",
"depends": {
"fabricloader": "\u003e\u003d0.18.0"
"fabricloader": "\u003e\u003d0.18.0",
"minecraft": "\u003e\u003d1.8-alpha.14.27.a \u003c\u003d1.14.4"
},
"name": "OSL Core",
"description": "The core of Ornithe Standard Libraries.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
classTweaker v1 named

transitive-inject-interface net/minecraft/resource/Identifier net/ornithemc/osl/core/impl/util/IdentifierImpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"package": "net.ornithemc.osl.core.impl.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
"IdentifierMixin"
"common.IdentifierMixin"
],
"client": [
],
Expand Down
8 changes: 8 additions & 0 deletions libraries/core/core-mca1.0.1_01-mc14w26c/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
min_mc_version = a1.0.1_01
max_mc_version = 14w26c
minecraft_dependency = >=1.0.0-alpha.0.1 <=1.8-alpha.14.26.c

minecraft_version = 1.7.2
raven_build = 1
sparrow_build = 1
nests_build = 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package net.ornithemc.osl.core.impl;

import java.util.List;
import java.util.Set;

import org.objectweb.asm.tree.ClassNode;

import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import net.ornithemc.osl.core.impl.util.MinecraftVersion;

public class CoreMixinPlugin implements IMixinConfigPlugin {

public static final boolean IDENTIFIER_EXISTS = MinecraftVersion.resolve().compareTo("13w21a") >= 0;

@Override
public void onLoad(String mixinPackage) {
}

@Override
public String getRefMapperConfig() {
return null;
}

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if ("net.ornithemc.osl.core.impl.mixin.client.IdentifierMixin".equals(mixinClassName)) {
return IDENTIFIER_EXISTS;
}

return true;
}

@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
}

@Override
public List<String> getMixins() {
return null;
}

@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
}

@Override
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.ornithemc.osl.core.impl.mixin;
package net.ornithemc.osl.core.impl.mixin.client;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -12,9 +11,8 @@
import net.ornithemc.osl.core.api.util.NamespacedIdentifier;
import net.ornithemc.osl.core.api.util.NamespacedIdentifiers;

@Pseudo // needed because Identifier does not exist in all versions
@Mixin(Identifier.class)
public class IdentifierMixin implements NamespacedIdentifier { // TODO: interface injection
public class IdentifierMixin implements NamespacedIdentifier {

@Shadow
private String namespace;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"schemaVersion": 1,
"id": "osl-core",
"version": "0.7.1+mc14w27a-mc14w26c",
"environment": "*",
"mixins": [
"osl.core.mixins.json"
],
"accessWidener": "osl.core.classtweaker",
"depends": {
"fabricloader": "\u003e\u003d0.18.0",
"minecraft": "\u003e\u003d1.0.0-alpha.0.1 \u003c\u003d1.8-alpha.14.26.c"
},
"name": "OSL Core",
"description": "The core of Ornithe Standard Libraries.",
"authors": [
"OrnitheMC"
],
"contact": {
"homepage": "https://ornithemc.net/",
"issues": "https://github.com/OrnitheMC/ornithe-standard-libraries/issues",
"sources": "https://github.com/OrnitheMC/ornithe-standard-libraries"
},
"license": "Apache-2.0"
}
Loading
Loading