Limit Sign text to 384 json characters and strip control codes. This is 1.8.7's Sign fix. Thanks Searge.
This commit is contained in:
parent
b35aec4347
commit
1b689802a4
2 changed files with 12 additions and 1 deletions
|
@ -159,7 +159,7 @@
|
||||||
- System.arraycopy(p_147343_1_.func_180768_b(), 0, tileentitysign.field_145915_a, 0, 4);
|
- System.arraycopy(p_147343_1_.func_180768_b(), 0, tileentitysign.field_145915_a, 0, 4);
|
||||||
+ IChatComponent[] lines = p_147343_1_.func_180768_b(); //Forge: Prevent client from directly sending commands
|
+ IChatComponent[] lines = p_147343_1_.func_180768_b(); //Forge: Prevent client from directly sending commands
|
||||||
+ for (int x = 0; x < tileentitysign.field_145915_a.length && x < lines.length; x++)
|
+ for (int x = 0; x < tileentitysign.field_145915_a.length && x < lines.length; x++)
|
||||||
+ tileentitysign.field_145915_a[x] = new ChatComponentText(lines[x].func_150260_c());
|
+ tileentitysign.field_145915_a[x] = new ChatComponentText(net.minecraft.util.EnumChatFormatting.func_110646_a(lines[x].func_150260_c()));
|
||||||
+
|
+
|
||||||
tileentitysign.func_70296_d();
|
tileentitysign.func_70296_d();
|
||||||
worldserver.func_175689_h(blockpos);
|
worldserver.func_175689_h(blockpos);
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- ../src-base/minecraft/net/minecraft/network/play/client/C12PacketUpdateSign.java
|
||||||
|
+++ ../src-work/minecraft/net/minecraft/network/play/client/C12PacketUpdateSign.java
|
||||||
|
@@ -32,7 +32,7 @@
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
- this.field_149590_d[i] = p_148837_1_.func_179258_d();
|
||||||
|
+ this.field_149590_d[i] = IChatComponent.Serializer.func_150699_a(p_148837_1_.func_150789_c(384));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue