Actually do it correctly. Should be more forge friendly now.

This commit is contained in:
Christian 2013-11-13 19:10:11 -05:00
parent 56c9c3c77f
commit b7b97efe81
2 changed files with 20 additions and 29 deletions

View file

@ -64,19 +64,19 @@
} }
} }
@@ -804,7 +814,11 @@ @@ -804,6 +814,11 @@
public void func_72481_a(Packet3Chat p_72481_1_) public void func_72481_a(Packet3Chat p_72481_1_)
{ {
+ p_72481_1_ = FMLNetworkHandler.handleChatMessage(this, 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 +1418,11 @@
@@ -1403,6 +1417,11 @@
public void func_72494_a(Packet131MapData p_72494_1_) 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) 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); 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_) public void func_72501_a(Packet250CustomPayload p_72501_1_)
{ {
@ -100,7 +100,7 @@
if ("MC|TrList".equals(p_72501_1_.field_73630_a)) if ("MC|TrList".equals(p_72501_1_.field_73630_a))
{ {
DataInputStream datainputstream = new DataInputStream(new ByteArrayInputStream(p_72501_1_.field_73629_c)); 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; return this.field_72555_g;
} }

View file

@ -17,38 +17,29 @@
import net.minecraft.network.packet.Packet13PlayerLookMove; import net.minecraft.network.packet.Packet13PlayerLookMove;
import net.minecraft.network.packet.Packet14BlockDig; import net.minecraft.network.packet.Packet14BlockDig;
import net.minecraft.network.packet.Packet15Place; import net.minecraft.network.packet.Packet15Place;
@@ -618,6 +621,10 @@ @@ -618,6 +621,12 @@
public void func_72481_a(Packet3Chat p_72481_1_) public void func_72481_a(Packet3Chat p_72481_1_)
{ {
+ p_72481_1_ = FMLNetworkHandler.handleChatMessage(this, 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) 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))); 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); - s = StringUtils.normalizeSpace(s);
-
+ if (s != null)
+ {
for (int i = 0; i < s.length(); ++i) for (int i = 0; i < s.length(); ++i)
{ {
if (!ChatAllowedCharacters.func_71566_a(s.charAt(i))) if (!ChatAllowedCharacters.func_71566_a(s.charAt(i)))
@@ -666,7 +675,9 @@ @@ -1013,6 +1020,11 @@
{
this.func_72565_c("disconnect.spam");
}
- }
+ }
+ }
+ }
}
}
@@ -1013,6 +1024,11 @@
} }
public void func_72501_a(Packet250CustomPayload p_72501_1_) public void func_72501_a(Packet250CustomPayload p_72501_1_)
@ -60,7 +51,7 @@
{ {
DataInputStream datainputstream; DataInputStream datainputstream;
ItemStack itemstack; ItemStack itemstack;
@@ -1182,4 +1198,18 @@ @@ -1182,4 +1194,18 @@
{ {
return this.field_72576_c; return this.field_72576_c;
} }