diff options
author | EvilSeph <evilseph@gmail.com> | 2011-07-28 10:35:50 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2011-08-03 12:10:09 -0400 |
commit | 85805e53a329d0526eb9736068b83950bd98ab68 (patch) | |
tree | 0e7a6dd97643365310c6b64066af4774a8918b83 /src | |
parent | 817cd83f0b966356fcc5a058afe36c017aadaaac (diff) | |
download | craftbukkit-85805e53a329d0526eb9736068b83950bd98ab68.tar craftbukkit-85805e53a329d0526eb9736068b83950bd98ab68.tar.gz craftbukkit-85805e53a329d0526eb9736068b83950bd98ab68.tar.lz craftbukkit-85805e53a329d0526eb9736068b83950bd98ab68.tar.xz craftbukkit-85805e53a329d0526eb9736068b83950bd98ab68.zip |
Added ServerCommandEvent. Thanks celticminstrel!
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/MinecraftServer.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 13601d9e..ee8dee66 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -24,12 +24,13 @@ import org.bukkit.craftbukkit.LoggerOutputStream; import org.bukkit.craftbukkit.command.ColouredConsoleSender; import org.bukkit.craftbukkit.scheduler.CraftScheduler; import org.bukkit.craftbukkit.util.ServerShutdownThread; +import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.event.world.WorldInitEvent; import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.event.world.WorldSaveEvent; import org.bukkit.generator.ChunkGenerator; import org.bukkit.plugin.PluginLoadOrder; -// CraftBukkit +// CraftBukkit end public class MinecraftServer implements Runnable, ICommandListener { @@ -476,7 +477,13 @@ public class MinecraftServer implements Runnable, ICommandListener { while (this.s.size() > 0) { ServerCommand servercommand = (ServerCommand) this.s.remove(0); - // this.consoleCommandHandler.handle(servercommand); // CraftBukkit - Removed its now called in server.displatchCommand + // CraftBukkit start - ServerCommand for preprocessing + ServerCommandEvent event = new ServerCommandEvent(this.console, servercommand.command); + this.server.getPluginManager().callEvent(event); + servercommand = new ServerCommand(event.getCommand(), servercommand.b); + // CraftBukkit end + + // this.consoleCommandHandler.handle(servercommand); // CraftBukkit - Removed its now called in server.dispatchCommand this.server.dispatchCommand(this.console, servercommand); // CraftBukkit } } |