From 29ed8b16b8fe60b48c396ba1e731d1e5ea242149 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 16 Jun 2022 11:19:50 +0200 Subject: [PATCH] Update StatCommand --- src/de/steamwar/bungeecore/commands/StatCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/StatCommand.java b/src/de/steamwar/bungeecore/commands/StatCommand.java index b633fb5..753f253 100644 --- a/src/de/steamwar/bungeecore/commands/StatCommand.java +++ b/src/de/steamwar/bungeecore/commands/StatCommand.java @@ -21,6 +21,7 @@ package de.steamwar.bungeecore.commands; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Node; +import de.steamwar.command.SWCommand; import net.md_5.bungee.api.CommandSender; import java.io.BufferedReader; @@ -28,14 +29,14 @@ import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; -public class StatCommand extends BasicCommand { +public class StatCommand extends SWCommand { public StatCommand() { super("stat", "bungeecore.softreload", "stats"); } - @Override - public void execute(CommandSender sender, String[] args) { + @Register + public void genericCommand(CommandSender sender) { Map serverCount = new HashMap<>(); try { Process process = new ProcessBuilder("ps", "x").start(); @@ -53,5 +54,4 @@ public class StatCommand extends BasicCommand { Node.forEach(node -> Message.send("STAT_SERVER", sender, node.getName(), node.getLoad(), serverCount.getOrDefault(node.getName(), 0))); } - }