Skip to content

Commit

Permalink
Merge branch 'master' into async-chunks
Browse files Browse the repository at this point in the history
* master:
  Updated Upstream (CraftBukkit/Spigot)
  Make bad custom name resolution more specific
  • Loading branch information
aikar committed Sep 24, 2018
2 parents 861aee3 + 6170936 commit 63f9596
Show file tree
Hide file tree
Showing 14 changed files with 172 additions and 78 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 4b72c68d1947dece956e521879a05cc2e1fc17aa Mon Sep 17 00:00:00 2001
From ab368bfa90e92982355649962a5335f8eafbf888 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 16 Sep 2018 00:00:16 -0400
Subject: [PATCH] Optimize and Fix ExpiringMap Issues
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9cd4fe1400c656db6b44b26d2e883c1a7e3c75ed Mon Sep 17 00:00:00 2001
From eeb87a40d0b37892c9f4993e201a0823cb06bbcf Mon Sep 17 00:00:00 2001
From: Tassu <git@tassu.me>
Date: Thu, 13 Sep 2018 08:45:21 +0300
Subject: [PATCH] Implement furnace cook speed multiplier API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From a79d0cd5a53147b050963a5b5ed4bd51adda55f5 Mon Sep 17 00:00:00 2001
From f306b49af3cc10856ea04fe8f277a986ea90f91f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 17 Sep 2018 23:05:31 -0400
Subject: [PATCH] Support Overriding World Seeds
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 7547c08ec67686b4a45d51394f519f6e62274ebb Mon Sep 17 00:00:00 2001
From 4be2d5f3cc7878ce06c25cc338534301f90b04b5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 17 Sep 2018 23:37:31 -0400
Subject: [PATCH] Optimize Server World Map
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From c577bdb2c893529009c611e2e73c668b17c74f11 Mon Sep 17 00:00:00 2001
From 2192d9c353bda9068f63fae9378252d923448cba Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 18 Sep 2018 23:53:23 +0100
Subject: [PATCH] PreSpawnerSpawnEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 4f2b4578fee42ea0b9cf659046e0a2e65e9ff6a0 Mon Sep 17 00:00:00 2001
From 4ecf9eb0078780da3857ed41555a799445b85abb Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 20 Sep 2018 19:11:33 -0400
Subject: [PATCH] MC-134115: Fix Double Chest Conversion Error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fa5b6152426b80eafe26fabee4a477bea89afd27 Mon Sep 17 00:00:00 2001
From 192a5b761d782ec3576db72ceb19416670fa8b57 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 21 Sep 2018 11:34:00 -0400
Subject: [PATCH] Sync Player Position to Vehicles
Expand Down
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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 09b0529f9a30a17ba7c288f1ea973300b8f4e84f Mon Sep 17 00:00:00 2001
From e60758f4757a625ff2226db56c8c46b185fbbd77 Mon Sep 17 00:00:00 2001
From: Kyle Wood <demonwav@gmail.com>
Date: Sun, 23 Sep 2018 12:52:21 -0500
Subject: [PATCH] Enable experimental ASM support for Java 11 plugins
Expand All @@ -16,7 +16,7 @@ experimental API when required, so we check the class version first.
This should be removed as soon as ASM API 7 is stable.

diff --git a/pom.xml b/pom.xml
index 1e7d2b550..6d8b27e92 100644
index 1e7d2b5506..6d8b27e927 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,7 +83,7 @@
Expand All @@ -29,7 +29,7 @@ index 1e7d2b550..6d8b27e92 100644
</dependency>
<dependency>
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
index d172a1aeb..7f2a73d6f 100644
index d172a1aebc..7f2a73d6f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
@@ -127,7 +127,16 @@ public class Commodore
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From c91509cc42adc30f12bfd382da6e1ec5c0fe35e3 Mon Sep 17 00:00:00 2001
From d0f3b47cc1398f98add3c4ce36746b8515f64d65 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 1 Sep 2018 12:20:09 -0400
Subject: [PATCH] Async Chunk Loading and Generation
Expand Down Expand Up @@ -644,7 +644,7 @@ index 271dc41d45..bd15534c23 100644
private final MinecraftServer d;
private final java.nio.file.Path e;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f6c43bab46..e6bd85a223 100644
index 8c2ce70060..244302d45b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -209,7 +209,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
Expand Down
2 changes: 1 addition & 1 deletion work/CraftBukkit
Submodule CraftBukkit updated from 7d506c to dcb43e
2 changes: 1 addition & 1 deletion work/Spigot
Submodule Spigot updated from 68acb9 to f823ac

0 comments on commit 63f9596

Please sign in to comment.