Paper/CraftBukkit-Patches/0105-Normalize-spaces-on-when-reading-a-chat-packet.patch
2014-04-24 16:33:42 +10:00

36 lines
1.7 KiB
Diff

From 2aaa2a94260bdbe00371e1e246800cf7b7c91a4a Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Wed, 26 Feb 2014 14:45:22 +0000
Subject: [PATCH] Normalize spaces on when reading a chat packet
diff --git a/src/main/java/net/minecraft/server/PacketPlayInChat.java b/src/main/java/net/minecraft/server/PacketPlayInChat.java
index d419f0f..b26c290 100644
--- a/src/main/java/net/minecraft/server/PacketPlayInChat.java
+++ b/src/main/java/net/minecraft/server/PacketPlayInChat.java
@@ -17,7 +17,7 @@ public class PacketPlayInChat extends Packet {
}
public void a(PacketDataSerializer packetdataserializer) throws IOException { // CraftBukkit - added throws
- this.message = packetdataserializer.c(100);
+ this.message = org.apache.commons.lang.StringUtils.normalizeSpace( packetdataserializer.c( 100 ) ); // Spigot
}
public void b(PacketDataSerializer packetdataserializer) throws IOException { // CraftBukkit - added throws
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 652f7a1..68c1f27 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -792,7 +792,7 @@ public class PlayerConnection implements PacketPlayInListener {
this.player.v();
String s = packetplayinchat.c();
- s = StringUtils.normalizeSpace(s);
+ // s = StringUtils.normalizeSpace(s); Spigot - Moved to PacketPlayInChat
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
--
1.9.1