aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0184-Don-t-process-packets-from-offline-players.patch
blob: e985cb3a1dfc1e5e2dd0ee7b76d9f5e1b9882c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 440a5d1b8f3e5356c9ead921f7a6059fdf028790 Mon Sep 17 00:00:00 2001
From: "From: Alfie Cleveland" <alfeh@me.com>
Date: Mon, 28 Nov 2016 15:56:28 -0600
Subject: [PATCH] Don't process packets from offline players


diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 301313b1f..865c1a295 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -14,6 +14,7 @@ import javax.annotation.Nullable;
 // CraftBukkit start
 import org.bukkit.craftbukkit.entity.CraftHumanEntity;
 import org.bukkit.craftbukkit.entity.CraftItem;
+import org.bukkit.craftbukkit.entity.CraftPlayer; // Paper
 import org.bukkit.craftbukkit.event.CraftEventFactory;
 import org.bukkit.entity.Player;
 import org.bukkit.event.entity.EntityCombustByEntityEvent;
@@ -301,7 +302,7 @@ public abstract class EntityHuman extends EntityLiving {
     }
 
     protected boolean cj() {
-        return this.getHealth() <= 0.0F || this.isSleeping();
+        return this.getHealth() <= 0.0F || this.isSleeping() || (this.bukkitEntity != null && this.bukkitEntity instanceof CraftPlayer && !((CraftPlayer) this.bukkitEntity).isOnline()); // Paper - Pull #517
     }
 
     public void closeInventory() {
-- 
2.34.0