From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Blast-MC Date: Sun, 24 Jul 2022 19:36:37 -0400 Subject: [PATCH] Expanded Insomnia API methods diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index e59cac883dc83186e0977a73b03636993696b37e..e4df334e6ceba43144114c1ad84cb5710b71030e 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -62,6 +62,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @Override @NotNull Player getPlayer(); + + /** + * Checks if the player will spawn phantoms at night + * Uses time since last rest statistic + * + * {@link #getTimeSinceLastRest()} + * + * @return if the player will spawn phantoms at night + */ + boolean isInsomniac(); + + /** + * Sets if the player bypasses phantom spawning if insomniac + * + * @param val + */ + void setBypassInsomnia(boolean val); + + /** + * Does the player bypass phantom spawning if insomniac + * + * @return if the player bypasses phantom spawning + */ + boolean doesBypassInsomnia(); + + /** + * Set the time since last rest stat for the player + * This modifies the phantom spawning timer + * + * @param ticks how long since last rest, greater than or equal to 1 + */ + void setTimeSinceLastRest(int ticks); + + /** + * Gets the time since the player last slept + * + * @return ticks since the player last slept + */ + int getTimeSinceLastRest(); // Parchment end // Paper start