From 861f2198067f4368508baa7c0b84feed922eeafb Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 27 Sep 2024 16:38:31 +0200 Subject: [PATCH] fixed stack size modifier ui not updating correctly closes #211 --- .../pipe/modules/stacksize/StackSizeModuleGui.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/prettypipes/pipe/modules/stacksize/StackSizeModuleGui.java b/src/main/java/de/ellpeck/prettypipes/pipe/modules/stacksize/StackSizeModuleGui.java index 9699001..b90b77a 100644 --- a/src/main/java/de/ellpeck/prettypipes/pipe/modules/stacksize/StackSizeModuleGui.java +++ b/src/main/java/de/ellpeck/prettypipes/pipe/modules/stacksize/StackSizeModuleGui.java @@ -35,8 +35,8 @@ public class StackSizeModuleGui extends AbstractPipeGui data = () -> this.menu.moduleStack.getOrDefault(StackSizeModuleItem.Data.TYPE, StackSizeModuleItem.Data.DEFAULT); + textField.setValue(String.valueOf(data.get().maxStackSize())); textField.setMaxLength(4); textField.setResponder(s -> { if (s.isEmpty()) @@ -44,7 +44,7 @@ public class StackSizeModuleGui extends AbstractPipeGui buttonText = () -> Component.translatable("info." + PrettyPipes.ID + ".limit_to_max_" + (data.limitToMaxStackSize() ? "on" : "off")); + Supplier buttonText = () -> Component.translatable("info." + PrettyPipes.ID + ".limit_to_max_" + (data.get().limitToMaxStackSize() ? "on" : "off")); this.addRenderableWidget(Button.builder(buttonText.get(), b -> { PacketButton.sendAndExecute(this.menu.tile.getBlockPos(), ButtonResult.STACK_SIZE_MODULE_BUTTON, List.of()); b.setMessage(buttonText.get());