Paper/CraftBukkit-Patches/0040-Prevent-Ghost-Players-Caused-by-Plugins.patch
Zach Brown 7b0c576798 Restructure PaperSpigot as a new set of modules
Allows us much greater control over the Spigot portion of the code
and makes us more "proper"
Credit to @Dmck2b for originally passing the idea along a while back
2014-07-21 15:46:54 -05:00

27 lines
1.1 KiB
Diff

From e008aa2a88c19e96d3a8969c8847dbc0e5d8116b Mon Sep 17 00:00:00 2001
From: Alex Ciuba <alexciuba@gmail.com>
Date: Tue, 11 Jun 2013 15:23:03 -0400
Subject: [PATCH] Prevent Ghost Players Caused by Plugins
Check if the player is still connected after firing event. Fixes BUKKIT-4327
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 110b7e0..6341b2b 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -492,6 +492,11 @@ public abstract class PlayerList {
Player respawnPlayer = this.cserver.getPlayer(entityplayer1);
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn);
this.cserver.getPluginManager().callEvent(respawnEvent);
+ // Spigot Start
+ if (entityplayer.playerConnection.isDisconnected()) {
+ return entityplayer;
+ }
+ // Spigot End
location = respawnEvent.getRespawnLocation();
entityplayer.reset();
--
1.9.1