diff --git a/build.gradle b/build.gradle index df180bf..0516888 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.2-SNAPSHOT' + id 'fabric-loom' version '1.3-SNAPSHOT' id 'maven-publish' } @@ -26,7 +26,7 @@ dependencies { modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" //Fabric api - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" // ModMenu modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" @@ -37,15 +37,17 @@ dependencies { } processResources { - inputs.property "version", project.version - - filesMatching("fabric.mod.json") { - expand "version": project.version + def expandProps = [ + "version": version, + "maven_group": project.group, + "minecraft_version": minecraft_version, + "modmenu_version": modmenu_version + ] + + filesMatching(['fabric.mod.json']) { + expand expandProps } - - // from(sourceSets.main.resources.srcDirs) { - // exclude "fabric.mod.json" - // } + inputs.properties(expandProps) } loom { diff --git a/gradle.properties b/gradle.properties index a5aed2a..ad24335 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,18 +2,20 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties - # check these on https://fabricmc.net/use - minecraft_version=1.20.1 - yarn_mappings=1.20.1+build.5 - loader_version=0.14.21 + # check these on https://fabricmc.net/develop/ + minecraft_version=1.20.2 + yarn_mappings=1.20.2+build.1 + loader_version=0.14.22 # Mod Properties - mod_version = 2.2.0 + mod_version = 2.2.1 maven_group = net.boostedbrightness archives_base_name = boosted-brightness # Dependencies - # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.84.0+1.20.1 - modmenu_version=7.0.1 - sodium_version=mc1.20-0.4.10 \ No newline at end of file + # https://fabricmc.net/develop/ + fabric_api_version=0.89.2+1.20.2 + # https://modrinth.com/mod/modmenu/versions + modmenu_version=8.0.0 + # https://modrinth.com/mod/sodium/versions + sodium_version=mc1.20.2-0.5.3 \ No newline at end of file diff --git a/src/main/java/net/boostedbrightness/ui/BrightnessListWidget.java b/src/main/java/net/boostedbrightness/ui/BrightnessListWidget.java index d3e0868..62a1c62 100644 --- a/src/main/java/net/boostedbrightness/ui/BrightnessListWidget.java +++ b/src/main/java/net/boostedbrightness/ui/BrightnessListWidget.java @@ -19,7 +19,6 @@ public class BrightnessListWidget extends ElementListWidget getModConfigScreenFactory() { - return parent -> new ModMenuOptionsScreen(parent); + return ModMenuOptionsScreen::new; } public class ModMenuOptionsScreen extends GameOptionsScreen { @@ -29,16 +29,18 @@ protected void init() { this.list = new BrightnessListWidget(this.client, this.width, this.height, 32, this.height - 32, 25); this.addSelectableChild(this.list); - this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> { - this.client.setScreen(this.parent); - }).size(240, 20).position(this.width / 2 - 120, this.height - 27).build()); + this.addDrawableChild(ButtonWidget.builder(ScreenTexts.DONE, (button) -> this.close()) + .size(240, 20).position(this.width / 2 - 120, this.height - 27).build()); } public void render(DrawContext context, int mouseX, int mouseY, float delta) { - this.renderBackground(context); + super.render(context, mouseX, mouseY, delta); this.list.render(context, mouseX, mouseY, delta); context.drawCenteredTextWithShadow(this.textRenderer, this.title, this.width / 2, 5, 0xFFFFFF); - super.render(context, mouseX, mouseY, delta); + } + + public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) { + this.renderBackgroundTexture(context); } public void removed() { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index eba8c0a..eeb980c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -2,19 +2,9 @@ "schemaVersion": 1, "id": "boostedbrightness", "version": "${version}", - "name": "Boosted Brightness", - "description": "Allows you to set your brightness beyond default levels.", - "authors": [ - "adamviola" - ], - "contact": { - "homepage": "https://github.com/adamviola/BoostedBrightness", - "sources": "https://github.com/adamviola/BoostedBrightness", - "issues": "https://github.com/adamviola/BoostedBrightness/issues" - }, - "license": "MIT", - "icon": "assets/boostedbrightness/icon.png", "environment": "client", + "accessWidener": "boostedbrightness.accesswidener", + "entrypoints": { "client": [ "net.boostedbrightness.BoostedBrightness" @@ -29,15 +19,28 @@ "environment": "client" } ], - "accessWidener": "boostedbrightness.accesswidener", + "depends": { "fabricloader": ">=0.7.4", - "fabric": "*", - "fabric-lifecycle-events-v1": "*", - "fabric-key-binding-api-v1": "*", - "minecraft": ">=1.20" + "fabric-api": "*", + "minecraft": "~${minecraft_version}" }, - "suggests": { - "flamingo": "*" - } + "recommends": { + "modmenu": "${modmenu_version}" + }, + + "name": "Boosted Brightness", + "description": "Allows you to set your brightness beyond default levels.", + "contact": { + "homepage": "https://github.com/adamviola/BoostedBrightness", + "sources": "https://github.com/adamviola/BoostedBrightness", + "issues": "https://github.com/adamviola/BoostedBrightness/issues" + }, + "authors": [ + "adamviola" + ], + "contributors": [ + ], + "license": "MIT", + "icon": "assets/boostedbrightness/icon.png" } \ No newline at end of file