3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

Reset mainSupportingBlockPos on teleports

I cannot test this due to lack of hardware (took 30 minutes getting paper
updated and loaded into IJ on this machine...), however, this appears to be
doing what the folia equiv patch is
Dieser Commit ist enthalten in:
Shane Freeder 2023-07-05 23:13:30 +01:00
Ursprung 12c970097d
Commit 154ba310ee
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C

Datei anzeigen

@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Wed, 5 Jul 2023 23:11:53 +0100
Subject: [PATCH] Reset mainSupportingBlockPos on some teleport calls
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b777547cb9f8edf4e7b3c2cfb894f8cd1b1a35a5..5330840a44e1a4eb39554ac7d59f355d74476562 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1739,11 +1739,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
this.internalTeleport(d0, d1, d2, f, f1, set);
+ this.player.mainSupportingBlockPos = Optional.empty();
return event.isCancelled(); // CraftBukkit - Return event status
}
public void teleport(Location dest) {
this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet());
+ this.player.mainSupportingBlockPos = Optional.empty();
}
public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5b201d2c21f04e0223970035e0631f8f92ea0d3a..318a57f34d304fe00670eb207968138c1fe9d1fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1381,6 +1381,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Check if the fromWorld and toWorld are the same.
if (fromWorld == toWorld) {
entity.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), relativeArguments); // Paper - Teleport API
+ entity.mainSupportingBlockPos = Optional.empty(); // Paper
} else {
// The respawn reason should never be used if the passed location is non null.
server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck, null); // Paper