From 36b3c1895d22094a8e80428ad74f5f421d4b91ef Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 14 May 2017 01:24:30 +0200 Subject: [PATCH] Thought I changed the DiscordPlugin too - AW Cleaned code a bit YEEHAW --- src/main/java/buttondevteam/core/CommandCaller.java | 2 -- .../java/buttondevteam/core/ScheduledRestartCommand.java | 7 ------- src/main/java/buttondevteam/core/TestPrepare.java | 2 -- src/main/java/buttondevteam/lib/chat/TBMCChatAPI.java | 1 - src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java | 3 --- src/main/java/buttondevteam/lib/player/TBMCPlayerBase.java | 3 --- 6 files changed, 18 deletions(-) diff --git a/src/main/java/buttondevteam/core/CommandCaller.java b/src/main/java/buttondevteam/core/CommandCaller.java index 50a65a9..2b27f9e 100644 --- a/src/main/java/buttondevteam/core/CommandCaller.java +++ b/src/main/java/buttondevteam/core/CommandCaller.java @@ -36,13 +36,11 @@ public class CommandCaller implements CommandExecutor { + cmd.getPlugin().getName()); else pc.setExecutor(instance); - System.out.println("Executor set"); } } @Override public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) { - System.out.println("onCommand called"); String path = command.getName().toLowerCase(); for (String arg : args) path += " " + arg; diff --git a/src/main/java/buttondevteam/core/ScheduledRestartCommand.java b/src/main/java/buttondevteam/core/ScheduledRestartCommand.java index 82090d2..b80c2de 100644 --- a/src/main/java/buttondevteam/core/ScheduledRestartCommand.java +++ b/src/main/java/buttondevteam/core/ScheduledRestartCommand.java @@ -34,11 +34,7 @@ public class ScheduledRestartCommand extends TBMCCommandBase { restartbar = Bukkit.createBossBar("Server restart in " + ticks / 20f, BarColor.RED, BarStyle.SOLID, BarFlag.DARKEN_SKY); restartbar.setProgress(1); - // System.out.println("Progress: " + restartbar.getProgress()); Bukkit.getOnlinePlayers().stream().forEach(p -> restartbar.addPlayer(p)); - /* - * System.out.println( "Players: " + restartbar.getPlayers().stream().map(p -> p.getName()).collect(Collectors.joining(", "))); - */ sender.sendMessage("Scheduled restart in " + ticks / 20f); ScheduledServerRestartEvent e = new ScheduledServerRestartEvent(ticks); Bukkit.getPluginManager().callEvent(e); @@ -52,9 +48,6 @@ public class ScheduledRestartCommand extends TBMCCommandBase { Bukkit.broadcastMessage("§c-- The server is restarting in " + restartcounter / 20 + " seconds!"); restartbar.setProgress(restartcounter / (double) restarttime); restartbar.setTitle(String.format("Server restart in %f.2", restartcounter / 20f)); - /* - * if (restartcounter % 20 == 0) System.out.println("Progress: " + restartbar.getProgress()); - */ restartcounter--; }, 1, 1); return true; diff --git a/src/main/java/buttondevteam/core/TestPrepare.java b/src/main/java/buttondevteam/core/TestPrepare.java index 027128b..3b6c837 100644 --- a/src/main/java/buttondevteam/core/TestPrepare.java +++ b/src/main/java/buttondevteam/core/TestPrepare.java @@ -21,8 +21,6 @@ public class TestPrepare { @Override public Object answer(InvocationOnMock invocation) throws Throwable { - // System.out.println("Return type: " + invocation.getMethod().getReturnType()); - // System.out.println(String.class.isAssignableFrom(invocation.getMethod().getReturnType())); if (returns(invocation, String.class)) return "test"; if (returns(invocation, Logger.class)) diff --git a/src/main/java/buttondevteam/lib/chat/TBMCChatAPI.java b/src/main/java/buttondevteam/lib/chat/TBMCChatAPI.java index 50b0086..943de8d 100644 --- a/src/main/java/buttondevteam/lib/chat/TBMCChatAPI.java +++ b/src/main/java/buttondevteam/lib/chat/TBMCChatAPI.java @@ -115,7 +115,6 @@ public class TBMCChatAPI { try { if (!cmd.getPackage().getName().startsWith(acmdclass.getPackage().getName())) continue; // It keeps including the commands from here - //System.out.println("Class found: " + cmd.getName()); if (Modifier.isAbstract(cmd.getModifiers())) continue; TBMCCommandBase c = cmd.newInstance(); diff --git a/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java b/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java index e751a9a..086f15d 100644 --- a/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java +++ b/src/main/java/buttondevteam/lib/chat/TBMCCommandBase.java @@ -47,7 +47,6 @@ public abstract class TBMCCommandBase { .replace("command", ""); String path = getClass().getAnnotation(CommandClass.class).path(), prevpath = path = path.length() == 0 ? getFromClass.apply(getClass()) : path; - // System.out.println("Path: " + (path.length() == 0 ? getFromClass.apply(getClass()) : path)) for (Class cl = getClass().getSuperclass(); cl != null && !cl.getPackage().getName().equals(TBMCCommandBase.class.getPackage().getName()); cl = cl .getSuperclass()) { // @@ -61,9 +60,7 @@ public abstract class TBMCCommandBase { newpath = getFromClass.apply(cl); } path = (prevpath = newpath) + " " + path; - // System.out.println("Path: " + (path.length() == 0 ? getFromClass.apply(cl) : path)); } - //System.out.println("Path: " + path); return path; } diff --git a/src/main/java/buttondevteam/lib/player/TBMCPlayerBase.java b/src/main/java/buttondevteam/lib/player/TBMCPlayerBase.java index e4f38c2..c1e3400 100644 --- a/src/main/java/buttondevteam/lib/player/TBMCPlayerBase.java +++ b/src/main/java/buttondevteam/lib/player/TBMCPlayerBase.java @@ -74,17 +74,14 @@ public abstract class TBMCPlayerBase extends ChromaGamerBase { public static T getPlayer(UUID uuid, Class cl) { if (playermap.containsKey(uuid + "-" + cl.getSimpleName())) return (T) playermap.get(uuid + "-" + cl.getSimpleName()); - // System.out.println("A"); try { T player; if (playermap.containsKey(uuid + "-" + TBMCPlayer.class.getSimpleName())) { - // System.out.println("B"); - Don't program when tired player = cl.newInstance(); player.plugindata = playermap.get(uuid + "-" + TBMCPlayer.class.getSimpleName()).plugindata; playermap.put(uuid + "-" + cl.getSimpleName(), player); // It will get removed on player quit } else player = ChromaGamerBase.getUser(uuid.toString(), cl); - // System.out.println("C"); player.uuid = uuid; return player; } catch (Exception e) {