Files
ParchmentMC/patches/api/0014-Expanded-Insomnia-API-methods.patch
Lexi Larkin cc60bfd0f8 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@0bf8790 Fix client lag spikes due to client light recalc
PaperMC/Paper@aabf676 Prevent unloading worlds with pending player logins
PaperMC/Paper@eff22eb Ensure players are removed from pendingLogin
PaperMC/Paper@046466f Re-arrange most chunk system patches to front (#8338)
PaperMC/Paper@e8c2c3b Fix World#refreshChunk not working for chunks in no-tick range
PaperMC/Paper@09904fd Re-add legacy getChunkAtAsynchronously to ChunkProviderServer
PaperMC/Paper@36a5f15 Allow preventing BlockDestroyEvent from dropping items (#8349)
PaperMC/Paper@e51401e Updated Upstream (Bukkit/CraftBukkit/Spigot) (#8347)
PaperMC/Paper@51183af Fix console completer/highlighter having invalid source stack (#8346)
PaperMC/Paper@ef0e5a6 Updated Upstream (Bukkit/CraftBukkit/Spigot)
PaperMC/Paper@178f035 Restore no-crash behaviour when read-only config file(s) (#8318)
PaperMC/Paper@267dd18 Stop large look changes from crashing the server (#8326)
PaperMC/Paper@36f0c1b Rebuild patches
PaperMC/Paper@751d092 Properly close section storage managed files (#8364)
PaperMC/Paper@f5f84ff Add custom destroyerIdentity parameter to the sendBlockBreak function (#5840)
PaperMC/Paper@05f6a5c Limit size of Authenticator Cache Thread Pool (#8360)
PaperMC/Paper@ef670eb EndDragonFight killed statuses should be false for newly created worlds (#8354)
PaperMC/Paper@b826065 fire EntityChangeBlockEvent in more places (#6371)
PaperMC/Paper@34777cd Missing eating regain reason (#8244)
PaperMC/Paper@dbda887 Missing some effect cause (#8307)
PaperMC/Paper@63cb747 Added byte array serialization/deserialization for PersistentDataContainers (#7505)
PaperMC/Paper@ea777c3 Add a consumer parameter to ProjectileSource#launchProjectile (#8374)
PaperMC/Paper@470c638 Configurable chat thread limit (#7878)
PaperMC/Paper@dbc2d60 Make WorldCreator#keepSpawnLoaded return the WorldCreator (Fixes #8321) (#8371)
PaperMC/Paper@f8742e2 Also load resources from LibraryLoader (#8335)
PaperMC/Paper@f7e6809 Fix Pathfinding After World Has Changed (#8068)
PaperMC/Paper@ad3dffe Respect preventMovingIntoUnloadedChunks for optimized collision checking (#8259)
PaperMC/Paper@8db45c4 Copper clear on lightning strike calls EntityChangeBlockEvent (#8126)
PaperMC/Paper@9e614e6 Fix ground pathfinding (#7683)
PaperMC/Paper@339e85d Updated Upstream (CraftBukkit) (#8376)
PaperMC/Paper@980c1d1 Updated Upstream (Bukkit/CraftBukkit) (#8378)
PaperMC/Paper@8681503 Call EntityChangeBlockEvent for frogs egg (#8136)
PaperMC/Paper@ec0c550 Call BlockPhysicsEvent more often (#8264)
PaperMC/Paper@f528f53 Correct javadocs on PlayerArmorStandManipulateEvent (#7719)
PaperMC/Paper@3996e6e Updated Upstream (Bukkit/CraftBukkit/Spigot)
PaperMC/Paper@d332623 Avoid potential place where the world map could be modified after its iterator is created (#8315)
PaperMC/Paper@6736f39 Fix mangled patch
PaperMC/Paper@4d52f1d Add method isTickingWorlds to Bukkit (#8316)
PaperMC/Paper@62680d5 Avoid item meta usage for itemstack enchantment getter (#8373)
PaperMC/Paper@b4c025b Fix player desync on dimension change (#8253)
PaperMC/Paper@6d63005 Fix setEggCount method from TurtleLayEggEvent (#8385)
PaperMC/Paper@abe53a7 Fix typos in isTickingWorlds API javadocs (#8382)
PaperMC/Paper@01a1387 Rewrite chunk system (#8177)
PaperMC/Paper@b58c0cf Update snekyaml
2022-09-26 19:36:07 -04:00

57 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Blast-MC <cjblanton2@gmail.com>
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 7f4827819fc241866edb571f05e9b14d0955c0c4..1e7c5b991939e984d3448a5f9e0859857d04ce63 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -52,6 +52,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