Paper/Spigot-Server-Patches/0441-Prevent-teleporting-dead-entities.patch
Spottedleaf bb4002d82e
Handle CraftPlayer#setSpectatorTarget better
Use a proper teleport for teleporting to entities in different
worlds.

Validate that the target entity is valid and deny spectate
requests from frozen players.

Also, make sure the entity is spawned to the client before
sending the camera packet. If the entity isn't spawned clientside
when it receives the camera packet, then the client will not
spectate the target entity.
2020-05-14 18:05:00 -05:00

22 lines
1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
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 c2820d45b1b0b95dff5112105f33cf423fb858cb..1673e5b8f13978cd4a47555b9806d801cbbdf3c8 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1217,6 +1217,10 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set) {
+ if (player.dead) {
+ LOGGER.info("Attempt to teleport dead player {} restricted", player.getName());
+ return;
+ }
// CraftBukkit start
if (Float.isNaN(f)) {
f = 0;