From d08d908d6de41eb86d5a791816879b9204114531 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Mon, 4 Feb 2019 23:43:28 -0500 Subject: [PATCH] Block Entity#remove from being called on Players This doesn't result in the same behavior as other entities and causes several problems. Anyone ever complain about the "Cannot send chat message" thing? That's one of the issues this causes, among others. If a plugin developer can come up with a valid reason to call this on a Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. --- ...-remove-from-being-called-on-Players.patch | 30 +++++++++++++++++++ .../ShulkerBox-Dupe-Prevention.patch | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch diff --git a/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch new file mode 100644 index 0000000000..f040afaf61 --- /dev/null +++ b/Spigot-Server-Patches/Block-Entity-remove-from-being-called-on-Players.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Mon, 4 Feb 2019 23:33:24 -0500 +Subject: [PATCH] Block Entity#remove from being called on Players + +This doesn't result in the same behavior as other entities and causes +several problems. Anyone ever complain about the "Cannot send chat +message" thing? That's one of the issues this causes, among others. + +If a plugin developer can come up with a valid reason to call this on a +Player we will look at limiting the scope of this change. It appears to +be unintentional in the few cases we've seen so far. + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 36a38713..7b7dc7f2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + public void resetCooldown() { + getHandle().resetCooldown(); + } ++ ++ @Override ++ public void remove() { ++ throw new UnsupportedOperationException("Calling Entity#remove on players produces undefined (bad) behavior"); ++ } + //Paper end + + // Spigot start +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/ShulkerBox-Dupe-Prevention.patch b/Spigot-Server-Patches/ShulkerBox-Dupe-Prevention.patch index a95e539f79..739c82be2d 100644 --- a/Spigot-Server-Patches/ShulkerBox-Dupe-Prevention.patch +++ b/Spigot-Server-Patches/ShulkerBox-Dupe-Prevention.patch @@ -7,7 +7,7 @@ This ensures that Shulker Boxes can never drop their contents twice, and that the inventory is cleared incase it some how also got saved to the world. diff --git a/src/main/java/net/minecraft/server/BlockShulkerBox.java b/src/main/java/net/minecraft/server/BlockShulkerBox.java -index de8fc8bba..978c9954d 100644 +index ab0ece55..997ed795 100644 --- a/src/main/java/net/minecraft/server/BlockShulkerBox.java +++ b/src/main/java/net/minecraft/server/BlockShulkerBox.java @@ -0,0 +0,0 @@ public class BlockShulkerBox extends BlockTileEntity {