SetToolHistorySizeCommand.java
package com.hypixel.hytale.builtin.buildertools.commands;
import com.hypixel.hytale.builtin.buildertools.BuilderToolsPlugin;
import com.hypixel.hytale.codec.validation.validator.RangeValidator;
import com.hypixel.hytale.protocol.GameMode;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;
import javax.annotation.Nonnull;
public class SetToolHistorySizeCommand extends CommandBase {
@Nonnull
private final RequiredArg<Integer> historyLengthArg;
public SetToolHistorySizeCommand() {
super("setToolHistorySize", "server.commands.settoolhistorysize.desc");
this.historyLengthArg = (RequiredArg)this.withRequiredArg("historyLength", "server.commands.settoolhistorysize.historyLength.desc", ArgTypes.INTEGER).addValidator(new RangeValidator(10, 250, true));
.setPermissionGroup(GameMode.Creative);
}
{
BuilderToolsPlugin.get().setToolHistorySize((Integer).historyLengthArg.get(context));
context.sendMessage(Message.translation().param(, (Integer).historyLengthArg.get(context)));
}
}