diff options
author | isxander <xander@isxander.dev> | 2023-12-08 19:59:09 +0000 |
---|---|---|
committer | isxander <xander@isxander.dev> | 2023-12-08 19:59:09 +0000 |
commit | 450dbad49b72b37cdeef9b1358a59da1d66076c9 (patch) | |
tree | f2d99e7740b96d9660c405a2f92c2f7342751971 /fabric | |
parent | f54989903c4697fe14bdc6f1998f4a88757cdd0c (diff) | |
download | YetAnotherConfigLib-450dbad49b72b37cdeef9b1358a59da1d66076c9.tar.gz YetAnotherConfigLib-450dbad49b72b37cdeef9b1358a59da1d66076c9.tar.bz2 YetAnotherConfigLib-450dbad49b72b37cdeef9b1358a59da1d66076c9.zip |
extreme image preloading hackery
Diffstat (limited to 'fabric')
3 files changed, 30 insertions, 0 deletions
diff --git a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLFabricEntrypoint.java b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLFabricEntrypoint.java new file mode 100644 index 0000000..032f46b --- /dev/null +++ b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/YACLFabricEntrypoint.java @@ -0,0 +1,13 @@ +package dev.isxander.yacl3.platform.fabric; + +import dev.isxander.yacl3.platform.fabric.image.YACLImageReloadListenerFabric; +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.resource.ResourceManagerHelper; +import net.minecraft.server.packs.PackType; + +public class YACLFabricEntrypoint implements ClientModInitializer { + @Override + public void onInitializeClient() { + ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new YACLImageReloadListenerFabric()); + } +} diff --git a/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/image/YACLImageReloadListenerFabric.java b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/image/YACLImageReloadListenerFabric.java new file mode 100644 index 0000000..9eed7fe --- /dev/null +++ b/fabric/src/main/java/dev/isxander/yacl3/platform/fabric/image/YACLImageReloadListenerFabric.java @@ -0,0 +1,12 @@ +package dev.isxander.yacl3.platform.fabric.image; + +import dev.isxander.yacl3.gui.image.YACLImageReloadListener; +import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; +import net.minecraft.resources.ResourceLocation; + +public class YACLImageReloadListenerFabric extends YACLImageReloadListener implements IdentifiableResourceReloadListener { + @Override + public ResourceLocation getFabricId() { + return new ResourceLocation("yet_another_config_lib_v3", "image_reload_listener"); + } +} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index f2979ff..7f74e56 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -25,6 +25,11 @@ "yacl.mixins.json", "yacl-fabric.mixins.json" ], + "entrypoints": { + "client": [ + "dev.isxander.yacl3.platform.fabric.YACLFabricEntrypoint" + ] + }, "custom": { "modmenu": { "badges": ["library"] |