Paper/Spigot-Server-Patches/0417-Prevent-teleporting-dead-entities.patch
Aikar 1ab021ddca 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:
565a5727 #533: Add consumed item, hand and consumeItem boolean to EntityShootBowEvent

CraftBukkit Changes:
927200a9 #718: Add consumed item, hand and consumeItem boolean to EntityShootBowEvent
2020-08-31 08:30:51 -04:00

22 lines
1.0 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 3c7c092d3a2f0bf61fd9f548ff6f37ed7da6d843..71920337361847f677533703229afa97d7067319 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1235,6 +1235,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;