Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for mc1.20.3-4 #49

Open
wants to merge 5 commits into
base: mc1.20.1
Choose a base branch
from
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
23 changes: 13 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,18 @@ 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,
"min_minecraft_version": min_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
21 changes: 12 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
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.4
min_minecraft_version=1.20.3
yarn_mappings=1.20.4+build.1
loader_version=0.15.1

# Mod Properties
mod_version = 2.2.0
mod_version = 2.2.2
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.91.2+1.20.4
# https://modrinth.com/mod/modmenu/versions
modmenu_version=9.0.0-pre.1
# https://modrinth.com/mod/sodium/versions
sodium_version=mc1.20.3-0.5.5
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

public class BrightnessListWidget extends ElementListWidget<BrightnessListWidget.BrightnessEntry> {

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

if (client.options.getGamma().getValue() != BoostedBrightness.getBrightness()) {
BoostedBrightness.changeBrightness(client.options.getGamma().getValue());
Expand Down
16 changes: 9 additions & 7 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 @@ -26,19 +26,21 @@ public ModMenuOptionsScreen(Screen parent) {
}

protected void init() {
this.list = new BrightnessListWidget(this.client, this.width, this.height, 32, this.height - 32, 25);
this.list = new BrightnessListWidget(this.client, this.width, this.height - 64, 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": "~${min_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"
}