mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-11-22 11:53:29 +01:00
parent
5b96a9d5a2
commit
861f219806
1 changed files with 3 additions and 3 deletions
|
@ -35,8 +35,8 @@ public class StackSizeModuleGui extends AbstractPipeGui<StackSizeModuleContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
var data = this.menu.moduleStack.getOrDefault(StackSizeModuleItem.Data.TYPE, StackSizeModuleItem.Data.DEFAULT);
|
Supplier<StackSizeModuleItem.Data> data = () -> this.menu.moduleStack.getOrDefault(StackSizeModuleItem.Data.TYPE, StackSizeModuleItem.Data.DEFAULT);
|
||||||
textField.setValue(String.valueOf(data.maxStackSize()));
|
textField.setValue(String.valueOf(data.get().maxStackSize()));
|
||||||
textField.setMaxLength(4);
|
textField.setMaxLength(4);
|
||||||
textField.setResponder(s -> {
|
textField.setResponder(s -> {
|
||||||
if (s.isEmpty())
|
if (s.isEmpty())
|
||||||
|
@ -44,7 +44,7 @@ public class StackSizeModuleGui extends AbstractPipeGui<StackSizeModuleContainer
|
||||||
var amount = Integer.parseInt(s);
|
var amount = Integer.parseInt(s);
|
||||||
PacketButton.sendAndExecute(this.menu.tile.getBlockPos(), ButtonResult.STACK_SIZE_AMOUNT, List.of(amount));
|
PacketButton.sendAndExecute(this.menu.tile.getBlockPos(), ButtonResult.STACK_SIZE_AMOUNT, List.of(amount));
|
||||||
});
|
});
|
||||||
Supplier<Component> buttonText = () -> Component.translatable("info." + PrettyPipes.ID + ".limit_to_max_" + (data.limitToMaxStackSize() ? "on" : "off"));
|
Supplier<Component> buttonText = () -> Component.translatable("info." + PrettyPipes.ID + ".limit_to_max_" + (data.get().limitToMaxStackSize() ? "on" : "off"));
|
||||||
this.addRenderableWidget(Button.builder(buttonText.get(), b -> {
|
this.addRenderableWidget(Button.builder(buttonText.get(), b -> {
|
||||||
PacketButton.sendAndExecute(this.menu.tile.getBlockPos(), ButtonResult.STACK_SIZE_MODULE_BUTTON, List.of());
|
PacketButton.sendAndExecute(this.menu.tile.getBlockPos(), ButtonResult.STACK_SIZE_MODULE_BUTTON, List.of());
|
||||||
b.setMessage(buttonText.get());
|
b.setMessage(buttonText.get());
|
||||||
|
|
Loading…
Reference in a new issue