41public class SendInputAmount
extends OutgoingPacket {
43 private final Consumer<String> action;
44 private final String inputMessage;
45 private final int inputLength;
47 public SendInputAmount(Consumer<String> action) {
48 this(
"Enter an amount:", 10, action);
51 public SendInputAmount(String message,
int length, Consumer<String> action) {
54 this.inputMessage = message;
55 this.inputLength = length;
59 public boolean encode(
Player player) {
60 player.enterInputListener = Optional.of(action);
61 builder.writeString(inputMessage)