Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ dependencies {

fun modDependency(
id: String,
artifactGetter: (String) -> String,
artifactGetter: (String) -> Any,
requiredByDependants: Boolean = false,
supportsRuntime: Boolean = true,
extra: (Boolean) -> Unit = {}
extra: (runtime: Boolean) -> Unit = {}
) {
prop("deps.$id") { modVersion ->
val noRuntime = prop("deps.$id.noRuntime") { it.toBoolean() } == true
Expand All @@ -203,7 +203,9 @@ dependencies {
}

if (isFabric) {
modDependency("fabricApi", { "net.fabricmc.fabric-api:fabric-api:$it" }, requiredByDependants = true)
modDependency("fabricApi", { platform("net.fabricmc.fabric-api:fabric-api-bom:$it") }, requiredByDependants = true) { runtime ->
modstitchModApi("net.fabricmc.fabric-api:fabric-resource-loader-v1")
}

modDependency("fabricLangKotlin", { "net.fabricmc:fabric-language-kotlin:${it}" })
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub.curseforgeSlug=yacl
pub.curseforgeId=667299
githubProject=isXander/YetAnotherConfigLib

deps.fabricLoader=0.18.4
deps.fabricLoader=0.19.3
deps.imageio=3.12.0
deps.quiltParsers=0.2.1
deps.fabricLangKotlin=1.12.3+kotlin.2.0.21
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ stonecutter {

mc("26.1", loaders = listOf("fabric", "neoforge"))
mc("26.2", loaders = listOf("fabric", "neoforge"))
mc("26.3", loaders = listOf("fabric"))
}
}
rootProject.name = "YetAnotherConfigLib"
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
import java.util.stream.Collector;
import java.util.stream.Stream;

public class YACLImageReloadListener
implements PreparableReloadListener
/*? if fabric {*/,
net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener
/*?}*/
{
public class YACLImageReloadListener implements PreparableReloadListener {
@Override
public @NotNull CompletableFuture<Void> reload(
SharedState sharedState,
Expand Down Expand Up @@ -102,17 +97,10 @@ private CompletableFuture<Void> apply(
private record SupplierPreparation(Identifier location, ImageRendererFactory.ImageSupplier supplier) {
}

public Identifier getId() {
public static Identifier getId() {
return YACLPlatform.rl("image_reload_listener");
}

/*? if fabric {*/
@Override
public Identifier getFabricId() {
return this.getId();
}
/*?}*/

public static class CompletableFutureCollector<X, T extends CompletableFuture<X>> implements Collector<T, List<T>, CompletableFuture<List<X>>> {
private CompletableFutureCollector() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

/*? if fabric {*/
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
import net.minecraft.server.packs.PackType;

public class PlatformEntrypoint implements ClientModInitializer {
@Override
public void onInitializeClient() {
YACLConfig.HANDLER.load();
ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new YACLImageReloadListener());
ResourceLoader.get(PackType.CLIENT_RESOURCES).registerReloadListener(YACLImageReloadListener.getId(), new YACLImageReloadListener());
}
}
/*?} elif neoforge {*/
Expand All @@ -24,8 +24,7 @@ public class PlatformEntrypoint {
public PlatformEntrypoint(IEventBus modEventBus) {
YACLConfig.HANDLER.load();
modEventBus.addListener(AddClientReloadListenersEvent.class, event -> {
var listener = new YACLImageReloadListener();
event.addListener(listener.getId(), listener);
event.addListener(YACLImageReloadListener.getId(), new YACLImageReloadListener());
});
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/templates/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"depends": {
"fabricloader": ">=0.18.0",
"minecraft": "${mc}",
"java": ">=17",
"fabric-api": ">=${fapi}"
"fabric-resource-loader-v1": "*"
},
"entrypoints": {
"client": [
Expand Down
10 changes: 10 additions & 0 deletions versions/26.3-fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
modstitch.platform=fabric-loom

mcVersion=26.3-snapshot-1

deps.fabricApi=0.153.1+26.3

meta.mcDep=~26.3-

pub.modrinthMC=26.3-snapshot-1
pub.curseMC=26.3-snapshot
Loading