mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Pufferfish Changes: pufferfish-gg/Pufferfish@c9f4e20 Final 1.20.4 Update pufferfish-gg/Pufferfish@1f3ad02 Final 1.20.4 update, for realzies pufferfish-gg/Pufferfish@b1ab664 Enable SIMD on java 21 pufferfish-gg/Pufferfish@0674c2b 1.21 compiles pufferfish-gg/Pufferfish@98ea973 Fix 1.21 version checkers pufferfish-gg/Pufferfish@68f859c Fix lambda/tick guard patch pufferfish-gg/Pufferfish@eaa18d5 Updated Upstream (Paper) pufferfish-gg/Pufferfish@1d72eea Updated Upstream (Paper) pufferfish-gg/Pufferfish@1d3c743 Update pufferfish version detector stuff pufferfish-gg/Pufferfish@5e30963 Fix crash bug pufferfish-gg/Pufferfish@12571eb Use mojmapped paperclip jar instead (CI only) pufferfish-gg/Pufferfish@4d16ae0 Drop a patch - moonrise includes it pufferfish-gg/Pufferfish@52c2d05 Revert "Drop a patch - moonrise includes it" pufferfish-gg/Pufferfish@bdb56f1 Fix entity interactions with fluids pufferfish-gg/Pufferfish@469e5c1 Updated Upstream (Paper) pufferfish-gg/Pufferfish@d75961f 1.21.1 Update (Updated Upstream (Paper))
118 lines
4.1 KiB
Diff
118 lines
4.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: YouHaveTrouble <youhavetrouble@youhavetrouble.me>
|
|
Date: Sun, 22 Aug 2021 05:11:09 +0200
|
|
Subject: [PATCH] Extended OfflinePlayer API
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
|
index 3993fecec5b4c2bbd77e175a168afcad571ce4d1..d0206c9c2f423a9b77237d9a005b9ee139dae70f 100644
|
|
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
|
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
|
@@ -557,4 +557,106 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
|
*/
|
|
@Nullable
|
|
public Location getLocation();
|
|
+
|
|
+ // Purpur start - OfflinePlayer API
|
|
+ /**
|
|
+ * Determines if the OfflinePlayer is allowed to fly via jump key double-tap like
|
|
+ * in creative mode.
|
|
+ *
|
|
+ * @return True if the player is allowed to fly.
|
|
+ */
|
|
+ public boolean getAllowFlight();
|
|
+
|
|
+ /**
|
|
+ * Sets if the OfflinePlayer is allowed to fly via jump key double-tap like in
|
|
+ * creative mode.
|
|
+ *
|
|
+ * @param flight If flight should be allowed.
|
|
+ */
|
|
+ public void setAllowFlight(boolean flight);
|
|
+
|
|
+ /**
|
|
+ * Checks to see if this player is currently flying or not.
|
|
+ *
|
|
+ * @return True if the player is flying, else false.
|
|
+ */
|
|
+ public boolean isFlying();
|
|
+
|
|
+ /**
|
|
+ * Makes this player start or stop flying.
|
|
+ *
|
|
+ * @param value True to fly.
|
|
+ */
|
|
+ public void setFlying(boolean value);
|
|
+
|
|
+ /**
|
|
+ * Sets the speed at which a client will fly. Negative values indicate
|
|
+ * reverse directions.
|
|
+ *
|
|
+ * @param value The new speed, from -1 to 1.
|
|
+ * @throws IllegalArgumentException If new speed is less than -1 or
|
|
+ * greater than 1
|
|
+ */
|
|
+ public void setFlySpeed(float value) throws IllegalArgumentException;
|
|
+
|
|
+ /**
|
|
+ * Sets the speed at which a client will walk. Negative values indicate
|
|
+ * reverse directions.
|
|
+ *
|
|
+ * @param value The new speed, from -1 to 1.
|
|
+ * @throws IllegalArgumentException If new speed is less than -1 or
|
|
+ * greater than 1
|
|
+ */
|
|
+ public void setWalkSpeed(float value) throws IllegalArgumentException;
|
|
+
|
|
+ /**
|
|
+ * Gets the current allowed speed that a client can fly.
|
|
+ *
|
|
+ * @return The current allowed speed, from -1 to 1
|
|
+ */
|
|
+ public float getFlySpeed();
|
|
+
|
|
+ /**
|
|
+ * Gets the current allowed speed that a client can walk.
|
|
+ *
|
|
+ * @return The current allowed speed, from -1 to 1
|
|
+ */
|
|
+ public float getWalkSpeed();
|
|
+
|
|
+ /**
|
|
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleport implementation.
|
|
+ *
|
|
+ * @param destination
|
|
+ * @return true if teleportation was successful
|
|
+ */
|
|
+ public boolean teleportOffline(@NotNull org.bukkit.Location destination);
|
|
+
|
|
+ /**
|
|
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleport implementation.
|
|
+ *
|
|
+ * @param destination
|
|
+ * @param cause Teleport cause used if player is online
|
|
+ * @return true if teleportation was successful
|
|
+ */
|
|
+ public boolean teleportOffline(@NotNull org.bukkit.Location destination, @NotNull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause);
|
|
+
|
|
+ /**
|
|
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleportAsync implementation.
|
|
+ *
|
|
+ * @param destination
|
|
+ * @return <code>true</code> if teleportation successful
|
|
+ */
|
|
+ @NotNull
|
|
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(@NotNull Location destination);
|
|
+
|
|
+ /**
|
|
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleportAsync implementation.
|
|
+ *
|
|
+ * @param destination
|
|
+ * @param cause Teleport cause used if player is online
|
|
+ * @return <code>true</code> if teleportation successful
|
|
+ */
|
|
+ @NotNull
|
|
+ public java.util.concurrent.CompletableFuture<Boolean> teleportOfflineAsync(@NotNull Location destination, @NotNull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause);
|
|
+ // Purpur end - OfflinePlayer API
|
|
}
|