2019-07-23 19:17:32 +00:00
|
|
|
From 7ac59fdac9af57bab449c5d23341bdd924acad2c Mon Sep 17 00:00:00 2001
|
2019-03-28 02:49:29 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Wed, 27 Mar 2019 22:48:45 -0400
|
|
|
|
Subject: [PATCH] Server Tick Events
|
|
|
|
|
|
|
|
Fires event at start and end of a server tick
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2019-07-23 19:17:32 +00:00
|
|
|
index c92586ccd..73b8f7f99 100644
|
2019-03-28 02:49:29 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2019-07-23 19:17:32 +00:00
|
|
|
@@ -1054,6 +1054,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
2019-03-28 02:49:29 +00:00
|
|
|
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper
|
|
|
|
this.slackActivityAccountant.tickStarted(); // Spigot
|
2019-05-05 17:19:34 +00:00
|
|
|
long i = SystemUtils.getMonotonicNanos();
|
2019-03-28 02:49:29 +00:00
|
|
|
+ new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.ticks+1).callEvent(); // Paper
|
|
|
|
|
|
|
|
++this.ticks;
|
2019-05-05 17:19:34 +00:00
|
|
|
this.b(booleansupplier);
|
2019-07-23 19:17:32 +00:00
|
|
|
@@ -1100,6 +1101,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
2019-05-05 17:19:34 +00:00
|
|
|
this.methodProfiler.exit();
|
|
|
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
2019-03-28 02:49:29 +00:00
|
|
|
this.slackActivityAccountant.tickEnded(l); // Spigot
|
|
|
|
+ // Paper start
|
|
|
|
+ long endTime = System.nanoTime();
|
|
|
|
+ long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
2019-03-28 05:27:39 +00:00
|
|
|
+ new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.ticks, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
2019-03-28 02:49:29 +00:00
|
|
|
+ // Paper end
|
|
|
|
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2019-06-25 01:47:58 +00:00
|
|
|
2.22.0
|
2019-03-28 02:49:29 +00:00
|
|
|
|