update MCUtil.cmpFromMessage to use proper JSON

This commit is contained in:
Aikar 2016-04-11 01:06:28 -04:00
parent 8f89e0f84c
commit a0d38c0b55
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
From 2bce99d815e516c5ea740c9f161933d7f7f5bcdd Mon Sep 17 00:00:00 2001 From c3b8ab1a653c005db884e9393ddcf82f0e71a73e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400 Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils Subject: [PATCH] MC Utils
@ -7,7 +7,7 @@ Collection of utils to help reduce NMS diff
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644 new file mode 100644
index 0000000..abe7e9f index 0000000..349f2fc
--- /dev/null --- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +1,115 @@ @@ -0,0 +1,115 @@
@ -29,7 +29,7 @@ index 0000000..abe7e9f
+ * @return + * @return
+ */ + */
+ public static IChatBaseComponent cmpFromMessage(String str) { + public static IChatBaseComponent cmpFromMessage(String str) {
+ return IChatBaseComponent.ChatSerializer.a("{text:\"" + REPLACE_QUOTES.matcher(str).replaceAll("\\\"") + "\"}"); + return IChatBaseComponent.ChatSerializer.a("{\"text\":\"" + REPLACE_QUOTES.matcher(str).replaceAll("\\\"") + "\"}");
+ } + }
+ +
+ /** + /**
@ -127,5 +127,5 @@ index 0000000..abe7e9f
+ } + }
+} +}
-- --
2.8.0 2.8.1