diff --git a/build.gradle.kts b/build.gradle.kts index 0d53594..f68db0f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,13 +27,17 @@ allprojects { apply(plugin = "maven-publish") apply(plugin = "io.freefair.lombok") + if (project.name != "core") { + dependencies { + api(project(":library:core")) + } + } phytotelma { loader(rootProject.libs.versions.frogloader) minecraft(rootProject.libs.versions.minecraft) } - tasks.processResources { inputs.property("version", version) inputs.property("game_version", libs.versions.minecraft.get()) @@ -87,7 +91,7 @@ dependencies { project.tasks.jar { dependsOn(it.tasks.jar) } - implementation(it) + api(it) include(it) } } diff --git a/library/branding/src/main/java/dev/frogmc/froglib/branding/impl/mixin/client/TitleScreenMixin.java b/library/branding/src/main/java/dev/frogmc/froglib/branding/impl/mixin/client/TitleScreenMixin.java new file mode 100644 index 0000000..5bb5243 --- /dev/null +++ b/library/branding/src/main/java/dev/frogmc/froglib/branding/impl/mixin/client/TitleScreenMixin.java @@ -0,0 +1,20 @@ +package dev.frogmc.froglib.branding.impl.mixin.client; + +import dev.frogmc.frogloader.api.FrogLoader; +import net.minecraft.client.gui.screens.TitleScreen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(TitleScreen.class) +public class TitleScreenMixin { + + @Unique + private static final int MOD_COUNT = FrogLoader.getInstance().getMods().size(); + + @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/resources/language/I18n;get(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;")) + private String addModCount(String translateKey, Object[] parameters){ + return "/FrogLoader ("+MOD_COUNT+" Mods)"; + } +} diff --git a/library/branding/src/main/resources/froglib.branding.mixins.json b/library/branding/src/main/resources/froglib.branding.mixins.json index 6c8ea48..8f677c3 100644 --- a/library/branding/src/main/resources/froglib.branding.mixins.json +++ b/library/branding/src/main/resources/froglib.branding.mixins.json @@ -9,6 +9,7 @@ "server": [ ], "client": [ + "client.TitleScreenMixin", "client.ClientBrandRetrieverMixin" ], "injectors": { diff --git a/src/test/java/dev/frogmc/froglib/test/KeybindsTest.java b/library/keybinds/src/test/java/dev/frogmc/froglib/keybinds/test/KeybindsTest.java similarity index 91% rename from src/test/java/dev/frogmc/froglib/test/KeybindsTest.java rename to library/keybinds/src/test/java/dev/frogmc/froglib/keybinds/test/KeybindsTest.java index 8aaaa67..6b419d7 100644 --- a/src/test/java/dev/frogmc/froglib/test/KeybindsTest.java +++ b/library/keybinds/src/test/java/dev/frogmc/froglib/keybinds/test/KeybindsTest.java @@ -1,4 +1,4 @@ -package dev.frogmc.froglib.test; +package dev.frogmc.froglib.keybinds.test; import com.mojang.blaze3d.platform.InputConstants; import dev.frogmc.froglib.entrypoints.ClientExtension; diff --git a/src/test/resources/frog.mod.toml b/library/keybinds/src/test/resources/frog.mod.toml similarity index 68% rename from src/test/resources/frog.mod.toml rename to library/keybinds/src/test/resources/frog.mod.toml index 04f39d2..46a5bc8 100644 --- a/src/test/resources/frog.mod.toml +++ b/library/keybinds/src/test/resources/frog.mod.toml @@ -2,8 +2,8 @@ format_version = "1.0.0" [frog.mod] -id = "frog_lib_test" -name = "Frog Lib Test Mod" +id = "frog_lib_keybinds_test" +name = "FrogLib Keybinds Test Mod" version = "1.0.0" license = "Apache-2.0" credits = [ @@ -16,4 +16,4 @@ depends = [ ] [frog.extensions] -client = "dev.frogmc.froglib.test.KeybindsTest" +client = "dev.frogmc.froglib.keybinds.test.KeybindsTest" diff --git a/library/resourceloader/build.gradle.kts b/library/resourceloader/build.gradle.kts index 82f3bcf..e69de29 100644 --- a/library/resourceloader/build.gradle.kts +++ b/library/resourceloader/build.gradle.kts @@ -1,4 +0,0 @@ - -dependencies { - api(project(":library:core")) -} \ No newline at end of file