From ccf1d5908fb24dd56ff46ada6e45ae5c4fbb5845 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 3 Mar 2020 05:28:35 +0000 Subject: [PATCH] Prevent teleporting dead entities (#2803) --- ...192-add-hand-to-BlockMultiPlaceEvent.patch | 9 +++---- ...45-Prevent-teleporting-dead-entities.patch | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 Spigot-Server-Patches/0445-Prevent-teleporting-dead-entities.patch diff --git a/Spigot-API-Patches/0192-add-hand-to-BlockMultiPlaceEvent.patch b/Spigot-API-Patches/0192-add-hand-to-BlockMultiPlaceEvent.patch index 89ea24ac59..34f3fa2648 100644 --- a/Spigot-API-Patches/0192-add-hand-to-BlockMultiPlaceEvent.patch +++ b/Spigot-API-Patches/0192-add-hand-to-BlockMultiPlaceEvent.patch @@ -1,4 +1,4 @@ -From 1735e9e48b344eb98d739f46cda33177ba37107e Mon Sep 17 00:00:00 2001 +From eeb73f0f817591d7385cc0db9bcc91e7b800f1f9 Mon Sep 17 00:00:00 2001 From: Trigary Date: Sun, 1 Mar 2020 22:43:34 +0100 Subject: [PATCH] add hand to BlockMultiPlaceEvent @@ -11,7 +11,7 @@ index fe2ec79dd..8460aa4f5 100644 @@ -18,9 +18,17 @@ import org.jetbrains.annotations.NotNull; public class BlockMultiPlaceEvent extends BlockPlaceEvent { private final List states; - + + @Deprecated // Paper public BlockMultiPlaceEvent(@NotNull List states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) { - super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild); @@ -25,7 +25,8 @@ index fe2ec79dd..8460aa4f5 100644 this.states = ImmutableList.copyOf(states); + //Paper end } - + /** --- +-- 2.25.0 + diff --git a/Spigot-Server-Patches/0445-Prevent-teleporting-dead-entities.patch b/Spigot-Server-Patches/0445-Prevent-teleporting-dead-entities.patch new file mode 100644 index 0000000000..915cb92d9c --- /dev/null +++ b/Spigot-Server-Patches/0445-Prevent-teleporting-dead-entities.patch @@ -0,0 +1,24 @@ +From f884e53d1700a3a0574ddb50a6400e50706d752e Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Tue, 3 Mar 2020 05:26:40 +0000 +Subject: [PATCH] Prevent teleporting dead entities + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 108377d76..c6bd62392 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -1209,6 +1209,10 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { ++ if (player.dead) { ++ LOGGER.info("Attempt to teleport dead player %s restricted", player.getName()); ++ return; ++ } + // CraftBukkit start + if (Float.isNaN(f)) { + f = 0; +-- +2.25.0 +