aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0453-API-for-checking-sent-chunks.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-10-25 12:47:52 -0700
committerSpottedleaf <[email protected]>2024-10-25 13:05:26 -0700
commite4efb590e49d30c9abe606838572aa5b4e9b5572 (patch)
tree9b60f27fd5f94daa2ea0a24edef90eb52c5811ea /patches/api/0453-API-for-checking-sent-chunks.patch
parent2e76d3f1e200c567e62337e0d50ddcb01e3ea895 (diff)
downloadPaper-e4efb590e49d30c9abe606838572aa5b4e9b5572.tar.gz
Paper-e4efb590e49d30c9abe606838572aa5b4e9b5572.zip
fix compile issues
Diffstat (limited to 'patches/api/0453-API-for-checking-sent-chunks.patch')
-rw-r--r--patches/api/0453-API-for-checking-sent-chunks.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/patches/api/0453-API-for-checking-sent-chunks.patch b/patches/api/0453-API-for-checking-sent-chunks.patch
new file mode 100644
index 0000000000..0c353a8070
--- /dev/null
+++ b/patches/api/0453-API-for-checking-sent-chunks.patch
@@ -0,0 +1,58 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Flo0 <[email protected]>
+Date: Mon, 8 Apr 2024 16:22:07 +0200
+Subject: [PATCH] API for checking sent chunks
+
+
+diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
+index b3b6cdf5491397e0e802ac91f5805d560ed5d88a..20db14b3075d70b34eab16ca6332a2e674b34e75 100644
+--- a/src/main/java/org/bukkit/entity/Player.java
++++ b/src/main/java/org/bukkit/entity/Player.java
+@@ -3844,6 +3844,47 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
+ void resetIdleDuration();
+ // Paper end
+
++ // Paper start - Add chunk view API
++ /**
++ * Gets the a set of chunk keys for all chunks that have been sent to the player.
++ *
++ * @return an immutable set of chunk keys
++ * @apiNote currently marked as experimental to gather feedback regarding the returned set being an immutable copy
++ * vs it potentially being an unmodifiable view of the set chunks.
++ */
++ @ApiStatus.Experimental
++ java.util.@NotNull @org.jetbrains.annotations.Unmodifiable Set<Long> getSentChunkKeys();
++
++ /**
++ * Gets the set of chunks that have been sent to the player.
++ *
++ * @return an immutable set of chunks
++ * @apiNote currently marked as experimental to gather feedback regarding the returned set being an immutable copy
++ * vs it potentially being an unmodifiable view of the set chunks.
++ */
++ @ApiStatus.Experimental
++ java.util.@NotNull @org.jetbrains.annotations.Unmodifiable Set<org.bukkit.Chunk> getSentChunks();
++
++ /**
++ * Checks if the player has been sent a specific chunk.
++ *
++ * @param chunk the chunk to check
++ * @return true if the player has been sent the chunk, false otherwise
++ */
++ default boolean isChunkSent(@NotNull org.bukkit.Chunk chunk) {
++ return this.isChunkSent(chunk.getChunkKey());
++ }
++
++ /**
++ * Checks if the player has been sent a specific chunk.
++ *
++ * @param chunkKey the chunk key to check
++ * @return true if the player has been sent the chunk, false otherwise
++ * @see org.bukkit.Chunk#getChunkKey()
++ */
++ boolean isChunkSent(long chunkKey);
++ // Paper end
++
+ @NotNull
+ @Override
+ Spigot spigot();