Skip to content
Open
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
22 changes: 12 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -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}"
Expand All @@ -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 {
Expand Down
20 changes: 11 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
# 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class BrightnessListWidget extends ElementListWidget<BrightnessListWidget

public BrightnessListWidget(MinecraftClient client, int i, int j, int k, int l, int m) {
super(client, i, j, k, l, m);
this.setRenderSelection(true);

if (client.options.getGamma().getValue() != BoostedBrightness.getBrightness()) {
BoostedBrightness.changeBrightness(client.options.getGamma().getValue());
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/net/boostedbrightness/ui/ModMenuIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class ModMenuIntegration implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return parent -> new ModMenuOptionsScreen(parent);
return ModMenuOptionsScreen::new;
}

public class ModMenuOptionsScreen extends GameOptionsScreen {
Expand All @@ -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() {
Expand Down
43 changes: 23 additions & 20 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
}