mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-22 16:29:26 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@8fd3a67 [ci skip] Clean up book limits patch (#11297) PaperMC/Paper@dae906b Add getWorld method that uses adventure Key (#11199) PaperMC/Paper@ba1b016 Allow server administrators to disable book size checks (#10457) PaperMC/Paper@a8cb8e6 [ci skip] Fix JavaDocs for HeightMap#MOTION_BLOCKING_NO_LEAVES (#11291) PaperMC/Paper@e4b38b4 Fixup config parsing PaperMC/Paper@3271119 Fix SculkBloomEvent firing for block entity loading (#11306)
85 lines
3.7 KiB
Diff
85 lines
3.7 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 82567c13b3b65afa7ac9c64ad9b21c1a50125813..625f4f07b493826b13304960ba81e9ff0fd93ddb 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -2970,6 +2970,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
|
|
+
|
|
@NotNull
|
|
public static Server.Spigot spigot() {
|
|
return server.spigot();
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
|
index f47159c4b382f21bd2ff91acffb219ad6abca01d..b2c31cfa7013b2e98225444fa7c0a9c2efd97bb6 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -2607,4 +2607,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|
*/
|
|
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
|
|
// Paper end - Folia region threading API
|
|
+
|
|
+ // 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
|
|
+
|
|
}
|