9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-29 11:39:10 +00:00
Files
Gale/patches/server/0110-Do-not-place-player-in-world-if-kicked-before-being-.patch

34 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Sun, 25 Dec 2022 23:14:40 +0100
Subject: [PATCH] Do not place player in world if kicked before being spawned
in
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Check if player is still connected after PlayerSpawnLocationEvent"
By: PureGero <puregero@gmail.com>
As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a8d0e6566183f440f8e2732e10b390ba8b6ed517..b74f809138d657bcfcaa68fc30984e591b1e908b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -275,6 +275,13 @@ public abstract class PlayerList {
org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(spawnPlayer, spawnPlayer.getLocation());
this.cserver.getPluginManager().callEvent(ev);
+ // Gale start - MultiPaper - do not place player in world if kicked before being spawned in
+ if (!connection.isConnected() || player.quitReason != null) {
+ /*pendingPlayers.remove(player.getUUID(), player);*/ // Gale - MultiPaper - do not place player in world if kicked before being spawned in - this patch was removed from Paper but might be useful later
+ return;
+ }
+ // Gale end - MultiPaper - do not place player in world if kicked before being spawned in
+
Location loc = ev.getSpawnLocation();
worldserver1 = ((CraftWorld) loc.getWorld()).getHandle();