Paper/CraftBukkit-Patches/0041-Prevent-Ghost-Players-Caused-by-Plugins.patch

27 Zeilen
1.1 KiB
Diff

2014-04-19 01:15:23 +02:00
From b3497c286e366bd54813d98a74c2041fe298fb28 Mon Sep 17 00:00:00 2001
2014-04-12 06:18:37 +02:00
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
2014-04-17 21:47:40 +02:00
index e156a5a..4c5d77e 100644
2014-04-12 06:18:37 +02:00
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
2014-04-17 21:47:40 +02:00
@@ -492,6 +492,11 @@ public abstract class PlayerList {
2014-04-12 06:18:37 +02:00
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();
--
2014-04-19 01:15:23 +02:00
1.9.1
2014-04-12 06:18:37 +02:00