From 1d8feb7bf8616b804728c07ae7adf29345e64362 Mon Sep 17 00:00:00 2001 From: kaenganxt Date: Thu, 20 Nov 2014 20:06:09 +0100 Subject: [PATCH] Bug command --- src/de/anura/core/Setup.java | 1 + .../anura/core/commands/PlayerCommands.java | 23 ++++++++++++------- src/plugin.yml | 5 +++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/de/anura/core/Setup.java b/src/de/anura/core/Setup.java index accab6b..e055569 100644 --- a/src/de/anura/core/Setup.java +++ b/src/de/anura/core/Setup.java @@ -215,6 +215,7 @@ public class Setup { Core.getMainClass().getCommand("addAimTWWin").setExecutor(oc); Core.getMainClass().getCommand("toggleboat").setExecutor(pc); Core.getMainClass().getCommand("toggleboatflight").setExecutor(tc); + Core.getMainClass().getCommand("bug").setExecutor(pc); } private static void setupInventories() { diff --git a/src/de/anura/core/commands/PlayerCommands.java b/src/de/anura/core/commands/PlayerCommands.java index ba53db9..141006c 100644 --- a/src/de/anura/core/commands/PlayerCommands.java +++ b/src/de/anura/core/commands/PlayerCommands.java @@ -49,6 +49,21 @@ public class PlayerCommands implements CommandExecutor { Core.getMainClass().getFeatures().enableFeature(P, Features.Feature.BOAT); } return true; + } else if (cmd.getName().equalsIgnoreCase("bug")) { + if (P == null) { + Core.statusMsg(sender, "only_player_cmd", false); + return true; + } + if (args.length == 0) { + return false; + } + String msg = ""; + for (String part : args) { + msg += part + " "; + } + Errors.bugReport(P, msg, Errors.make("plugin", "core")); + Core.statusMsg(P, "bug_report_sent", true); + return true; } else if (cmd.getName().equalsIgnoreCase("joinminigame")) { if (P == null) { Core.statusMsg(sender, "only_player_cmd", false); @@ -65,14 +80,6 @@ public class PlayerCommands implements CommandExecutor { o.getScore(P).setScore(1); Core.statusMsg(sender, "joined_xpBattle", true); return true; - } else if (args[0].equalsIgnoreCase("pool")) { - Objective o = Bukkit.getScoreboardManager().getMainScoreboard().getObjective("poolJoin"); - if (o == null) { - return true; - } - o.getScore(P).setScore(1); - Core.statusMsg(sender, "joined_pool", true); - return true; } } else if (cmd.getName().equalsIgnoreCase("leaveminigame")) { if (P == null) { diff --git a/src/plugin.yml b/src/plugin.yml index a198dcd..08cc2c9 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -87,4 +87,7 @@ commands: usage: / toggleboat: description: Enables/Disables the boat feature - usage: / \ No newline at end of file + usage: / + bug: + description: Reports a bug and collects some server specific server data + usage: / ... \ No newline at end of file