diff options
author | SHsuperCM <shsupercm@gmail.com> | 2022-02-05 07:46:52 +0200 |
---|---|---|
committer | SHsuperCM <shsupercm@gmail.com> | 2022-02-05 07:48:17 +0200 |
commit | 1a9e72178881ca41321c730eb69ce28f0b6ad171 (patch) | |
tree | 31b37e4ca6e134fd27ccebb56601510dc55c40de | |
parent | 315e1eee9be4981ac13b49b885e153c488b18851 (diff) | |
download | CITResewn-1a9e72178881ca41321c730eb69ce28f0b6ad171.tar.gz CITResewn-1a9e72178881ca41321c730eb69ce28f0b6ad171.tar.bz2 CITResewn-1a9e72178881ca41321c730eb69ce28f0b6ad171.zip |
Migrated to using Fletching Table
14 files changed, 32 insertions, 31 deletions
diff --git a/build.gradle b/build.gradle index 64a0be9..5774182 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { - id 'fabric-loom' version '0.10-SNAPSHOT' apply false + id 'fabric-loom' version '0.11-SNAPSHOT' apply false + id 'io.shcm.shsupercm.fabric.fletchingtable' version '1.4' apply false id 'maven-publish' } @@ -8,6 +9,7 @@ group = project.maven_group allprojects { apply plugin: "fabric-loom" + apply plugin: "io.shcm.shsupercm.fabric.fletchingtable" repositories { maven { url "https://maven.shedaniel.me/" } @@ -33,6 +35,13 @@ allprojects { } modCompileOnly("curse.maven:cosmeticarmor-436659:${project.cosmetic_armor}") + + + fletchingTable.shutUpDrasil18() + } + + fletchingTable { + defaultMixinEnvironment = "auto" } processResources { diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsConfigScreenFactory.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsConfigScreenFactory.java index 889c465..6d89bc6 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsConfigScreenFactory.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsConfigScreenFactory.java @@ -1,5 +1,6 @@ package shcm.shsupercm.fabric.citresewn.defaults.config; +import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint; import me.shedaniel.clothconfig2.api.ConfigBuilder; import me.shedaniel.clothconfig2.api.ConfigCategory; import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; @@ -7,8 +8,10 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.LiteralText; import net.minecraft.text.TranslatableText; +import shcm.shsupercm.fabric.citresewn.config.CITResewnConfigScreenFactory; public class CITResewnDefaultsConfigScreenFactory { + @Entrypoint(CITResewnConfigScreenFactory.DEFAULTS_CONFIG_ENTRYPOINT) public static Screen create(Screen parent) { CITResewnDefaultsConfig currentConfig = CITResewnDefaultsConfig.INSTANCE, defaultConfig = new CITResewnDefaultsConfig(); diff --git a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsModMenu.java b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsModMenu.java index cba1592..48edf33 100644 --- a/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsModMenu.java +++ b/defaults/src/main/java/shcm/shsupercm/fabric/citresewn/defaults/config/CITResewnDefaultsModMenu.java @@ -2,11 +2,13 @@ package shcm.shsupercm.fabric.citresewn.defaults.config; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; +import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.NoticeScreen; import net.minecraft.text.Text; +@Entrypoint("modmenu") public class CITResewnDefaultsModMenu implements ModMenuApi { @Override public ConfigScreenFactory<?> getModConfigScreenFactory() { diff --git a/defaults/src/main/resources/citresewn-defaults.mixins.json b/defaults/src/main/resources/citresewn-defaults.mixins.json index b5c307d..536380b 100644 --- a/defaults/src/main/resources/citresewn-defaults.mixins.json +++ b/defaults/src/main/resources/citresewn-defaults.mixins.json @@ -3,8 +3,6 @@ "minVersion": "0.8", "package": "shcm.shsupercm.fabric.citresewn.defaults.mixin", "compatibilityLevel": "JAVA_17", - "mixins": [ - ], "injectors": { "defaultRequire": 1 } diff --git a/defaults/src/main/resources/fabric.mod.json b/defaults/src/main/resources/fabric.mod.json index c140556..f35e7bb 100644 --- a/defaults/src/main/resources/fabric.mod.json +++ b/defaults/src/main/resources/fabric.mod.json @@ -16,14 +16,6 @@ }, "environment": "client", - "entrypoints": { - "modmenu": [ - "shcm.shsupercm.fabric.citresewn.defaults.config.CITResewnDefaultsModMenu" - ], - "citresewn-defaults:config_screen": [ - "shcm.shsupercm.fabric.citresewn.defaults.config.CITResewnDefaultsConfigScreenFactory::create" - ] - }, "accessWidener" : "citresewn-defaults.accesswidener", "mixins": [ "citresewn-defaults.mixins.json" diff --git a/gradle.properties b/gradle.properties index bc89793..ebfce68 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,10 +5,10 @@ org.gradle.jvmargs=-Xmx1G # check these on https://modmuss50.me/fabric.html minecraft_version=1.18.1 minecraft_version_compat=1.18.x -yarn_mappings=1.18.1+build.18 +yarn_mappings=1.18.1+build.22 loader_version=0.12.12 -fabric_api=0.45.0+1.18 +fabric_api=0.46.4+1.18 modmenu=3.0.1 cloth=6.1.48 cosmetic_armor=3544655 diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java b/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java index 0a0051f..807aa97 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/CITResewn.java @@ -1,5 +1,6 @@ package shcm.shsupercm.fabric.citresewn; +import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint; import net.fabricmc.api.ClientModInitializer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -7,13 +8,12 @@ import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig; public class CITResewn implements ClientModInitializer { public static final Logger LOG = LogManager.getLogger("CITResewn"); - public static CITResewn INSTANCE; - - public boolean processingBrokenPaths = false; + @Entrypoint(Entrypoint.CLIENT) + public static final CITResewn INSTANCE = new CITResewn(); @Override public void onInitializeClient() { - INSTANCE = this; + info("init"); } public static void info(String message) { diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnConfigScreenFactory.java b/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnConfigScreenFactory.java index 57ae2c3..76576ba 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnConfigScreenFactory.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnConfigScreenFactory.java @@ -14,6 +14,8 @@ import net.minecraft.util.Formatting; import java.util.function.Function; public class CITResewnConfigScreenFactory { + public static final String DEFAULTS_CONFIG_ENTRYPOINT = "citresewn-defaults:config_screen"; + public static Screen create(Screen parent) { CITResewnConfig currentConfig = CITResewnConfig.INSTANCE, defaultConfig = new CITResewnConfig(); @@ -42,7 +44,7 @@ public class CITResewnConfigScreenFactory { .setYesNoTextSupplier((b) -> { if (b != currentScreen.prevToggle) { //noinspection unchecked - MinecraftClient.getInstance().setScreen((Screen) FabricLoader.getInstance().getEntrypoints("citresewn-defaults:config_screen", Function.class).stream().findAny().orElseThrow().apply(currentScreen.screen)); + MinecraftClient.getInstance().setScreen((Screen) FabricLoader.getInstance().getEntrypoints(DEFAULTS_CONFIG_ENTRYPOINT, Function.class).stream().findAny().orElseThrow().apply(currentScreen.screen)); currentScreen.prevToggle = b; } diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnModMenu.java b/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnModMenu.java index 378350a..521c3b6 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnModMenu.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/config/CITResewnModMenu.java @@ -2,11 +2,13 @@ package shcm.shsupercm.fabric.citresewn.config; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; +import io.shcm.shsupercm.fabric.fletchingtable.api.Entrypoint; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.NoticeScreen; import net.minecraft.text.Text; +@Entrypoint("modmenu") public class CITResewnModMenu implements ModMenuApi { @Override public ConfigScreenFactory<?> getModConfigScreenFactory() { diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/ActiveCITs.java b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/ActiveCITs.java index 8e5faa3..5523c84 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/pack/ActiveCITs.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/pack/ActiveCITs.java @@ -37,7 +37,7 @@ public class ActiveCITs implements Disposable { private ActiveCITs() {} @Override public void dispose() { - for (Disposable disposable : FabricLoader.getInstance().getEntrypoints("citresewn:dispose", Disposable.class)) + for (Disposable disposable : FabricLoader.getInstance().getEntrypoints(Disposable.ENTRYPOINT, Disposable.class)) disposable.dispose(); diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/registry/api/GlobalPropertiesHandler.java b/src/main/java/shcm/shsupercm/fabric/citresewn/registry/api/GlobalPropertiesHandler.java index e5a2820..9b1ad6f 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/registry/api/GlobalPropertiesHandler.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/registry/api/GlobalPropertiesHandler.java @@ -4,5 +4,7 @@ import shcm.shsupercm.fabric.citresewn.format.PropertyValue; @FunctionalInterface public interface GlobalPropertiesHandler { - void globalProperty(String key, PropertyValue value); + String ENTRYPOINT = "citresewn:global_property"; + + boolean globalProperty(String key, PropertyValue value); } diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/util/Disposable.java b/src/main/java/shcm/shsupercm/fabric/citresewn/util/Disposable.java index 84c65b2..7878e16 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/util/Disposable.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/util/Disposable.java @@ -2,5 +2,7 @@ package shcm.shsupercm.fabric.citresewn.util; @FunctionalInterface public interface Disposable { + String ENTRYPOINT = "citresewn:dispose"; + void dispose(); } diff --git a/src/main/resources/citresewn.mixins.json b/src/main/resources/citresewn.mixins.json index 39343fb..394941e 100644 --- a/src/main/resources/citresewn.mixins.json +++ b/src/main/resources/citresewn.mixins.json @@ -3,9 +3,6 @@ "minVersion": "0.8", "package": "shcm.shsupercm.fabric.citresewn.mixin", "compatibilityLevel": "JAVA_17", - "mixins": [ - "ModelLoaderMixin" - ], "injectors": { "defaultRequire": 1 } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index b00baa4..a8e2234 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -16,14 +16,6 @@ }, "environment": "client", - "entrypoints": { - "client": [ - "shcm.shsupercm.fabric.citresewn.CITResewn" - ], - "modmenu": [ - "shcm.shsupercm.fabric.citresewn.config.CITResewnModMenu" - ] - }, "accessWidener" : "citresewn.accesswidener", "mixins": [ "citresewn.mixins.json" |