package net.minecraft.server; import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.arguments.IntegerArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; public class CommandIdleTimeout { public static void a(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) { com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("setidletimeout").requires((commandlistenerwrapper) -> { return commandlistenerwrapper.hasPermission(3); })).then(CommandDispatcher.a("minutes", (ArgumentType) IntegerArgumentType.integer(0)).executes((commandcontext) -> { return a((CommandListenerWrapper) commandcontext.getSource(), IntegerArgumentType.getInteger(commandcontext, "minutes")); }))); } private static int a(CommandListenerWrapper commandlistenerwrapper, int i) { commandlistenerwrapper.getServer().setIdleTimeout(i); commandlistenerwrapper.sendMessage(new ChatMessage("commands.setidletimeout.success", new Object[]{i}), true); return i; } }