From b7b97efe8192cc7ebdf69b4dd2d2e85a56c0f03f Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 13 Nov 2013 19:10:11 -0500 Subject: [PATCH] Actually do it correctly. Should be more forge friendly now. --- .../multiplayer/NetClientHandler.java.patch | 14 ++++---- .../network/NetServerHandler.java.patch | 35 +++++++------------ 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/fml/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch b/fml/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch index 4e66d9b04..606fefde1 100644 --- a/fml/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch +++ b/fml/patches/minecraft/net/minecraft/client/multiplayer/NetClientHandler.java.patch @@ -64,19 +64,19 @@ } } -@@ -804,7 +814,11 @@ +@@ -804,6 +814,11 @@ public void func_72481_a(Packet3Chat p_72481_1_) { + p_72481_1_ = FMLNetworkHandler.handleChatMessage(this, p_72481_1_); -+ if (p_72481_1_ != null) ++ if (p_72481_1_ == null) + { - this.field_72563_h.field_71456_v.func_73827_b().func_73765_a(ChatMessageComponent.func_111078_c(p_72481_1_.field_73476_b).func_111068_a(true)); ++ return; + } + this.field_72563_h.field_71456_v.func_73827_b().func_73765_a(ChatMessageComponent.func_111078_c(p_72481_1_.field_73476_b).func_111068_a(true)); } - public void func_72524_a(Packet18Animation p_72524_1_) -@@ -1403,6 +1417,11 @@ +@@ -1403,6 +1418,11 @@ public void func_72494_a(Packet131MapData p_72494_1_) { @@ -88,7 +88,7 @@ if (p_72494_1_.field_73438_a == Item.field_77744_bd.field_77779_bT) { ItemMap.func_77874_a(p_72494_1_.field_73436_b, this.field_72563_h.field_71441_e).func_76192_a(p_72494_1_.field_73437_c); -@@ -1514,6 +1533,11 @@ +@@ -1514,6 +1534,11 @@ public void func_72501_a(Packet250CustomPayload p_72501_1_) { @@ -100,7 +100,7 @@ if ("MC|TrList".equals(p_72501_1_.field_73630_a)) { DataInputStream datainputstream = new DataInputStream(new ByteArrayInputStream(p_72501_1_.field_73629_c)); -@@ -1707,4 +1731,20 @@ +@@ -1707,4 +1732,20 @@ { return this.field_72555_g; } diff --git a/fml/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch b/fml/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch index b977a9649..8f1d00121 100644 --- a/fml/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch +++ b/fml/patches/minecraft/net/minecraft/network/NetServerHandler.java.patch @@ -17,38 +17,29 @@ import net.minecraft.network.packet.Packet13PlayerLookMove; import net.minecraft.network.packet.Packet14BlockDig; import net.minecraft.network.packet.Packet15Place; -@@ -618,6 +621,10 @@ +@@ -618,6 +621,12 @@ public void func_72481_a(Packet3Chat p_72481_1_) { + p_72481_1_ = FMLNetworkHandler.handleChatMessage(this, p_72481_1_); -+ -+ if (p_72481_1_ != null) ++ ++ if (p_72481_1_ == null || p_72481_1_.field_73476_b == null) + { ++ return; ++ } if (this.field_72574_e.func_71126_v() == 2) { this.func_72567_b(new Packet3Chat(ChatMessageComponent.func_111077_e("chat.cannotSend").func_111059_a(EnumChatFormatting.RED))); -@@ -635,6 +642,8 @@ +@@ -633,8 +642,6 @@ + } + else { - s = StringUtils.normalizeSpace(s); - -+ if (s != null) -+ { +- s = StringUtils.normalizeSpace(s); +- for (int i = 0; i < s.length(); ++i) { if (!ChatAllowedCharacters.func_71566_a(s.charAt(i))) -@@ -666,7 +675,9 @@ - { - this.func_72565_c("disconnect.spam"); - } -- } -+ } -+ } -+ } - } - } - -@@ -1013,6 +1024,11 @@ +@@ -1013,6 +1020,11 @@ } public void func_72501_a(Packet250CustomPayload p_72501_1_) @@ -60,11 +51,11 @@ { DataInputStream datainputstream; ItemStack itemstack; -@@ -1182,4 +1198,18 @@ +@@ -1182,4 +1194,18 @@ { return this.field_72576_c; } -+ ++ + + @Override + public void func_72494_a(Packet131MapData p_72494_1_)