From 1ed64f82704c299d0f7ae9af710579be995af8de Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Sat, 21 Sep 2024 21:19:02 +0200 Subject: Update launchProjectile API (#11300) --- .../api/0454-API-for-checking-sent-chunks.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 patches/api/0454-API-for-checking-sent-chunks.patch (limited to 'patches/api/0454-API-for-checking-sent-chunks.patch') diff --git a/patches/api/0454-API-for-checking-sent-chunks.patch b/patches/api/0454-API-for-checking-sent-chunks.patch new file mode 100644 index 0000000000..a3844b5401 --- /dev/null +++ b/patches/api/0454-API-for-checking-sent-chunks.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Flo0 +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 4bc4a1c0c6f6759f984843823f1bbec6ffed92bc..7b699c1e63cf5bc805754101f28066f836877ee2 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -3804,6 +3804,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 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 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(); -- cgit v1.2.3