mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@89cdcba5 [ci/skip] Replace wiki mention for BlockType#isOccluding (#12446) PaperMC/Paper@5f0b8292 Re-add chunk position check to regionfile recalculation patch PaperMC/Paper@04b91129 Update projects dependents GitHub Action (#12436) PaperMC/Paper@def0532f Fix writing headers and update to be more papery (#12459) PaperMC/Paper@d22644aa Expand cooldown API (#12435) PaperMC/Paper@df429932 Fix floating warning log when the kick event is canceled (#12374) PaperMC/Paper@a820bdae [ci/skip] Some javadoc fixes PaperMC/Paper@55f20209 Fix CCE in LingeringPotionSplashEvent (#12463) PaperMC/Paper@1410a22b Fix passengers sending when riding players PaperMC/Paper@767868dd Fix some components (#12457) PaperMC/Paper@9cddf136 Fix portal create event block list (#12373) PaperMC/Paper@a112d370 Fix horse_variant and tropical_fish_pattern (#12472) PaperMC/Paper@a211ac2e Remove unused warning (#12478) PaperMC/Paper@ae512811 Add isSuffocating to Block and BlockState (#12445) PaperMC/Paper@3409e2d7 Mace was not included in the ENCHANTABLE MaterialSetTag (#12476) PaperMC/Paper@1cfc96bc Add keyStream() API to registries (#12479) PaperMC/Paper@3222985e [ci/skip] Rebuild patches PaperMC/Paper@deaccd2c [ci/skip] Add file reference url to help.yml (#12481) PaperMC/Paper@f86b4352 Add vault change state event (#12069) PaperMC/Paper@3e3b42cd Update player chat session sync (#12382) PaperMC/Paper@f8fa4f6f Add method to retrieve FishHook (#12310) PaperMC/Paper@b9d3147d Use correct placed block position for sound (#12410) PaperMC/Paper@952338b3 [ci/skip] Add missing exception docs to Player#listPlayer (#12488) PaperMC/Paper@1db37853 [ci/skip] improve javadoc for off-hand swaps through getHotbarButton (#12489) PaperMC/Paper@d1810f24 Allow Server#getDefaultGameMode before worlds are initialized (#12490) PaperMC/Paper@02d20ff7 Fix NPE in Server#getMap before worlds are loaded (#12492) PaperMC/Paper@9e873f50 Fix inconsistencies between offline/online spawn position getter (#11960) PaperMC/Paper@fc0c3717 Fix handling of resultant crafting container from craftItemResult (#12307) PaperMC/Paper@a7a76c8f Add methods for Armadillo (#12031) PaperMC/Paper@a74400d9 Update adventure to 4.21.0 (#12499) PaperMC/Paper@1e930763 Fix ipv6 loopback addresses being able to get connection throttled (#12155) PaperMC/Paper@646b80ca Fix unnecessary map data saves (#12296) PaperMC/Paper@e663f999 Add combat tracker API (#11853) PaperMC/Paper@cd4fe5b7 [ci/skip] Drop non-applicable ATs (#12498) PaperMC/Paper@5acfdd6a Fix save/load NaN Entity Motion (#12269) PaperMC/Paper@2754d7c3 Add Throw EntityChangeBlockEvent for BrushableBlockEntity#brush (#12133) PaperMC/Paper@567f63ae Parity for respawn events (#11792) PaperMC/Paper@bc3d946f Normalizes CraftEntity#toString/getHandle (#12170) PaperMC/Paper@0e9b94d5 Fix ItemStack amount issues with Chat Components (#12216) PaperMC/Paper@835b9559 Add a method on InventoryView to get the MenuType (#12193) PaperMC/Paper@c9411bfb Fix min ItemStack amount check for asHoverEvent (#12505) PaperMC/Paper@1acf3b38 Infer block entity data in brigadier blockstate argument (#12197) PaperMC/Paper@b9b3cd65 Use components instead of ChatColor in more places (#12507) PaperMC/Paper@ec421715 Add missing spaces back (#12508) Purpur Changes: PurpurMC/Purpur@c3870bda Updated Upstream (Paper) PurpurMC/Purpur@8b5044e0 [ci/skip] add idea project icon PurpurMC/Purpur@f2f682fb Updated Upstream (Paper) PurpurMC/Purpur@bdeba761 Updated Upstream (Paper) PurpurMC/Purpur@96f5b044 drop void damage height/damage migration PurpurMC/Purpur@6cc78b63 Updated Upstream (Paper) PurpurMC/Purpur@4ce97c1d [ci/skip] Update occurences of version numbers to 1.21.5 (#1658) PurpurMC/Purpur@7f5c4036 Updated Upstream (Paper) PurpurMC/Purpur@4fdf1d11 Updated Upstream (Paper) PurpurMC/Purpur@8c77678e Updated Upstream (Paper)
84 lines
3.8 KiB
Diff
84 lines
3.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Sat, 26 Nov 2022 20:49:15 +0100
|
|
Subject: [PATCH] Last tick time API
|
|
|
|
License: MIT (https://opensource.org/licenses/MIT)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Add getLastTickMs api"
|
|
By: tr7zw <tr7zw@live.de>
|
|
As part of: YAPFA (https://github.com/tr7zw/YAPFA)
|
|
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
|
|
|
* YAPFA copyright *
|
|
|
|
Copyright 2020 tr7zw
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
|
index ccdd6fba261cb148cf02017c2bf779b3d3bb070b..10662089e8a08bae6c6077b72c30b14bb94cc2c7 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -3034,6 +3034,20 @@ public final class Bukkit {
|
|
}
|
|
// Paper end - Folia region threading API
|
|
|
|
+ // Gale start - YAPFA - last tick time - API
|
|
+ public static long getLastTickTotalTime() {
|
|
+ return server.getLastTickTotalTime();
|
|
+ }
|
|
+
|
|
+ public static long getLastTickProperTime() {
|
|
+ return server.getLastTickProperTime();
|
|
+ }
|
|
+
|
|
+ public static long getLastTickOversleepTime() {
|
|
+ return server.getLastTickOversleepTime();
|
|
+ }
|
|
+ // Gale end - YAPFA - last tick time - API
|
|
+
|
|
/**
|
|
* @deprecated All methods on this class have been deprecated, see the individual methods for replacements.
|
|
*/
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
|
index 4265607a6f5ca535a17756b417e22ac3478cfa5c..ea27c7ba247e7726ca623e6a22110f94f70f81c9 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -2764,4 +2764,29 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|
*/
|
|
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
|
|
// Paper end - API to check if the server is sleeping
|
|
+
|
|
+ // Gale start - YAPFA - last tick time - API
|
|
+ /**
|
|
+ * Gets the total time spent in the last tick,
|
|
+ * which includes both the time spent on processing as well as the time spent in oversleep.
|
|
+ *
|
|
+ * @return the total time spent in the last tick, in milliseconds
|
|
+ */
|
|
+ long getLastTickTotalTime();
|
|
+
|
|
+ /**
|
|
+ * Gets the time spent on processing in the last tick,
|
|
+ * not including the time spent in oversleep.
|
|
+ *
|
|
+ * @return the total time spent on processing in the last tick, in milliseconds
|
|
+ */
|
|
+ long getLastTickProperTime();
|
|
+
|
|
+ /**
|
|
+ * Gets the time spent in oversleep in the last tick.
|
|
+ *
|
|
+ * @return the total time spent in oversleep in the last tick, in milliseconds
|
|
+ */
|
|
+ long getLastTickOversleepTime();
|
|
+ // Gale end - YAPFA - last tick time - API
|
|
}
|