Don't reset current tick based on system time

This commit is contained in:
Shane Freeder 2018-08-10 15:25:45 +01:00
parent aca003c22a
commit c2c18b2b7f
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C
8 changed files with 53 additions and 47 deletions

View file

@ -1,4 +1,4 @@
From 9c0e6d5efe630d1753a9aaf4aa5d66b9e491f740 Mon Sep 17 00:00:00 2001
From 2831f4813271cbe1cbd11721c59bf1612f198dec Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 29 Feb 2016 18:48:17 -0600
Subject: [PATCH] Timings v2
@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
new file mode 100644
index 000000000..4d8b633ed
index 00000000..4d8b633e
--- /dev/null
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
@@ -0,0 +1,82 @@
@ -94,7 +94,7 @@ index 000000000..4d8b633ed
+}
diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java
new file mode 100644
index 000000000..8c43e2061
index 00000000..8c43e206
--- /dev/null
+++ b/src/main/java/co/aikar/timings/NullTimingHandler.java
@@ -0,0 +1,61 @@
@ -161,7 +161,7 @@ index 000000000..8c43e2061
+}
diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java
new file mode 100644
index 000000000..feddcdbd4
index 00000000..feddcdbd
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
@@ -0,0 +1,81 @@
@ -248,7 +248,7 @@ index 000000000..feddcdbd4
+}
diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java
new file mode 100644
index 000000000..b2260104c
index 00000000..b2260104
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timing.java
@@ -0,0 +1,76 @@
@ -330,7 +330,7 @@ index 000000000..b2260104c
+}
diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java
new file mode 100644
index 000000000..f222d6b7d
index 00000000..f222d6b7
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingData.java
@@ -0,0 +1,120 @@
@ -456,7 +456,7 @@ index 000000000..f222d6b7d
+}
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
new file mode 100644
index 000000000..916b6f9d6
index 00000000..916b6f9d
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
@@ -0,0 +1,209 @@
@ -671,7 +671,7 @@ index 000000000..916b6f9d6
+}
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
new file mode 100644
index 000000000..c2c2fb838
index 00000000..c2c2fb83
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -0,0 +1,352 @@
@ -1029,7 +1029,7 @@ index 000000000..c2c2fb838
+}
diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
new file mode 100644
index 000000000..0e114eb32
index 00000000..0e114eb3
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java
@@ -0,0 +1,55 @@
@ -1090,7 +1090,7 @@ index 000000000..0e114eb32
+}
diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java
new file mode 100644
index 000000000..623dda49c
index 00000000..623dda49
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingIdentifier.java
@@ -0,0 +1,102 @@
@ -1198,7 +1198,7 @@ index 000000000..623dda49c
+}
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
new file mode 100644
index 000000000..32e4bb1e2
index 00000000..32e4bb1e
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -0,0 +1,284 @@
@ -1488,7 +1488,7 @@ index 000000000..32e4bb1e2
+}
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
new file mode 100644
index 000000000..56b10e898
index 00000000..56b10e89
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
@@ -0,0 +1,119 @@
@ -1613,7 +1613,7 @@ index 000000000..56b10e898
+}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
new file mode 100644
index 000000000..df7f42595
index 00000000..df7f4259
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -0,0 +1,342 @@
@ -1961,7 +1961,7 @@ index 000000000..df7f42595
+}
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
new file mode 100644
index 000000000..58ed35e00
index 00000000..58ed35e0
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsManager.java
@@ -0,0 +1,196 @@
@ -2163,7 +2163,7 @@ index 000000000..58ed35e00
+}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
new file mode 100644
index 000000000..e7c389c05
index 00000000..e7c389c0
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -0,0 +1,72 @@
@ -2241,7 +2241,7 @@ index 000000000..e7c389c05
+}
diff --git a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java
new file mode 100644
index 000000000..5edaba128
index 00000000..5edaba12
--- /dev/null
+++ b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java
@@ -0,0 +1,51 @@
@ -2298,7 +2298,7 @@ index 000000000..5edaba128
+}
diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java
new file mode 100644
index 000000000..23ac07f2c
index 00000000..23ac07f2
--- /dev/null
+++ b/src/main/java/co/aikar/util/Counter.java
@@ -0,0 +1,35 @@
@ -2339,7 +2339,7 @@ index 000000000..23ac07f2c
+}
diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java
new file mode 100644
index 000000000..962749750
index 00000000..96274975
--- /dev/null
+++ b/src/main/java/co/aikar/util/JSONUtil.java
@@ -0,0 +1,129 @@
@ -2474,7 +2474,7 @@ index 000000000..962749750
+}
diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java
new file mode 100644
index 000000000..24eae4bea
index 00000000..24eae4be
--- /dev/null
+++ b/src/main/java/co/aikar/util/LoadingIntMap.java
@@ -0,0 +1,71 @@
@ -2551,7 +2551,7 @@ index 000000000..24eae4bea
+}
diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java
new file mode 100644
index 000000000..1474384e8
index 00000000..1474384e
--- /dev/null
+++ b/src/main/java/co/aikar/util/LoadingMap.java
@@ -0,0 +1,340 @@
@ -2897,7 +2897,7 @@ index 000000000..1474384e8
+}
diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java
new file mode 100644
index 000000000..df592d855
index 00000000..df592d85
--- /dev/null
+++ b/src/main/java/co/aikar/util/MRUMapCache.java
@@ -0,0 +1,102 @@
@ -3004,7 +3004,7 @@ index 000000000..df592d855
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ff7f436cb..b56c09d3e 100644
index ff7f436c..b56c09d3 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -525,7 +525,6 @@ public final class Bukkit {
@ -3016,7 +3016,7 @@ index ff7f436cb..b56c09d3e 100644
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index a766ee96c..4ddb8b02c 100644
index a766ee96..4ddb8b02 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1037,12 +1037,27 @@ public interface Server extends PluginMessageRecipient {
@ -3050,7 +3050,7 @@ index a766ee96c..4ddb8b02c 100644
*
diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java
new file mode 100644
index 000000000..fd452bce4
index 00000000..fd452bce
--- /dev/null
+++ b/src/main/java/org/bukkit/command/BufferedCommandSender.java
@@ -0,0 +1,18 @@
@ -3073,7 +3073,7 @@ index 000000000..fd452bce4
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 7ca5be840..86c780982 100644
index 7ca5be84..86c78098 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -32,7 +32,8 @@ public abstract class Command {
@ -3103,7 +3103,7 @@ index 7ca5be840..86c780982 100644
return true;
}
diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
index 502578837..9c80f4640 100644
index 50257883..9c80f464 100644
--- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java
+++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java
@@ -9,6 +9,7 @@ public class FormattedCommandAlias extends Command {
@ -3126,7 +3126,7 @@ index 502578837..9c80f4640 100644
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
new file mode 100644
index 000000000..5527e7c86
index 00000000..5527e7c8
--- /dev/null
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -0,0 +1,105 @@
@ -3236,7 +3236,7 @@ index 000000000..5527e7c86
+
+}
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index 1b5b37bfe..bdc0de8ce 100644
index 1b5b37bf..bdc0de8c 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -31,7 +31,7 @@ public class SimpleCommandMap implements CommandMap {
@ -3271,7 +3271,7 @@ index 1b5b37bfe..bdc0de8ce 100644
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
deleted file mode 100644
index bba914d7f..000000000
index bba914d7..00000000
--- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java
+++ /dev/null
@@ -1,253 +0,0 @@
@ -3529,7 +3529,7 @@ index bba914d7f..000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 9ed53bb4f..d3965bb38 100644
index 9ed53bb4..d3965bb3 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1582,6 +1582,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -3545,7 +3545,7 @@ index 9ed53bb4f..d3965bb38 100644
@Override
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 8b130abb7..80c152ba9 100644
index 8b130abb..80c152ba 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -293,7 +293,6 @@ public final class SimplePluginManager implements PluginManager {
@ -3602,7 +3602,7 @@ index 8b130abb7..80c152ba9 100644
}
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 113b899cc..81b428222 100644
index 113b899c..81b42822 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -40,7 +40,6 @@ import org.bukkit.plugin.PluginLoader;
@ -3651,7 +3651,7 @@ index 113b899cc..81b428222 100644
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
} else {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 2e028f53c..0c906451d 100644
index af8af8ef..44093af2 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -23,7 +23,8 @@ import org.bukkit.plugin.PluginDescriptionFile;
@ -3665,7 +3665,7 @@ index 2e028f53c..0c906451d 100644
private final Map<String, Class<?>> classes = new java.util.concurrent.ConcurrentHashMap<String, Class<?>>(); // Spigot
private final PluginDescriptionFile description;
diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java
index 5ca863b36..048047067 100644
index 5ca863b3..04804706 100644
--- a/src/main/java/org/bukkit/util/CachedServerIcon.java
+++ b/src/main/java/org/bukkit/util/CachedServerIcon.java
@@ -12,4 +12,6 @@ import org.bukkit.event.server.ServerListPingEvent;
@ -3677,7 +3677,7 @@ index 5ca863b36..048047067 100644
+ public String getData(); // Spigot
+}
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
index 8d982974e..7e89b97b6 100644
index 8d982974..7e89b97b 100644
--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java
+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java
@@ -1,165 +1,76 @@

View file

@ -1,11 +1,11 @@
From a2109a705cd50a98a3ecfd75285838711f9966a0 Mon Sep 17 00:00:00 2001
From cbc4b8ccddefe526f7a8f9e259b0903c562f1b2c Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Mon, 29 Feb 2016 17:22:34 -0600
Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d3965bb38..4412f6eea 100644
index d3965bb3..4412f6ee 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1483,6 +1483,20 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -1,4 +1,4 @@
From 5afd01f2ac262d4c1074c7eacb0550eebb115731 Mon Sep 17 00:00:00 2001
From 32b618438e80adb32b830992adee5e627f614ef2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 29 Feb 2016 17:24:57 -0600
Subject: [PATCH] Add getTPS method

View file

@ -1,4 +1,4 @@
From 9275a4d5758169700f30e763bdc4875991a3fbaa Mon Sep 17 00:00:00 2001
From c350ad1bbe75078257c7b9ea831d0b9fcfc4900e Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 17:50:31 -0600
Subject: [PATCH] Entity Origin API

View file

@ -1,4 +1,4 @@
From e620711210aa3c63c7db3c39154cfecd9acc9e08 Mon Sep 17 00:00:00 2001
From 04153abcdce66e6c07ab6ee82ecc367ebf6de536 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 17:58:01 -0600
Subject: [PATCH] Check Paper versions

View file

@ -1,4 +1,4 @@
From 2ee52b020013ad95861d196908450fa2fc227431 Mon Sep 17 00:00:00 2001
From cb532e30452b3b3a7143ce5764711c2bf41e92cf Mon Sep 17 00:00:00 2001
From: Isaac Moore <rmsy@me.com>
Date: Mon, 29 Feb 2016 18:02:25 -0600
Subject: [PATCH] Add PlayerLocaleChangeEvent
@ -61,5 +61,5 @@ index 00000000..29dd763a
+ }
+}
--
2.17.0 (Apple Git-106)
2.18.0

