Skip to content

Commit 2ebde51

Browse files
committed
v1.0.1: Fix multiplayer screen button positioning, use property for version
1 parent 4a043bb commit 2ebde51

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ subprojects {
2424

2525
allprojects {
2626
group = "org.netutils"
27-
version = "1.0.0"
27+
version = rootProject.property("mod_version")
2828
}
2929

3030
tasks.register("collectJars", Copy::class) {

common/src/main/java/org/netutils/mixin/MultiplayerScreenMixin.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,28 @@ public void init(CallbackInfo ci) {
2424
if (SharedVariables.enabled) {
2525
ScreenAccessor accessor = (ScreenAccessor) this;
2626

27-
// Center X position
28-
int centerX = this.width / 2;
27+
// Position in bottom-left corner
28+
int leftX = 5;
2929
int buttonWidth = 160;
30+
int bottomY = this.height - 30; // First button from bottom
3031

31-
// Bypass Resource Pack Toggle - positioned above the server list area
32-
accessor.invokeAddRenderableWidget(Button.builder(
33-
Component.literal("Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")),
34-
(button) -> {
35-
SharedVariables.bypassResourcePack = !SharedVariables.bypassResourcePack;
36-
button.setMessage(Component.literal(
37-
"Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")));
38-
}).bounds(centerX - buttonWidth / 2, 50, buttonWidth, 20).build());
39-
40-
// Force Deny Toggle
32+
// Force Deny Toggle - bottom button
4133
accessor.invokeAddRenderableWidget(Button.builder(
4234
Component.literal("Force Deny: " + (SharedVariables.resourcePackForceDeny ? "ON" : "OFF")),
4335
(button) -> {
4436
SharedVariables.resourcePackForceDeny = !SharedVariables.resourcePackForceDeny;
4537
button.setMessage(Component
4638
.literal("Force Deny: " + (SharedVariables.resourcePackForceDeny ? "ON" : "OFF")));
47-
}).bounds(centerX - buttonWidth / 2, 75, buttonWidth, 20).build());
39+
}).bounds(leftX, bottomY, buttonWidth, 20).build());
40+
41+
// Bypass Resource Pack Toggle - above Force Deny
42+
accessor.invokeAddRenderableWidget(Button.builder(
43+
Component.literal("Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")),
44+
(button) -> {
45+
SharedVariables.bypassResourcePack = !SharedVariables.bypassResourcePack;
46+
button.setMessage(Component.literal(
47+
"Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")));
48+
}).bounds(leftX, bottomY - 22, buttonWidth, 20).build());
4849
}
4950
}
5051
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Mod Properties
2-
mod_version=1.0.0
2+
mod_version=1.0.1
33
maven_group=org.netutils
44
archives_base_name=netutils
55

0 commit comments

Comments
 (0)