try to improve robustness of channels gui

Signed-off-by: Glease <[email protected]>
This commit is contained in:
Glease committed 2024-12-15 02:41:26 +08:00
1 parent 43fc39c99b
commit 27be10dfbf
3 files changed
+15 -4

No files matched your search

@@ -276,7 +276,7 @@ public class GuiScreenConfigureChannels extends GuiScreen implements IGuiScreen
getButtonList().get(ADD_BTN).displayString = existing
? I18n.format("item.structurelib.constructableTrigger.gui.set")
: I18n.format("item.structurelib.constructableTrigger.gui.add");
getButtonList().get(ADD_BTN).enabled = !StringUtils.isBlank(value.getText());
getButtonList().get(ADD_BTN).enabled = !StringUtils.isBlank(value.getText()) && Integer.parseInt(value.getText()) > 0;
getButtonList().get(UNSET_BTN).enabled = existing && !StringUtils.isBlank(value.getText());
if (ChannelDataAccessor.hasSubChannel(trigger, SHOW_ERROR_CHANNEL)) {
@@ -293,7 +293,6 @@ public class GuiScreenConfigureChannels extends GuiScreen implements IGuiScreen
getButtonList().get(GT_NO_HATCH_BTN).displayString = "No Hatch";
}
}
}
private int getValue() {