9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-api/paper-patches/features/0007-Slice-Smooth-Teleports.patch
Dreeam 9ead0ae73d Updated Upstream (Paper/Gale/Purpur)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@597dcfff Add support for lz4 (#12053)
PaperMC/Paper@53ae5c95 Make Sittable interface extend Entity (#12016)
PaperMC/Paper@786ddf53 Default piston block entity direction to DOWN (#12039)
PaperMC/Paper@cb6c57e0 Fix Squid and Dolphin spawn height (#12045)
PaperMC/Paper@51acc802 Prevent duplicate raider in RaidSpawnWaveEvent list (#12040)
PaperMC/Paper@61312fdb Switch to jspecify annotations for Player (#12042)
PaperMC/Paper@1a04e96a Fix EntityBreedEvent cancellation (#12046)
PaperMC/Paper@eff617b8 [ci/skip] Deprecate Server#setSpawnRadius (#12024)
PaperMC/Paper@edacfdf4 Do not queue player info packets (#12080)
PaperMC/Paper@cafef9ce [ci/skip] Move EntityUtil to correct directory (#12092)

Gale Changes:
Dreeam-qwq/Gale@1c139da5 Updated Upstream (Paper)

Purpur Changes:
PurpurMC/Purpur@c038d785 Updated Upstream (Paper)
PurpurMC/Purpur@708a2fd9 fix: properly apply breeding-delay-ticks option for turtles
PurpurMC/Purpur@e6a1ebd3 Updated Upstream (Paper)
2025-02-10 10:53:52 -05:00

49 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cryptite <cryptite@gmail.com>
Date: Sat, 13 Aug 2022 08:58:21 -0500
Subject: [PATCH] Slice: Smooth Teleports
Original license: MIT
Original project: https://github.com/Cryptite/Slice
Co-authored-by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2a8abee51e8fad62b0aa58a47eadfbac2bf51fdf..afdec702fbe37d49cac6a80561a9dfdc4904d48a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3709,6 +3709,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
String getClientBrandName();
// Paper end
+ /**
+ * This abuses some of how Minecraft works and attempts to teleport a player to another world without
+ * triggering typical respawn packets. All of natural state of chunk resends, entity adds/removes, etc still
+ * happen but the visual "refresh" of a world change is hidden. Depending on the destination location/world,
+ * this can act as a "smooth teleport" to a world if the new world is very similar looking to the old one.
+ *
+ * @param location New location to teleport this Player to
+ * @deprecated use {@link #teleportWithoutRespawnOptionally(Location)}
+ */
+ // Slice start
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ @Deprecated(since = "1.21.1", forRemoval = true)
+ void teleportWithoutRespawn(@NotNull Location location);
+
+ /**
+ * This abuses some of how Minecraft works and attempts to teleport a player to another world without
+ * triggering typical respawn packets. All of natural state of chunk resends, entity adds/removes, etc still
+ * happen but the visual "refresh" of a world change is hidden. Depending on the destination location/world,
+ * this can act as a "smooth teleport" to a world if the new world is very similar looking to the old one.
+ *
+ * @param location New location to teleport this Player to
+ * @return Whether the teleport was successful
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ boolean teleportWithoutRespawnOptionally(@NotNull Location location);
+ // Slice end
+
// Paper start - Teleport API
/**
* Sets the player's rotation.