mirror of
https://github.com/PaperMC/Folia.git
synced 2024-11-22 12:05:12 +01:00
d1c9e63470
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
20 lines
1.2 KiB
Diff
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);
|
|
}
|