diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2012-10-27 23:21:10 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-10-27 23:25:10 -0500 |
commit | 5469311a365ecb931c81fb6bce5be429028e7b24 (patch) | |
tree | 0df6648b4412d96c67c13263c10638e33bc63cdf /src/main/java/net/minecraft/server | |
parent | 60819c6693daf19dde68b04af38a4fee8c7da988 (diff) | |
download | craftbukkit-5469311a365ecb931c81fb6bce5be429028e7b24.tar craftbukkit-5469311a365ecb931c81fb6bce5be429028e7b24.tar.gz craftbukkit-5469311a365ecb931c81fb6bce5be429028e7b24.tar.lz craftbukkit-5469311a365ecb931c81fb6bce5be429028e7b24.tar.xz craftbukkit-5469311a365ecb931c81fb6bce5be429028e7b24.zip |
Don't pass vanilla plugin channels to plugins. Fixes BUKKIT-2638
Vanilla has its own handlers for plugin channel messages for things like
texture packs, books, and anvils. When vanilla handles one of these messages
we should not also pass it to plugins because they will be duplicating work
and potentially running in to situations our plugin system isn't setup to
handle. This is how 1.3.2 worked but was lost in the 1.4.2 update.
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 02a3aaea..fb65c274 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -1509,31 +1509,30 @@ public class NetServerHandler extends NetHandler { containeranvil.a(""); } } - } - } - - // CraftBukkit start - if (packet250custompayload.tag.equals("REGISTER")) { - try { - String channels = new String(packet250custompayload.data, "UTF8"); - for (String channel : channels.split("\0")) { - getPlayer().addChannel(channel); - } - } catch (UnsupportedEncodingException ex) { - Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, "Could not parse REGISTER payload in plugin message packet", ex); - } - } else if (packet250custompayload.tag.equals("UNREGISTER")) { - try { - String channels = new String(packet250custompayload.data, "UTF8"); - for (String channel : channels.split("\0")) { - getPlayer().removeChannel(channel); + // CraftBukkit start + else if (packet250custompayload.tag.equals("REGISTER")) { + try { + String channels = new String(packet250custompayload.data, "UTF8"); + for (String channel : channels.split("\0")) { + getPlayer().addChannel(channel); + } + } catch (UnsupportedEncodingException ex) { + Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, "Could not parse REGISTER payload in plugin message packet", ex); + } + } else if (packet250custompayload.tag.equals("UNREGISTER")) { + try { + String channels = new String(packet250custompayload.data, "UTF8"); + for (String channel : channels.split("\0")) { + getPlayer().removeChannel(channel); + } + } catch (UnsupportedEncodingException ex) { + Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, "Could not parse UNREGISTER payload in plugin message packet", ex); + } + } else { + server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packet250custompayload.tag, packet250custompayload.data); } - } catch (UnsupportedEncodingException ex) { - Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, "Could not parse UNREGISTER payload in plugin message packet", ex); + // CraftBukkit end } - } else { - server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packet250custompayload.tag, packet250custompayload.data); } - // CraftBukkit end } } |