Use CraftChatMessage.fromComponent so that colors remain in sent messages

This commit is contained in:
Thinkofdeath 2014-12-12 21:46:12 +00:00
parent 64157d1de5
commit 95169d4765

View File

@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde/net/minecraft/server/PlayerList.java 2014-12-12 18:19:41.309646027 +1100 --- ../work/decompile-8eb82bde/net/minecraft/server/PlayerList.java 2014-12-12 21:45:59.845822542 +0000
+++ src/main/java/net/minecraft/server/PlayerList.java 2014-12-12 18:19:21.681773582 +1100 +++ src/main/java/net/minecraft/server/PlayerList.java 2014-12-12 21:44:44.381823361 +0000
@@ -18,6 +18,26 @@ @@ -18,6 +18,26 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -820,7 +820,7 @@
- this.sendAll(new PacketPlayOutChat(ichatbasecomponent, (byte) i)); - this.sendAll(new PacketPlayOutChat(ichatbasecomponent, (byte) i));
+ // CraftBukkit start - we run this through our processor first so we can get web links etc + // CraftBukkit start - we run this through our processor first so we can get web links etc
+ // PAIL: Rename + // PAIL: Rename
+ for (IChatBaseComponent component : CraftChatMessage.fromString(ichatbasecomponent.c())) { + for (IChatBaseComponent component : CraftChatMessage.fromString(CraftChatMessage.fromComponent(ichatbasecomponent))) {
+ this.sendAll(new PacketPlayOutChat(component, (byte) i)); + this.sendAll(new PacketPlayOutChat(component, (byte) i));
+ } + }
+ // CraftBukkit end + // CraftBukkit end