From 3ad13b37a31371cf444f7f01e0be35f8a7ed4450 Mon Sep 17 00:00:00 2001 From: xkball <45330674+xkball@users.noreply.github.com> Date: Wed, 25 Dec 2024 23:31:38 +0800 Subject: [PATCH] Fix: overflow issue in command rune gui. Bump Version to 1.4.47 Took 26 minutes --- gradle.properties | 2 +- .../org/teacon/powertool/client/gui/SetCommandScreen.java | 4 ++-- .../teacon/powertool/client/gui/widget/DelayCommandList.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 46a23ee..f060a79 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,7 +34,7 @@ mod_name=Power Tool # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPL-3.0 # The mod version. See https://semver.org/ -mod_version=1.4.46 +mod_version=1.4.47 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/org/teacon/powertool/client/gui/SetCommandScreen.java b/src/main/java/org/teacon/powertool/client/gui/SetCommandScreen.java index f68c46e..87f779c 100644 --- a/src/main/java/org/teacon/powertool/client/gui/SetCommandScreen.java +++ b/src/main/java/org/teacon/powertool/client/gui/SetCommandScreen.java @@ -47,7 +47,7 @@ protected void init() { var mc = Minecraft.getInstance(); var font = mc.font; var box_l = (int)Math.max(100,width*0.4); - var startY = (int)(height*0.15); + var startY = (int)(height*0.05); delayedCommands.clear(); if(itemStack.has(PowerToolDataComponents.DELAYED_COMMANDS)) delayedCommands.addAll(Objects.requireNonNull(itemStack.get(PowerToolDataComponents.DELAYED_COMMANDS))); this.name = new ObjectInputBox<>(font,width/2-box_l/2,startY,box_l,20,Component.literal("name"),ObjectInputBox.PASS_VALIDATOR,ObjectInputBox.PASS_RESPONDER); @@ -83,7 +83,7 @@ protected void init() { } public void refreshContentPos(){ - var startY = (int)(height*0.15); + var startY = (int)(height*0.05); this.commandList.resize(); var listEndY = startY+50+commandList.getHeight_(); this.consume.setPosition(consume.getX(), listEndY+5); diff --git a/src/main/java/org/teacon/powertool/client/gui/widget/DelayCommandList.java b/src/main/java/org/teacon/powertool/client/gui/widget/DelayCommandList.java index 0096a08..283cd86 100644 --- a/src/main/java/org/teacon/powertool/client/gui/widget/DelayCommandList.java +++ b/src/main/java/org/teacon/powertool/client/gui/widget/DelayCommandList.java @@ -31,7 +31,7 @@ public void resize(){ } public int getHeight_(){ - return (int) Math.min(Math.max(100,24+45*id),screen.height*0.6); + return (int) Math.min(Math.max(100,24+45*id),screen.height*0.95-100); } @Override