diff options
author | Shane Freeder <[email protected]> | 2024-05-09 14:51:33 +0100 |
---|---|---|
committer | Shane Freeder <[email protected]> | 2024-05-09 14:51:33 +0100 |
commit | 3693bbdc6b65e68db10375d3eeab70f06708b729 (patch) | |
tree | 4a71a5e6e5f50b3e2937053a5d4b4196ef67665b /patches/api/0381-Add-Player-Warden-Warning-API.patch | |
parent | f2512b12385961f8ca1f69efebe5ed0e00c0caa8 (diff) | |
download | Paper-timings/use-internals.tar.gz Paper-timings/use-internals.zip |
Use internals for getting block/entity countstimings/use-internals
For a long time I've been meaning to move some of this logic internally
as this would allow us to avoid hitting systems like block state snapshots
which can create issues as many of the spigot implementations of this
stuff are increasingly broken, leading to unexpected crashes during ticking,
even if the API cannot properly interact with these such states/items,
it's generally more preferable to not crash the server in the course,
and just let those interactions fail more gracefully.
Diffstat (limited to 'patches/api/0381-Add-Player-Warden-Warning-API.patch')
-rw-r--r-- | patches/api/0381-Add-Player-Warden-Warning-API.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/patches/api/0381-Add-Player-Warden-Warning-API.patch b/patches/api/0381-Add-Player-Warden-Warning-API.patch new file mode 100644 index 0000000000..42426a3ae4 --- /dev/null +++ b/patches/api/0381-Add-Player-Warden-Warning-API.patch @@ -0,0 +1,70 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: dawon <[email protected]> +Date: Sat, 15 Oct 2022 00:46:32 +0200 +Subject: [PATCH] Add Player Warden Warning API + + +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index ad61c664af66a15e214c5db14a5c9e172f5309ae..537ebbad48191741f666aa2a30c8584562dfcb83 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -3548,6 +3548,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param silent whether sound should be silenced + */ + void showElderGuardian(boolean silent); ++ ++ /** ++ * Returns the player's cooldown in ticks until the next Warden warning can occur. ++ * ++ * @return ticks until next Warden warning can occur. 0 means there is no cooldown left. ++ */ ++ int getWardenWarningCooldown(); ++ ++ /** ++ * Sets the player's cooldown in ticks until next Warden warning can occur. ++ * ++ * @param cooldown ticks until next Warden warning can occur. 0 means there is no cooldown left. Values less than 0 are set to 0. ++ */ ++ void setWardenWarningCooldown(int cooldown); ++ ++ /** ++ * Returns time since last Warden warning in ticks. ++ * ++ * @return ticks since last Warden warning ++ */ ++ int getWardenTimeSinceLastWarning(); ++ ++ /** ++ * Sets time since last Warden warning in ticks. ++ * ++ * @param time ticks since last Warden warning ++ */ ++ void setWardenTimeSinceLastWarning(int time); ++ ++ /** ++ * Returns the player's current Warden warning level. ++ * ++ * @return current Warden warning level ++ */ ++ int getWardenWarningLevel(); ++ ++ /** ++ * Sets the player's Warden warning level. ++ * <p> ++ * <b>Note:</b> This will not actually spawn the Warden. ++ * Even if the warning level is over threshold, the player still needs to activate a Shrieker in order to summon the Warden. ++ * ++ * @param warningLevel player's Warden warning level. The warning level is internally limited to valid values. ++ */ ++ void setWardenWarningLevel(int warningLevel); ++ ++ /** ++ * Increases the player's Warden warning level if possible and not on cooldown. ++ * <p> ++ * <b>Note:</b> This will not actually spawn the Warden. ++ * Even if the warning level is over threshold, the player still needs to activate a Shrieker in order to summon the Warden. ++ */ ++ void increaseWardenWarningLevel(); + // Paper end + + @NotNull |