mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 17:17:13 +01:00
a08be1ec7c
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 9294ebbf0 SPIGOT-5877: Add support for Vanilla custom dimensions
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 7dee17e52a5b23ba4d8089482b39215041a64579..602deb6b456de6cdefc480bf1aab959f9d60007d 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -1238,6 +1238,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
});
|
|
isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
|
|
// Paper end
|
|
+ new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.ticks+1).callEvent(); // Paper
|
|
|
|
++this.ticks;
|
|
this.b(booleansupplier);
|
|
@@ -1281,6 +1282,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
}
|
|
// Paper end
|
|
|
|
+ // Paper start
|
|
+ long endTime = System.nanoTime();
|
|
+ long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
|
+ new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.ticks, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
|
+ // Paper end
|
|
+
|
|
this.methodProfiler.enter("tallying");
|
|
long l = this.h[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i;
|
|
|