diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 414fe65c7e..b75090efdf 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -216,7 +216,7 @@ index 0a1d342c13..347608531f 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 17d1dc93bc..f3f10ca60e 100644 +index e003246ea2..1809f7eecc 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ package net.minecraft.server; diff --git a/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch b/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch index b5b731f530..4e24bc96bc 100644 --- a/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch +++ b/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch @@ -10,7 +10,7 @@ Optimize to check if the captured list even has values in it, and also to just do a get call since the value can never be null. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f1552f23ea..ef080f9571 100644 +index 59f4b3262d..dcd66943fb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose diff --git a/Spigot-Server-Patches/Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/Optimize-redstone-algorithm.patch index f3cc37cfad..3f3d5214d1 100644 --- a/Spigot-Server-Patches/Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/Optimize-redstone-algorithm.patch @@ -1124,7 +1124,7 @@ index 7ce9cdb853..6b5015ce5f 100644 c(iblockdata, world, blockposition); world.a(blockposition, false); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 26f3b47208..1eb689c62a 100644 +index 0887707380..4afbd0f1c5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose diff --git a/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 3843497333..04f3e2974e 100644 --- a/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -21,7 +21,7 @@ index 83e54cb904..f06bb3ae19 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f476f326f1..d08bd6d963 100644 +index 8dca442abe..b3d0a0d856 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch index a0fa090618..1cb812ba87 100644 --- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index a833781e59..1307152997 100644 +index 0956eff603..e79e256138 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -23,7 +23,7 @@ index a833781e59..1307152997 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 85056a7b1f..3cbaeb387b 100644 +index b8366aa11b..aa0fab786f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose @@ -62,5 +62,5 @@ index 85056a7b1f..3cbaeb387b 100644 + // Paper end } finally { entity.tickTimer.stopTiming(); - timings.tickEntities.stopTiming(); + } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch index 7b53d6eb75..c60560684c 100644 --- a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cde463c5a5..f6cb4d45eb 100644 +index bb99fc506e..946a7365ca 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 5ac9095980..ab8fd21ba5 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -1001,7 +1001,7 @@ index e8a90e01f5..0956eff603 100644 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 32981c4422..0e09adf7dc 100644 +index 32981c4422..4365383dd7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -1050,7 +1050,6 @@ index 32981c4422..0e09adf7dc 100644 public void a(Consumer consumer, Entity entity) { try { - SpigotTimings.tickEntityTimer.startTiming(); // Spigot -+ timings.tickEntities.startTiming(); + entity.tickTimer.startTiming(); + // Spigot end consumer.accept(entity); @@ -1063,7 +1062,6 @@ index 32981c4422..0e09adf7dc 100644 throw new ReportedException(crashreport); + } finally { + entity.tickTimer.stopTiming(); -+ timings.tickEntities.stopTiming(); } } diff --git a/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch index 1e1977c400..2ee8e81f52 100644 --- a/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch +++ b/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use asynchronous Log4j 2 loggers diff --git a/pom.xml b/pom.xml -index 4ead093278..1f3571dd0f 100644 +index 4ead09327..1f3571dd0 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -22,11 +22,36 @@ index 4ead093278..1f3571dd0f 100644 org.ow2.asm asm +diff --git a/src/main/java/com/destroystokyo/paper/log/LogFullPolicy.java b/src/main/java/com/destroystokyo/paper/log/LogFullPolicy.java +new file mode 100644 +index 000000000..db652a1f7 +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/log/LogFullPolicy.java +@@ -0,0 +0,0 @@ ++package com.destroystokyo.paper.log; ++ ++import org.apache.logging.log4j.Level; ++import org.apache.logging.log4j.core.async.AsyncQueueFullPolicy; ++import org.apache.logging.log4j.core.async.EventRoute; ++ ++public final class LogFullPolicy implements AsyncQueueFullPolicy { ++ ++ /* ++ * Prevents log calls being logged out of order when the log queue is full. ++ */ ++ ++ @Override ++ public EventRoute getRoute(final long backgroundThreadId, final Level level) { ++ return EventRoute.ENQUEUE; ++ } ++} diff --git a/src/main/resources/log4j2.component.properties b/src/main/resources/log4j2.component.properties new file mode 100644 -index 0000000000..ee7c90784c +index 000000000..f72f7425c --- /dev/null +++ b/src/main/resources/log4j2.component.properties -@@ -0,0 +1 @@ +@@ -0,0 +0,0 @@ +Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector ++log4j2.AsyncQueueFullPolicy=com.destroystokyo.paper.log.LogFullPolicy +\ No newline at end of file -- \ No newline at end of file