Paper/patches/api/0390-Add-Player-Warden-Warning-API.patch
Jake Potrebic 41e6f20420
Updated Upstream (Bukkit/CraftBukkit) (#9342)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fdff0cd4 PR-869: Add Enderman#teleport and Enderman#teleportTowards
dfd86ee7 Improve sendSignChange and related documentation
beced2b2 PR-867: Add Player#sendBlockUpdate to send tile entity updates

CraftBukkit Changes:
ad6d0cffb SPIGOT-7394: Fix another issue with sendSignChange
66c5ce4c7 SPIGOT-7391: Preserve vanilla sign json where not modified by event
ae3824f94 PR-1204: Add Enderman#teleport and Enderman#teleportTowards
5863a2eae Fix sendSignChange not working
4a7eadc97 PR-1201: Add Player#sendBlockUpdate to send tile entity updates
789324e30 Work around issue placing decorated pots
2023-06-16 11:28:31 +01:00

71 Zeilen
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: dawon <dawon@dawon.eu>
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 c0501ab1d6d01b2a8bd8483b3a748858c960eb5c..dbb208e2badea38a4058491650b773192fae80bc 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3000,6 +3000,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