From 1063f6cbebaeebeaf1eb938dd6984f8fa9652289 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 28 Jul 2011 10:35:52 -0400 Subject: [PATCH] Added ServerCommandEvent. Thanks celticminstrel! By: EvilSeph --- .../event/server/ServerCommandEvent.java | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java b/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java index 2d79537364..661f29f9c8 100644 --- a/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/server/ServerCommandEvent.java @@ -1,12 +1,42 @@ package org.bukkit.event.server; -import org.bukkit.event.Event; +import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; /** * Server Command events */ -public class ServerCommandEvent extends Event { - public ServerCommandEvent() { +public class ServerCommandEvent extends ServerEvent { + private String command; + private CommandSender sender; + public ServerCommandEvent(ConsoleCommandSender console, String message) { super(Type.SERVER_COMMAND); + command = message; + sender = console; + } + + /** + * Gets the command that the user is attempting to execute from the console + * + * @return Command the user is attempting to execute + */ + public String getCommand() { + return command; + } + + /** + * Sets the command that the server will execute + * + * @param message New message that the server will execute + */ + public void setCommand(String message) { + this.command = message; + } + + /** + * Get the command sender. + */ + public CommandSender getSender() { + return sender; } }