mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-19 14:59:29 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@fcb2e815 Clear lastSection on game event listener removal PaperMC/Paper@636ae0cd Add missing Paper comments to player movement patch PaperMC/Paper@9be4e07a Pin snapshot dependencies (#12185) PaperMC/Paper@f12d33f0 Track codec writing PaperMC/Paper@1d9b3994 Add config option for failed beehive release cooldowns (#12186) PaperMC/Paper@5f2ee83e Fix first execution of async delayed/repeating tasks being sync (#12166) PaperMC/Paper@b00875f8 Add a method on Registry to get the size (#12182) PaperMC/Paper@ca261090 Don't process empty rcon commands (#12188) PaperMC/Paper@a501c459 Deprecate server config getters (#12189) PaperMC/Paper@7f3d3591 Use MiniMessage#deserialize(String, Pointered) in sendRichMessage for send messages (#12177) PaperMC/Paper@9b9f046f Remove broken code (#12171) PaperMC/Paper@fc56c728 Add methods for Creaking (#12094) PaperMC/Paper@f63dbeaf Fix cancelled HangingPlaceEvent inventory desync (#12161)
51 lines
2.5 KiB
Diff
51 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Sat, 26 Nov 2022 17:12:08 +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/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 19a14032a8f4ff937b1dea46c67806060204c558..93f115da494a66a756961b0cc16dea11010ea54f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -3346,4 +3346,21 @@ public final class CraftServer implements Server {
|
|
this.console.addPluginAllowingSleep(plugin.getName(), value);
|
|
}
|
|
// Paper end - API to check if the server is sleeping
|
|
+
|
|
+ // Gale start - YAPFA - last tick time - API
|
|
+ @Override
|
|
+ public long getLastTickTotalTime() {
|
|
+ return MinecraftServer.lastTickProperTime + MinecraftServer.lastTickOversleepTime;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public long getLastTickProperTime() {
|
|
+ return MinecraftServer.lastTickProperTime;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public long getLastTickOversleepTime() {
|
|
+ return MinecraftServer.lastTickOversleepTime;
|
|
+ }
|
|
+ // Gale end - YAPFA - last tick time - API
|
|
}
|