-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into async-chunks
* master: Updated Upstream (CraftBukkit/Spigot) Make bad custom name resolution more specific
- Loading branch information
Showing
14 changed files
with
172 additions
and
78 deletions.
There are no files selected for viewing
23 changes: 0 additions & 23 deletions
23
Spigot-Server-Patches/0373-MC-136886-Don-t-load-chunks-looking-for-features.patch
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...Optimize-and-Fix-ExpiringMap-Issues.patch → ...Optimize-and-Fix-ExpiringMap-Issues.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t-furnace-cook-speed-multiplier-API.patch → ...t-furnace-cook-speed-multiplier-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...0376-Support-Overriding-World-Seeds.patch → ...0375-Support-Overriding-World-Seeds.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ches/0377-Optimize-Server-World-Map.patch → ...ches/0376-Optimize-Server-World-Map.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r-Patches/0378-PreSpawnerSpawnEvent.patch → ...r-Patches/0377-PreSpawnerSpawnEvent.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...5-Fix-Double-Chest-Conversion-Error.patch → ...5-Fix-Double-Chest-Conversion-Error.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...80-Sync-Player-Position-to-Vehicles.patch → ...79-Sync-Player-Position-to-Vehicles.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
Spigot-Server-Patches/0380-Catch-JsonParseException-in-Entity-and-TE-names.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
From fb750f7e99c0c9d56b594609f9f61e6fb6d38216 Mon Sep 17 00:00:00 2001 | ||
From: Zach Brown <zach.brown@destroystokyo.com> | ||
Date: Sat, 22 Sep 2018 15:56:59 -0400 | ||
Subject: [PATCH] Catch JsonParseException in Entity and TE names | ||
|
||
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/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java | ||
index 729859d132..2a1dffbf48 100644 | ||
--- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java | ||
+++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java | ||
@@ -57,7 +57,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { | ||
this.g = nbttagcompound.getString("Command"); | ||
this.d = nbttagcompound.getInt("SuccessCount"); | ||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.h = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.h = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) { | ||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java | ||
index f6c43bab46..8c2ce70060 100644 | ||
--- a/src/main/java/net/minecraft/server/Entity.java | ||
+++ b/src/main/java/net/minecraft/server/Entity.java | ||
@@ -1733,7 +1733,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke | ||
this.setPosition(this.locX, this.locY, this.locZ); | ||
this.setYawPitch(this.yaw, this.pitch); | ||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"))); | ||
+ this.setCustomName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException | ||
} | ||
|
||
this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible")); | ||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java | ||
index f7856897f6..e11f439ff1 100644 | ||
--- a/src/main/java/net/minecraft/server/MCUtil.java | ||
+++ b/src/main/java/net/minecraft/server/MCUtil.java | ||
@@ -363,4 +363,19 @@ public final class MCUtil { | ||
return null; | ||
} | ||
} | ||
+ | ||
+ @Nullable | ||
+ public static IChatBaseComponent getBaseComponentFromNbt(String key, NBTTagCompound compound) { | ||
+ if (!compound.hasKey(key)) { | ||
+ return null; | ||
+ } | ||
+ String string = compound.getString(key); | ||
+ try { | ||
+ return IChatBaseComponent.ChatSerializer.jsonToComponent(string); | ||
+ } catch (com.google.gson.JsonParseException e) { | ||
+ org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); | ||
+ } | ||
+ | ||
+ return null; | ||
+ } | ||
} | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java | ||
index b4fae0d307..364a9fa7a9 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityBanner.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityBanner.java | ||
@@ -74,7 +74,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity { | ||
public void load(NBTTagCompound nbttagcompound) { | ||
super.load(nbttagcompound); | ||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.a = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.a = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
if (this.hasWorld()) { | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java | ||
index 480faa66e4..f3ddb86d04 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java | ||
@@ -236,7 +236,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl | ||
ContainerUtil.b(nbttagcompound, this.items); | ||
this.brewTime = nbttagcompound.getShort("BrewTime"); | ||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.k = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.k = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
this.fuelLevel = nbttagcompound.getByte("Fuel"); | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java | ||
index 7594c16e99..8037930727 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityChest.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java | ||
@@ -83,7 +83,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic | ||
} | ||
|
||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.i = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.i = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
} | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java | ||
index ddd2e0eb0b..21bd156e91 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityDispenser.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java | ||
@@ -107,7 +107,7 @@ public class TileEntityDispenser extends TileEntityLootable { | ||
} | ||
|
||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.i = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.i = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
} | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java | ||
index a537d35b73..f6bc6403fb 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java | ||
@@ -219,7 +219,7 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve | ||
} | ||
|
||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.l = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.l = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
// Paper start - cook speed API | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java | ||
index a8cf160fe4..c56422170c 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java | ||
@@ -61,7 +61,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi | ||
} | ||
|
||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.setCustomName(IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName"))); | ||
+ this.setCustomName(MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound)); // Paper - Catch ParseException | ||
} | ||
|
||
this.f = nbttagcompound.getInt("TransferCooldown"); | ||
diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java | ||
index df9a30560c..65a6854521 100644 | ||
--- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java | ||
+++ b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java | ||
@@ -254,7 +254,7 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn | ||
} | ||
|
||
if (nbttagcompound.hasKeyOfType("CustomName", 8)) { | ||
- this.i = IChatBaseComponent.ChatSerializer.a(nbttagcompound.getString("CustomName")); | ||
+ this.i = MCUtil.getBaseComponentFromNbt("CustomName", nbttagcompound); // Paper - Catch ParseException | ||
} | ||
|
||
} | ||
-- | ||
2.19.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
Spigot-Server-Patches/0381-Return-null-if-we-get-a-ParseException-in-IChatBaseC.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule CraftBukkit
updated
from 7d506c to dcb43e
Submodule Spigot
updated
from 68acb9 to f823ac