Folia/patches/server/0010-Work-around-https-github.com-PaperMC-paperweight-iss.patch
Spottedleaf d1c9e63470 Use teleportAsync for handling cancelled move events
Some plugins are bad and update the `from` position to something
completely garbage. To avoid a crash from this cross-region
teleportation, the teleportAsync function is now used.

The reason the teleport isn't simply ignored is since there may
be legitimate reasons to update the `from` position to something
off-region. This also handles the case where the plugin _uses_
an asynchronous teleport while cancelling the event.

This mirrors the behavior for changing the target destination
but not cancelling the event.

Fixes https://github.com/PaperMC/Folia/issues/115
2023-07-01 12:10:16 -07:00

20 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Wed, 29 Mar 2023 10:15:40 -0700
Subject: [PATCH] Work around https://github.com/PaperMC/paperweight/issues/194
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f405b376c313ef297b47191e25c43ad90813f673..ace5e9900eb4e08ace4fb24ffa66c6d6d03ab82a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -504,7 +504,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s), cause);
}
- @io.papermc.paper.annotation.DoNotUse // Paper
+ @Deprecated(forRemoval = true) // Folia - https://github.com/PaperMC/paperweight/issues/194
public void disconnect(final Component reason) {
this.disconnect(PaperAdventure.asAdventure(reason), org.bukkit.event.player.PlayerKickEvent.Cause.UNKNOWN);
}