Paper/Spigot-Server-Patches/0416-Prevent-teleporting-dead-entities.patch
Mariell a0b8b886c8
Updated Upstream (CraftBukkit/Spigot) (#4318)
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

CraftBukkit Changes:
d5a72960 SPIGOT-6063: ConsoleSender sending extra lines in Java 13+

Spigot Changes:
2740d5ae Rebuild patches
2020-09-12 15:57:21 -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 7dc2c389fba46867807d76f75fea9fd7264d82e3..d92b2bbfa1e2b284b624efd261d8803db1c4de2c 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;