View file

@ -1,11 +1,11 @@
From 360891817c22a8bf6705820bde2579dc065224a7 Mon Sep 17 00:00:00 2001
From f55af4cd8b293ae009697b6891b00c8dcf9d648f Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 18:05:37 -0600
Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 4412f6eea..d5b904e61 100644
index 4412f6ee..d5b904e6 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1497,6 +1497,20 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline

View file

@ -1,4 +1,4 @@
From f4c7b7aa414803e6f57d9cdaaeb9542609f926e8 Mon Sep 17 00:00:00 2001
From ecccdf30b45088c8dec9353e0e709b6bb1bf437a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 Mar 2016 23:09:29 -0600
Subject: [PATCH] Further improve server tick loop
@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c72bdd29d1..9db0540c1f 100644
index c72bdd29d1..687250c639 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -142,7 +142,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@ -95,7 +95,7 @@ index c72bdd29d1..9db0540c1f 100644
public void run() {
try {
@@ -693,24 +731,41 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
@@ -693,29 +731,46 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
// Spigot start
Arrays.fill( recentTps, 20 );
@ -148,6 +148,12 @@ index c72bdd29d1..9db0540c1f 100644
tickSection = curTime;
}
lastTick = curTime;
- MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
+ //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
this.v();
this.aa += 50L;
// Spigot end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c2d479dd11..d28205cdfc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java