9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/paper-patches/features/0019-Last-tick-time-API.patch
Dreeam c8ba5fedc8 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@9b1798d6 Simplify custom payload handling (#12347)
PaperMC/Paper@2552abf0 fix message mutation in PlayerSetSpawnEvent
PaperMC/Paper@ae99e24f fix deprecated bungee chat api methods
PaperMC/Paper@dca4aab8 add util methods to CraftChatMessage
PaperMC/Paper@87c9d9b0 be more lenient on url parsing for legacy format
PaperMC/Paper@4a9bd2e3 Correctly clear items in PlayerDeathEvent
PaperMC/Paper@a70f7745 fix unsaveable launched trident
PaperMC/Paper@41a094cf move block data/state impl
PaperMC/Paper@6b26b219 remove hardcoded durability from material
PaperMC/Paper@db8c646d Merge remote-tracking branch 'origin/main' into update/1.21.5
2025-03-31 09:53:16 -04:00

51 lines
2.6 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 aa7bc955f53cea93d9409653ad1263c3c0a0888d..704b5fd8c10cdc5363f59fbd878d9453926d91c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -3231,4 +3231,21 @@ public final class CraftServer implements Server {
public void allowPausing(final Plugin plugin, final boolean value) {
this.console.addPluginAllowingSleep(plugin.getName(), value);
}
+
+ // 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
}