geforkt von Mirrors/Paper
8407547d57
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
CraftBukkit Changes:
fc10dec5
Don't throw error on invalid data in CraftMetaItem.
39 Zeilen
1.8 KiB
Diff
39 Zeilen
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
|
Date: Sat, 22 Sep 2018 15:56:59 -0400
|
|
Subject: [PATCH] Return null if we get a ParseException in IChatBaseComponent
|
|
|
|
This is allowed as the method is explicitly marked as nullable and is
|
|
preferable to returning an empty string in this instance.
|
|
|
|
As a result, data that no longer parses correctly will not crash the server
|
|
instead just logging the exception and continuing (and in most cases should
|
|
fix the data)
|
|
|
|
Player data is fixed pretty much immediately but some block data (like
|
|
Shulkers) may need to be changed in order for it to re-save properly
|
|
|
|
No more crashing though.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
|
index ff14b3e09..03c148f4f 100644
|
|
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
|
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
|
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
|
@Nullable public static IChatBaseComponent jsonToComponent(String json) { return a(json);} // Paper - OBFHELPER
|
|
@Nullable
|
|
public static IChatBaseComponent a(String s) {
|
|
- return (IChatBaseComponent)ChatDeserializer.a(a, s, IChatBaseComponent.class, false);
|
|
+ // Paper start - Catch parse exception and return null
|
|
+ try {
|
|
+ return (IChatBaseComponent)ChatDeserializer.a(a, s, IChatBaseComponent.class, false);
|
|
+ } catch (JsonParseException ex) {
|
|
+ org.bukkit.Bukkit.getLogger().severe("Unable to deserialize component: " + s);
|
|
+ ex.printStackTrace();
|
|
+ return null;
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
|
|
@Nullable
|
|
--
|