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

34 lines
1.9 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 ed7ecc89a5b0ebd24c677adb93e512b29d2cb5b5..016640e983367174603957049fc3d4d205e05103 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -269,6 +269,13 @@ public abstract class PlayerList {
org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(spawnPlayer, spawnPlayer.getLocation()); // Paper use our duplicate event
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();