Paper/Spigot-Server-Patches/0441-Prevent-teleporting-dead-entities.patch
Aikar 57dd397155
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b999860d SPIGOT-2304: Add LootGenerateEvent

CraftBukkit Changes:
77fd87e4 SPIGOT-2304: Implement LootGenerateEvent
a1a705ee SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent
41712edd SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
2020-05-01 18:03:57 -04:00

25 lines
985 B
Diff

From 4d4e8a911ceec51125642a93a5351383e643c3d3 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 71d045ee00..2e81f3a1d9 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<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;
--
2.26.2