diff options
author | rmichela <deltahat@gmail.com> | 2012-01-19 03:32:05 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-01 04:33:59 -0500 |
commit | 1161de3f638e187e17677697b3663e13381b9d3d (patch) | |
tree | ecf371a6ae341603f8e347447b3b5d9dd4576adc /src/main/java/net/minecraft/server/NetServerHandler.java | |
parent | 818a61040e0e382f2fb1a385b657601b194b0083 (diff) | |
download | craftbukkit-1161de3f638e187e17677697b3663e13381b9d3d.tar craftbukkit-1161de3f638e187e17677697b3663e13381b9d3d.tar.gz craftbukkit-1161de3f638e187e17677697b3663e13381b9d3d.tar.lz craftbukkit-1161de3f638e187e17677697b3663e13381b9d3d.tar.xz craftbukkit-1161de3f638e187e17677697b3663e13381b9d3d.zip |
[Bleeding] Added Conversations API. Addresses BUKKIT-864
Diffstat (limited to 'src/main/java/net/minecraft/server/NetServerHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 316de4af..8f27a7ee 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -14,6 +14,7 @@ import org.bukkit.ChatColor; import org.bukkit.craftbukkit.ChunkCompressionThread; import org.bukkit.Location; import org.bukkit.command.CommandException; +import org.bukkit.conversations.Conversable; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.inventory.CraftInventoryView; import org.bukkit.craftbukkit.inventory.CraftItemStack; @@ -145,6 +146,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { if (leaveMessage != null) { this.minecraftServer.serverConfigurationManager.sendAll(new Packet3Chat(leaveMessage)); } + getPlayer().disconnect(s); // CraftBukkit end this.minecraftServer.serverConfigurationManager.disconnect(this.player); @@ -750,6 +752,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener { return false; } + if (getPlayer().isConversing()) { + getPlayer().acceptConversationInput(s); + return true; + } + if (s.startsWith("/")) { this.handleCommand(s); return true; @@ -801,7 +808,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } // CraftBukkit end - /* // CraftBukkit start - No longer needed as we have already handled it in server.dispatchCommand above. + /* // CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above. if (s.toLowerCase().startsWith("/me ")) { s = "* " + this.player.name + " " + s.substring(s.indexOf(" ")).trim(); logger.info(s); @@ -911,6 +918,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } public void a(Packet255KickDisconnect packet255kickdisconnect) { + // CraftBukkit start + getPlayer().disconnect("disconnect.quitting"); + // CraftBukkit end this.networkManager.a("disconnect.quitting", new Object[0]); } |