diff --git a/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch index 8605e3b790..9016e8036c 100644 --- a/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/0021-Further-improve-server-tick-loop.patch @@ -1,4 +1,4 @@ -From 14d985bda1f2c27a8183951306c6e8d345e4126e Mon Sep 17 00:00:00 2001 +From f3da067cdacebf6d94879911c518955217ef072c Mon Sep 17 00:00:00 2001 From: Aikar 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 2fc8c192b..3a95b0bf8 100644 +index 2fc8c192b..db60cbc7b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -150,7 +150,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 5000L && this.nextTick - this.lastOverloadTime >= 30000L) { // CraftBukkit -- long j = i / 50L; -- -- if (server.getWarnOnOverload()) // CraftBukkit + long i = (curTime = SystemUtils.getMonotonicMillis()) - this.nextTick; + +@@ -777,22 +829,29 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0) { -+ if (catchupTime < 2E6) { -+ wait += Math.abs(catchupTime); -+ } else if (wait < catchupTime) { -+ catchupTime -= wait; -+ wait = 0; -+ } else { -+ wait -= catchupTime; -+ catchupTime = 0; -+ } -+ } -+ if (wait > 0) { -+ Thread.sleep(wait / 1000000); -+ curTime = System.nanoTime(); -+ wait = TICK_TIME - (curTime - lastTick); ++ MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); + this.nextTick += j * 50L; + this.lastOverloadTime = this.nextTick; } - if ( tickCount++ % SAMPLE_INTERVAL == 0 ) -+ catchupTime = Math.min(MAX_CATCHUP_BUFFER, catchupTime - wait); + if ( ++MinecraftServer.currentTick % SAMPLE_INTERVAL == 0 ) { - double currentTps = 1E3 / ( curTime - tickSection ) * SAMPLE_INTERVAL; @@ -156,16 +138,6 @@ index 2fc8c192b..3a95b0bf8 100644 this.nextTick += 50L; if (this.T) { this.T = false; -@@ -860,8 +929,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Wed, 2 Mar 2016 11:59:48 -0600 Subject: [PATCH] Optimize explosions @@ -10,7 +10,7 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c2b9690a0c..a5ec0bc0e0 100644 +index c2b9690a0..a5ec0bc0e 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -145,4 +145,10 @@ public class PaperWorldConfig { @@ -25,7 +25,7 @@ index c2b9690a0c..a5ec0bc0e0 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e1c628f177..bcff117619 100644 +index e1c628f17..bcff11761 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -172,7 +172,7 @@ public class Explosion { @@ -123,10 +123,10 @@ index e1c628f177..bcff117619 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1a75db6f49..fd1b268798 100644 +index db60cbc7b..31c9917f9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1140,6 +1140,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Mon, 28 Mar 2016 19:55:45 -0400 Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener @@ -32,10 +32,10 @@ index 469a3be05..f2c429f22 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7b3c4747e..8ce7903a1 100644 +index 31c9917f9..85b40ab7e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1105,6 +1105,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Thu, 28 Apr 2016 00:57:27 -0400 Subject: [PATCH] remove null possibility for getServer singleton @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 860957c0b1..a3c53d9dbf 100644 +index bf8ca326b..50cf32f41 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -61,6 +61,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -25,7 +25,7 @@ index 860957c0b1..a3c53d9dbf 100644 this.ae = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread); this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new); this.ai = new CraftingManager(); -@@ -1915,7 +1917,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Fri, 9 Jun 2017 19:03:43 +0200 Subject: [PATCH] Use TerminalConsoleAppender for console improvements @@ -19,7 +19,7 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 099d7218c9..108c8c05e7 100644 +index 7b9fcb2c0..851646727 100644 --- a/pom.xml +++ b/pom.xml @@ -41,10 +41,27 @@ @@ -75,7 +75,7 @@ index 099d7218c9..108c8c05e7 100644 org.apache.maven.plugins diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 -index 0000000000..cd6e259239 +index 000000000..cd6e25923 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -0,0 +1,40 @@ @@ -121,7 +121,7 @@ index 0000000000..cd6e259239 +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java new file mode 100644 -index 0000000000..685deaa0e5 +index 000000000..685deaa0e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java @@ -0,0 +1,17 @@ @@ -143,7 +143,7 @@ index 0000000000..685deaa0e5 + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 19e2df3098..3d0cb874d7 100644 +index 19e2df309..3d0cb874d 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -83,6 +83,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -185,7 +185,7 @@ index 19e2df3098..3d0cb874d7 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c117e8fa3f..ffe81205b8 100644 +index 2ccee100e..cdf162a95 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -50,7 +50,7 @@ import org.apache.commons.lang3.Validate; @@ -225,7 +225,7 @@ index c117e8fa3f..ffe81205b8 100644 Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); } // CraftBukkit end -@@ -940,7 +944,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Mon, 15 Jan 2018 22:11:48 -0500 Subject: [PATCH] Basic PlayerProfile API @@ -7,7 +7,7 @@ Establishes base extension of profile systems for future edits too diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java new file mode 100644 -index 0000000000..b151a13c1b +index 000000000..b151a13c1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -0,0 +1,280 @@ @@ -293,7 +293,7 @@ index 0000000000..b151a13c1b +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java new file mode 100644 -index 0000000000..25836b975b +index 000000000..25836b975 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java @@ -0,0 +1,30 @@ @@ -329,7 +329,7 @@ index 0000000000..25836b975b +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java new file mode 100644 -index 0000000000..3bcdb8f93f +index 000000000..3bcdb8f93 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java @@ -0,0 +1,17 @@ @@ -352,7 +352,7 @@ index 0000000000..3bcdb8f93f +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java new file mode 100644 -index 0000000000..4b2a67423f +index 000000000..4b2a67423 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java @@ -0,0 +1,29 @@ @@ -387,7 +387,7 @@ index 0000000000..4b2a67423f +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java new file mode 100644 -index 0000000000..3aceb0ea8a +index 000000000..3aceb0ea8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java @@ -0,0 +1,11 @@ @@ -403,7 +403,7 @@ index 0000000000..3aceb0ea8a + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index d7dc516e4a..d2019fb74c 100644 +index 1f6a12632..6d278a0da 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -1,7 +1,10 @@ @@ -429,10 +429,10 @@ index d7dc516e4a..d2019fb74c 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ffe81205b8..c84af46815 100644 +index cdf162a95..d909ad682 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1255,7 +1255,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Wed, 11 Oct 2017 15:56:26 +0200 Subject: [PATCH] Implement extended PaperServerListPingEvent @@ -177,7 +177,7 @@ index 000000000..a85466bc7 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1290cff77..ea3d9e9af 100644 +index d909ad682..e5b3dc9e2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1,6 +1,7 @@ @@ -188,7 +188,7 @@ index 1290cff77..ea3d9e9af 100644 import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -@@ -1055,7 +1056,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) { this.Z = i; this.serverPing.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount())); diff --git a/Spigot-Server-Patches/0281-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0281-Add-Early-Warning-Feature-to-WatchDog.patch index 6ab7a4d389..58795e513b 100644 --- a/Spigot-Server-Patches/0281-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/0281-Add-Early-Warning-Feature-to-WatchDog.patch @@ -1,4 +1,4 @@ -From 756307a54e45d15f96f071b2f955c68181f56441 Mon Sep 17 00:00:00 2001 +From 9305bed7b7d8a7a5990dc0ac7448d4141a314491 Mon Sep 17 00:00:00 2001 From: miclebrick Date: Wed, 8 Aug 2018 15:30:52 -0400 Subject: [PATCH] Add Early Warning Feature to WatchDog @@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index d773ef5b0d..833659bbb2 100644 +index d773ef5b0..833659bbb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -25,6 +25,7 @@ import org.bukkit.configuration.file.YamlConfiguration; @@ -36,7 +36,7 @@ index d773ef5b0d..833659bbb2 100644 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ea3d9e9afa..9b11fd838b 100644 +index e5b3dc9e2..35cd6f9bf 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -847,6 +847,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Wed, 27 Apr 2016 22:09:52 -0400 Subject: [PATCH] Optimize Hoppers @@ -11,7 +11,7 @@ Subject: [PATCH] Optimize Hoppers * Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a5b4f99901..2b5402b009 100644 +index a5b4f9990..2b5402b00 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -360,6 +360,15 @@ public class PaperWorldConfig { @@ -31,7 +31,7 @@ index a5b4f99901..2b5402b009 100644 private void disableSprintInterruptionOnAttack() { disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index ca1bd02995..2d83c9e79c 100644 +index ca1bd0299..2d83c9e79 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -482,8 +482,9 @@ public final class ItemStack { @@ -47,10 +47,10 @@ index ca1bd02995..2d83c9e79c 100644 itemstack.d(this.C()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9b11fd838b..6a3776091e 100644 +index 35cd6f9bf..2ed49dceb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1135,6 +1135,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper @@ -59,7 +59,7 @@ index 9b11fd838b..6a3776091e 100644 if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit this.methodProfiler.a(() -> { diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 9f31f071bb..6bddb27365 100644 +index 9f31f071b..6bddb2736 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -62,6 +62,7 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -79,7 +79,7 @@ index 9f31f071bb..6bddb27365 100644 this.world.b(this.position, this); if (!this.c.isAir()) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 0555bae5aa..452e46cad7 100644 +index 0555bae5a..452e46cad 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -189,6 +189,153 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi diff --git a/Spigot-Server-Patches/0338-Optimize-World-Time-Updates.patch b/Spigot-Server-Patches/0338-Optimize-World-Time-Updates.patch index ce3874169e..685b48964b 100644 --- a/Spigot-Server-Patches/0338-Optimize-World-Time-Updates.patch +++ b/Spigot-Server-Patches/0338-Optimize-World-Time-Updates.patch @@ -1,4 +1,4 @@ -From c9287ae57a9e0346476aad606cead3bad2dfa3eb Mon Sep 17 00:00:00 2001 +From 0f036e29388e637dd6f9297c39b79e3e7f617508 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 2 Nov 2018 23:11:51 -0400 Subject: [PATCH] Optimize World Time Updates @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0a02dece68..1858e956b5 100644 +index 3aa62d13a..e160e72cd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1119,12 +1119,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Wed, 27 Mar 2019 22:48:45 -0400 Subject: [PATCH] Server Tick Events @@ -6,10 +6,10 @@ 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 1858e956b5..6e77fa35b4 100644 +index e160e72cd..13278cc58 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1050,6 +1050,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Mon, 13 May 2019 21:10:59 -0700 Subject: [PATCH] Fix CraftServer#isPrimaryThread and MinecraftServer @@ -16,10 +16,10 @@ handling that should have been handled synchronously will be handled synchronously when the server gets shut down. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 70f730996..73ac45bf7 100644 +index ef850c17e..934f9f7f0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1945,7 +1945,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant