diff --git a/PATCHES.md b/PATCHES.md index 0d0914dd..c2a2dc3c 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -151,6 +151,7 @@ This is an overview over all patches that are currently used. | server | Consolidate flush calls for entity tracker packets | Spottedleaf | | | server | Controllable Minecarts | William Blake Galbreath | | | server | Copy passenger list in enderTeleportTo | Spottedleaf | | +| server | Correctly handle recursion for chunkholder updates | Spottedleaf | | | server | Cows eat mushrooms | William Blake Galbreath | | | server | Crying obsidian valid for portal frames | William Blake Galbreath | | | server | Custom Locale Support | Zoe | | @@ -169,10 +170,12 @@ This is an overview over all patches that are currently used. | server | Distance manager tick timings | Spottedleaf | | | server | Do not allow the server to unload chunks at request of | Spottedleaf | | | server | Do not allow ticket level changes while unloading | Spottedleaf | | +| server | Do not copy visible chunks | Spottedleaf | | | server | Do not load chunks during a crash report | Spottedleaf | | | server | Do not retain playerchunkmap instance in light thread factory | Spottedleaf | | | server | Do not run close logic for inventories on chunk unload | Spottedleaf | | | server | Do not run raytrace logic for AIR | Spottedleaf | | +| server | Do not schedule poi task for each block write on chunk gen | Spottedleaf | | | server | Do not update TE's in generating chunks | Spottedleaf | | | server | Don't allow StructureLocateEvent to change worlds | Spottedleaf | | | server | Don't get entity equipment if not needed | Paul Sauve | | @@ -279,6 +282,7 @@ This is an overview over all patches that are currently used. | server | Movement options for armor stands | Mariell Hoversholm | | | server | Multi-Threaded Server Ticking Vanilla | Spottedleaf | | | server | Multi-Threaded ticking CraftBukkit | Spottedleaf | | +| server | Multithreaded Entity Tracker fixup | Simon Gardling | | | server | Multithreaded entity tracking | Paul Sauve | | | server | Name craft scheduler threads according to the plugin using | Spottedleaf | | | server | New nbt cache | Hugo Planque | ishland | @@ -362,6 +366,7 @@ This is an overview over all patches that are currently used. | server | Remove streams | Paul Sauve | | | server | Remove streams for villager AI | Spottedleaf | | | server | Replace player chunk loader system | Spottedleaf | | +| server | Replace ticket level propagator | Spottedleaf | | | server | Revert MC-4 fix | Spottedleaf | | | server | Revert getChunkAt(Async) retaining chunks for long periods of | Spottedleaf | | | server | Rework PlayerChunk main thread checks | Spottedleaf | | diff --git a/Paper b/Paper index 606cdac6..39bf5b52 160000 --- a/Paper +++ b/Paper @@ -1 +1 @@ -Subproject commit 606cdac609441c2234ca30f0abb99eb98521a4c0 +Subproject commit 39bf5b525d819e50a18a241f3ebaf388a571619c diff --git a/build.gradle.kts b/build.gradle.kts index 57ce074c..6de486f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,6 +53,7 @@ subprojects { maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/") maven("https://libraries.minecraft.net") maven("https://repo.codemc.io/repository/maven-public/") + maven("https://jitpack.io") mavenLocal() maven("${rootProjectDir}/.repository") } diff --git a/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch b/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch index 1d4b67e5..d974008d 100644 --- a/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch +++ b/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch @@ -72,10 +72,10 @@ index 7063f1da3654b382e26b0093ad5d0ff04a2b38c2..b9c5479e5561f8fe68ea8f94fbf4e64d return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 02d8a8f13d81c47316f704fb700afd0214a5f546..ca10d901ebd56bdee54f3c8cf607a5a34cd79f32 100644 +index 7b0b416c73c8914f3c8c570f2020490ef2babf64..246fcc9b40152964810ceef356ecb2eee3551135 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0.0D ? 1 : -1); } diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index d933323d57a2a7ff283408f12d4650699f8177e7..d1afe52dfd2da1d168a62aa339b48fb044e7ff50 100644 +index 96cc46a26eef701b0579f3407e67af9176e1743b..5c7ce20609a1c18687696581a76f21a1b182ea7c 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -111,6 +111,7 @@ import net.minecraft.world.phys.AxisAlignedBB; diff --git a/patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch b/patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch index 02a0fed6..9f44cc53 100644 --- a/patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch +++ b/patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch @@ -23,7 +23,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index fcf9af44702f34d75185eee0b3259fe0e57001b1..c2711c2d5405a5ddcf99ce7a4fbc997b403bd2f2 100644 +index e3481eb71972c82edd892a99d1136c8248fb0f8c..9e71e6c331c60d55220399cee4381367113f596a 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -1212,7 +1212,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { diff --git a/patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch b/patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch index 0db53084..b684f5ed 100644 --- a/patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch +++ b/patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch @@ -46,7 +46,7 @@ index fe040615ff03478a20cdf8376f89a6b7d100ba61..207a9c3928aad7c6e89a120b54d87e00 boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index c2711c2d5405a5ddcf99ce7a4fbc997b403bd2f2..78443d5bf8f1f297cf68a88d8caf8e8abc9cdba7 100644 +index 9e71e6c331c60d55220399cee4381367113f596a..ab1cf52d7faa93feba9dd2efd9479b2d72771778 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -1202,6 +1202,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -77,7 +77,7 @@ index c2711c2d5405a5ddcf99ce7a4fbc997b403bd2f2..78443d5bf8f1f297cf68a88d8caf8e8a // Tuinity start - optimise chunk ice snow ticking BiomeBase[] biomeCache = this.biomeBaseCache; diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java -index df35ae12ecbe88ab396bed9850ef80433ff42fd4..7474c070598bc093e06f02f19d49f3a6fa6b3d4e 100644 +index fc07e2014e961da5d97095c4ee6f972e2ece3ec3..8f5809756b4fb358f1207c1d61c5cbe6df3fff00 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java @@ -99,6 +99,18 @@ public class Chunk implements IChunkAccess { diff --git a/patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch b/patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch index 534ff2ff..ecada923 100644 --- a/patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch +++ b/patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index d1afe52dfd2da1d168a62aa339b48fb044e7ff50..5c983a441cd2a06eae6e79bc07ba5440d294574b 100644 +index 5c7ce20609a1c18687696581a76f21a1b182ea7c..74f80b6af18c0b91d9613384ca6bafd9c89f23a4 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -910,11 +910,13 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Airplane/patches/server/0012-Dynamic-activation-range.patch b/patches/Airplane/patches/server/0012-Dynamic-activation-range.patch index ecfa0ac4..ffae4307 100644 --- a/patches/Airplane/patches/server/0012-Dynamic-activation-range.patch +++ b/patches/Airplane/patches/server/0012-Dynamic-activation-range.patch @@ -27,37 +27,43 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java -index ab019b577002677a4ce788106f8e5a1d7757a2ae..946e476e1ca8c3ced119c64a05643c8c64760724 100644 +index ab019b577002677a4ce788106f8e5a1d7757a2ae..0e452ea9c5d098326d22a20aa67e423f85843db7 100644 --- a/src/main/java/gg/airplane/AirplaneConfig.java +++ b/src/main/java/gg/airplane/AirplaneConfig.java -@@ -47,4 +47,30 @@ public class AirplaneConfig { +@@ -47,4 +47,36 @@ public class AirplaneConfig { } } + -+ public static int maximumActivationPrio = 20; -+ public static int activationDistanceMod = 9; -+ public static boolean dynamicVillagerBehavior = true; -+ public static boolean dynamicPiglinBehavior = true; -+ public static boolean dynamicHoglinBehavior = true; ++ public static int startDistance; ++ public static int startDistanceSquared; ++ public static int maximumActivationPrio; ++ public static int activationDistanceMod; ++ public static boolean dynamicVillagerBehavior; ++ public static boolean dynamicPiglinBehavior; ++ public static boolean dynamicHoglinBehavior; + + private static void dynamicActivationRange() { + config.setComment("activation-range", "Optimizes how entities act when", "they're far away from the player"); + -+ maximumActivationPrio = config.getInt("activation-range.max-tick-freq", maximumActivationPrio, ++ startDistance = config.getInt("activation-range.start-distance", 12, ++ "This value determines how far away an entity has to be", ++ "from the player to start being effected by DEAR."); ++ startDistanceSquared = startDistance * startDistance; ++ maximumActivationPrio = config.getInt("activation-range.max-tick-freq", 20, + "This value defines how often in ticks, the furthest entity", + "will get their pathfinders and behaviors ticked. 20 = 1s"); -+ activationDistanceMod = config.getInt("activation-range.activation-dist-mod", activationDistanceMod, ++ activationDistanceMod = config.getInt("activation-range.activation-dist-mod", 8, + "This value defines how much distance modifies an entity's", + "tick frequency. freq = (distanceToPlayer^2) / (2^value)", -+ "If you want further away entities to tick less often, use 8.", -+ "If you want further away entities to tick more often, try 10."); ++ "If you want further away entities to tick less often, use 7.", ++ "If you want further away entities to tick more often, try 9."); + + config.setComment("behavior-activation", "A list of entities to use the dynamic activation range", "to modify how often their behaviors are ticked"); + -+ dynamicVillagerBehavior = config.getBoolean("behavior-activation.villager", dynamicVillagerBehavior); -+ dynamicPiglinBehavior = config.getBoolean("behavior-activation.piglin", dynamicPiglinBehavior); -+ dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", dynamicHoglinBehavior); ++ dynamicVillagerBehavior = config.getBoolean("behavior-activation.villager", true); ++ dynamicPiglinBehavior = config.getBoolean("behavior-activation.piglin", true); ++ dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", true); + } + } @@ -105,7 +111,7 @@ index aae13c2e6c2a30b69c33417932c6a4d0aefeb7f5..f4440a5c4aedb1d7d303517f86a07c85 this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().enter("navigation"); diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java -index 637928664f8c7b1c694a234e507c20724294e450..f303c5d6b2e55fc9fd8b49ec21121805e7351034 100644 +index 637928664f8c7b1c694a234e507c20724294e450..02e8288473138dcea008d6157318758e8d7ee3be 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java @@ -44,9 +44,14 @@ public class PathfinderGoalSelector { @@ -116,7 +122,7 @@ index 637928664f8c7b1c694a234e507c20724294e450..f303c5d6b2e55fc9fd8b49ec21121805 - incRate(); - return getCurRate() % getTickRate() == 0; + public boolean inactiveTick(int tickRate) { // Airplane - take tick rate -+ tickRate = Math.max(tickRate, getTickRate()); // Airplane ++ tickRate = Math.min(tickRate, getTickRate()); // Airplane + if (this.curRate++ % tickRate != 0) { // Airplane - use tick rate / increment curRate every tick + //incRate(); + return false; @@ -194,7 +200,7 @@ index 2d0b83923d58cc7b6918b4e2ff2bece13ca26899..d8028675fc82883d716bcfb44431ca6a if (this.bF) { this.bF = false; diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 5c2eaca0bc63c7880ee928aba6a24761737aa649..6c4c4580faef39e48de5af4db003cf2e3b8a99b5 100644 +index 5c2eaca0bc63c7880ee928aba6a24761737aa649..8b36ca5062f8e0e8bd58aa506e91704a747de81b 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -47,6 +47,9 @@ import net.minecraft.world.entity.schedule.Activity; @@ -225,23 +231,19 @@ index 5c2eaca0bc63c7880ee928aba6a24761737aa649..6c4c4580faef39e48de5af4db003cf2e { // Paper start Entity[] rawData = chunk.entities.getRawData(); -@@ -249,11 +252,19 @@ public class ActivationRange +@@ -249,6 +252,15 @@ public class ActivationRange //for ( Entity entity : (Collection) slice ) // Paper end { + // Airplane start + Vec3D entityVec = entity.getPositionVector(); + double diffX = playerVec.x - entityVec.x, diffY = playerVec.y - entityVec.y, diffZ = playerVec.z - entityVec.z; -+ int priority = Math.max(1, (int) (diffX * diffX + diffY * diffY + diffZ * diffZ) >> gg.airplane.AirplaneConfig.activationDistanceMod); ++ int squaredDistance = (int) (diffX * diffX + diffY * diffY + diffZ * diffZ); ++ entity.activatedPriority = squaredDistance > gg.airplane.AirplaneConfig.startDistanceSquared ? ++ Math.max(1, Math.min(squaredDistance >> gg.airplane.AirplaneConfig.activationDistanceMod, gg.airplane.AirplaneConfig.maximumActivationPrio)) : ++ 1; ++ // Airplane end ++ if (MinecraftServer.currentTick > entity.activatedTick) { if (entity.defaultActivationState || entity.activationType.boundingBox.c(entity.getBoundingBox())) { // Paper entity.activatedTick = MinecraftServer.currentTick; - } -+ entity.activatedPriority = Math.min(gg.airplane.AirplaneConfig.maximumActivationPrio, priority); -+ } else { -+ entity.activatedPriority = Math.min(gg.airplane.AirplaneConfig.maximumActivationPrio, Math.min(priority, entity.activatedPriority)); - } -+ // Airplane end - } - } - } diff --git a/patches/Airplane/patches/server/0017-Airplane-Profiler.patch b/patches/Airplane/patches/server/0017-Airplane-Profiler.patch index d8b092ae..2b2b66f2 100644 --- a/patches/Airplane/patches/server/0017-Airplane-Profiler.patch +++ b/patches/Airplane/patches/server/0017-Airplane-Profiler.patch @@ -20,10 +20,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/pom.xml b/pom.xml -index a148af69be216d2869538d402d9a0d12c81b5df6..8a73569a4927e046940e5c12ad75ab071ea8aa91 100644 +index a148af69be216d2869538d402d9a0d12c81b5df6..c917f825378dd16a329105b4e7fcc8882755bc5a 100644 --- a/pom.xml +++ b/pom.xml -@@ -173,8 +173,23 @@ +@@ -173,6 +173,13 @@ fe3dbb4420 compile @@ -36,36 +36,26 @@ index a148af69be216d2869538d402d9a0d12c81b5df6..8a73569a4927e046940e5c12ad75ab07 + -+ -+ -+ -+ jitpack.io -+ https://jitpack.io -+ -+ -+ - - tuinity-${minecraft.version} diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java -index 946e476e1ca8c3ced119c64a05643c8c64760724..a77e628518920e84b03a8a00e1308a9a53a00896 100644 +index 0e452ea9c5d098326d22a20aa67e423f85843db7..7ec84ef1d1cbb1fabf4c590a2f2c1da3cc181010 100644 --- a/src/main/java/gg/airplane/AirplaneConfig.java +++ b/src/main/java/gg/airplane/AirplaneConfig.java -@@ -73,4 +73,27 @@ public class AirplaneConfig { - dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", dynamicHoglinBehavior); +@@ -79,4 +79,27 @@ public class AirplaneConfig { + dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", true); } + -+ public static String profileWebUrl = "https://flare.airplane.gg"; ++ public static String profileWebUrl; + + private static void profilerOptions() { + config.setComment("flare", "Configures Flare, the built-in profiler"); + -+ profileWebUrl = config.getString("flare.url", profileWebUrl, "Sets the server to use for profiles."); ++ profileWebUrl = config.getString("flare.url", "https://flare.airplane.gg", "Sets the server to use for profiles."); + } + + -+ public static String accessToken = ""; ++ public static String accessToken; + + private static void airplaneWebServices() { + config.setComment("web-services", "Options for connecting to Airplane's online utilities"); diff --git a/patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch b/patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch index 86b308eb..fad1e925 100644 --- a/patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch +++ b/patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reduce entity chunk ticking checks from 3 to 1 diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index 78443d5bf8f1f297cf68a88d8caf8e8abc9cdba7..10dcb8066493ddb2895e60f5d8d6f241c5f474fa 100644 +index ab1cf52d7faa93feba9dd2efd9479b2d72771778..e2bfb1423f6b24514cf7ea364be8bf5f554e0a5f 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -1083,11 +1083,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { diff --git a/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch b/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch index 1c1bfb33..cf0327e3 100644 --- a/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch +++ b/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable the Snooper diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 16c20b3e7dcbbdb08e8c2a15074495eacc001e70..f31b49381d1a70f66406dc6d048f84b45257c860 100644 +index 5e2c7f3bf9aa99b10260454b9957caff81a7cd26..7fa91a3cb0d48396d106a4a729533f95e91562c0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1440,6 +1440,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 100) { // Spigot this.snooper.a(); } -@@ -1447,6 +1449,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant iterator = this.world.getChunkProvider().entityTickingChunks.iterator(); try { while (iterator.hasNext()) { -@@ -2457,7 +2482,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2427,7 +2452,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially public class EntityTracker { final EntityTrackerEntry trackerEntry; // Paper - private -> package private @@ -371,7 +371,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c private final int trackingDistance; private SectionPosition e; // Paper start -@@ -2476,7 +2501,9 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2446,7 +2471,9 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially // Paper start - use distance map to optimise tracker com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet lastTrackerCandidates; @@ -382,7 +382,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet oldTrackerCandidates = this.lastTrackerCandidates; this.lastTrackerCandidates = newTrackerCandidates; -@@ -2517,7 +2544,13 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2487,7 +2514,13 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially return this.tracker.getId(); } @@ -397,7 +397,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c Iterator iterator = this.trackedPlayers.iterator(); while (iterator.hasNext()) { -@@ -2529,6 +2562,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2499,6 +2532,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially } public void broadcastIncludingSelf(Packet packet) { @@ -410,7 +410,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c this.broadcast(packet); if (this.tracker instanceof EntityPlayer) { ((EntityPlayer) this.tracker).playerConnection.sendPacket(packet); -@@ -2555,8 +2594,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2525,8 +2564,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially } @@ -421,7 +421,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c if (entityplayer != this.tracker) { // Paper start - remove allocation of Vec3D here //Vec3D vec3d = entityplayer.getPositionVector().d(this.tracker.getPositionVector()); // MC-155077, SPIGOT-5113 -@@ -2572,7 +2611,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2542,7 +2581,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially if (!flag1) { ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); @@ -431,7 +431,7 @@ index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927c if (playerchunk != null && playerchunk.getSendingChunk() != null && PlayerChunkMap.this.playerChunkManager.isChunkSent(entityplayer, MathHelper.floor(this.tracker.locX()) >> 4, MathHelper.floor(this.tracker.locZ()) >> 4)) { // Paper - no-tick view distance // Tuinity - don't broadcast in chunks the player hasn't received flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance; diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java -index 7474c070598bc093e06f02f19d49f3a6fa6b3d4e..c07fb5ca761c0f2067bd103026ded618a8620947 100644 +index 8f5809756b4fb358f1207c1d61c5cbe6df3fff00..2e8eb0bb8fb4f7ce6b92fe01a81327da30e614ae 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java @@ -111,6 +111,26 @@ public class Chunk implements IChunkAccess { diff --git a/patches/Purpur/patches/server/0002-Rebrand.patch b/patches/Purpur/patches/server/0002-Rebrand.patch index fc5647f0..b5e6bd86 100644 --- a/patches/Purpur/patches/server/0002-Rebrand.patch +++ b/patches/Purpur/patches/server/0002-Rebrand.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand diff --git a/pom.xml b/pom.xml -index 8a73569a4927e046940e5c12ad75ab071ea8aa91..cea712b94bb32ccda2895670859839d660bd0748 100644 +index c917f825378dd16a329105b4e7fcc8882755bc5a..6fe8dad8df109531f2b38fbfcb58b6807dbb8cf0 100644 --- a/pom.xml +++ b/pom.xml @@ -39,8 +39,10 @@ @@ -21,9 +21,9 @@ index 8a73569a4927e046940e5c12ad75ab071ea8aa91..cea712b94bb32ccda2895670859839d6 ${project.version} compile -@@ -190,6 +192,14 @@ - - +@@ -182,6 +184,14 @@ + + + + @@ -36,7 +36,7 @@ index 8a73569a4927e046940e5c12ad75ab071ea8aa91..cea712b94bb32ccda2895670859839d6 tuinity-${minecraft.version} -@@ -369,8 +379,15 @@ +@@ -361,8 +371,15 @@ org.eclipse.jdt ecj @@ -54,18 +54,18 @@ index 8a73569a4927e046940e5c12ad75ab071ea8aa91..cea712b94bb32ccda2895670859839d6 diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 89eeb9d202405747409e65fcf226d95379987e29..4d9e685c691a37078ff7452e50ab8c13999dbe10 100644 +index ad87b575a0261200b280884e054a59e3ce59c41c..e56ebeaaa12494817d31099eed54ef2c50b98b9e 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { +@@ -19,7 +19,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @Override protected LineReader buildReader(LineReaderBuilder builder) { - return super.buildReader(builder + builder - .appName("Paper") + .appName("Purpur") // Purpur .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) - ); + .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/gg/airplane/compat/ServerConfigurations.java b/src/main/java/gg/airplane/compat/ServerConfigurations.java index f4976428bc721319d2926e97cbe0f64c6e9e503c..044ad28bd1fd1c1e25061f9f811fc10baf7f5f72 100644 --- a/src/main/java/gg/airplane/compat/ServerConfigurations.java @@ -92,10 +92,10 @@ index 3bc5cd1e53dd7c94b948e7f57f0dc8e073e349b0..87891161f5b06bb8be0e2016b490484e throwable = throwable1; throw throwable1; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ca10d901ebd56bdee54f3c8cf607a5a34cd79f32..4f602f0448585b95b8b2b05006f0fa9f9c57ba43 100644 +index 246fcc9b40152964810ceef356ecb2eee3551135..8620bbcc7c555e4760777397063f0392c9acc35e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index c56e7fb18f9a56c8025eb70a524f028b5942da37..4b9fdb4f04b333ce32f7fca8f279bf989e6fd728 100644 +index efc1e42d606e1c9feb1a4871c0714933ae92a1b2..a0ed8ed1d6b89a4f10dff645e09eaff303fb3f8a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -118,6 +118,11 @@ public class PaperConfig { diff --git a/patches/Purpur/patches/server/0008-AFK-API.patch b/patches/Purpur/patches/server/0008-AFK-API.patch index ed411d74..73bfb331 100644 --- a/patches/Purpur/patches/server/0008-AFK-API.patch +++ b/patches/Purpur/patches/server/0008-AFK-API.patch @@ -64,7 +64,7 @@ index fd6dbbf619b828c4ef3d00f8dc30d3893007db7b..7e388dcca2d4e78b49d5fc5fce0b962e return this.serverStatisticManager; } diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index 10dcb8066493ddb2895e60f5d8d6f241c5f474fa..368aadca86f3775eabe8cf7ec76b7305a6871bd5 100644 +index e2bfb1423f6b24514cf7ea364be8bf5f554e0a5f..18d70aff974d756a62a8f9f0e6c52f89ef1fa2c8 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -1002,7 +1002,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -86,10 +86,10 @@ index 10dcb8066493ddb2895e60f5d8d6f241c5f474fa..368aadca86f3775eabe8cf7ec76b7305 } else if (entityplayer.isSleeping()) { ++j; diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index 83ad913e46f44aabb41b7e441cba2ef2f7bcbc46..400d682a3b314705501cd652593317e8fe096db7 100644 +index 80b77cdffd64690bb9066b8745ea0ee08d60a7a4..e58bbd4c1b59293ddf58d0f7cf37a629f5cc96d6 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -397,6 +397,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -399,6 +399,12 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (this.player.F() > 0L && this.minecraftServer.getIdleTimeout() > 0 && SystemUtils.getMonotonicMillis() - this.player.F() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) { @@ -102,7 +102,7 @@ index 83ad913e46f44aabb41b7e441cba2ef2f7bcbc46..400d682a3b314705501cd652593317e8 this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854 this.disconnect(new ChatMessage("multiplayer.disconnect.idling")); } -@@ -672,6 +678,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -674,6 +680,8 @@ public class PlayerConnection implements PacketListenerPlayIn { this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -111,7 +111,7 @@ index 83ad913e46f44aabb41b7e441cba2ef2f7bcbc46..400d682a3b314705501cd652593317e8 // Skip the first time we do this if (true) { // Spigot - don't skip any move events Location oldTo = to.clone(); -@@ -1414,7 +1422,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1416,7 +1424,7 @@ public class PlayerConnection implements PacketListenerPlayIn { if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot flag1 = true; // Tuinity - diff on change, this should be moved wrongly @@ -120,7 +120,7 @@ index 83ad913e46f44aabb41b7e441cba2ef2f7bcbc46..400d682a3b314705501cd652593317e8 } this.player.setLocation(d4, d5, d6, f, f1); -@@ -1464,6 +1472,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1466,6 +1474,8 @@ public class PlayerConnection implements PacketListenerPlayIn { this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -289,7 +289,7 @@ index 45e786565ac988abadffda2e7ba3ff1e2880b786..f4052aaa2235894b996d65c569a083f1 + // Purpur end } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 6c4c4580faef39e48de5af4db003cf2e3b8a99b5..dc2d880ded328f8377c207ce15f604ec5c25176c 100644 +index 8b36ca5062f8e0e8bd58aa506e91704a747de81b..c94cd5a95f28190e88d31b522035fc7c74a2ac33 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -207,6 +207,7 @@ public class ActivationRange diff --git a/patches/Purpur/patches/server/0010-Configurable-server-mod-name.patch b/patches/Purpur/patches/server/0010-Configurable-server-mod-name.patch index adb7b38c..30fe1cc9 100644 --- a/patches/Purpur/patches/server/0010-Configurable-server-mod-name.patch +++ b/patches/Purpur/patches/server/0010-Configurable-server-mod-name.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable server mod name diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4f602f0448585b95b8b2b05006f0fa9f9c57ba43..ccccd3fffb9027469d545f586b15c045b5698b63 100644 +index 8620bbcc7c555e4760777397063f0392c9acc35e..83b98a18a8b726621068b5fd2bed046852dccf2d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info -@@ -3065,6 +3081,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -3078,6 +3094,16 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInKeepAlive packetplayinkeepalive) { diff --git a/patches/Purpur/patches/server/0025-Giants-AI-settings.patch b/patches/Purpur/patches/server/0025-Giants-AI-settings.patch index e2dc631e..f30f0a30 100644 --- a/patches/Purpur/patches/server/0025-Giants-AI-settings.patch +++ b/patches/Purpur/patches/server/0025-Giants-AI-settings.patch @@ -38,7 +38,7 @@ index f4440a5c4aedb1d7d303517f86a07c856dd1309b..7443fe924486404931c11793acc67e2f float f = difficultydamagescaler.d(); diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index b987cee913bf909fa0daa6280376838e9429fe5d..7720cf9dcbc5a9680c68f47aef08ff1c3b154022 100644 +index 2777bd3ea82b214fc15c5ce3ce47c90c1e5fe538..f5bc04059c24f57530653c8845cfe4daa5fed843 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -261,6 +261,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0027-Zombie-horse-naturally-spawn.patch b/patches/Purpur/patches/server/0027-Zombie-horse-naturally-spawn.patch index 1cd2643d..04905784 100644 --- a/patches/Purpur/patches/server/0027-Zombie-horse-naturally-spawn.patch +++ b/patches/Purpur/patches/server/0027-Zombie-horse-naturally-spawn.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Zombie horse naturally spawn diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index 368aadca86f3775eabe8cf7ec76b7305a6871bd5..446dc23e9b16314b80767ce12b82f993f48824f6 100644 +index 18d70aff974d756a62a8f9f0e6c52f89ef1fa2c8..c49b049351c36878238e65eb9cbf949a682e4a7d 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -96,6 +96,7 @@ import net.minecraft.world.entity.ai.village.poi.VillagePlace; diff --git a/patches/Purpur/patches/server/0039-Cows-eat-mushrooms.patch b/patches/Purpur/patches/server/0039-Cows-eat-mushrooms.patch index b0b68fe0..21bff493 100644 --- a/patches/Purpur/patches/server/0039-Cows-eat-mushrooms.patch +++ b/patches/Purpur/patches/server/0039-Cows-eat-mushrooms.patch @@ -17,7 +17,7 @@ index b7c72eaf5715a30bb8f82891f9830f9f62ec03c9..c8071e2909c03bd8eafb92fbf8fd8701 this.setPositionRotation(entity.locX(), entity.locY(), entity.locZ(), entity.yaw, entity.pitch); } diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 7720cf9dcbc5a9680c68f47aef08ff1c3b154022..ee42f3d97c3453bacfe0be40ee99f08649d44acf 100644 +index f5bc04059c24f57530653c8845cfe4daa5fed843..5cdefe2a1b4085e3aae7dbbb751cfd368593ebd7 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -176,7 +176,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0045-Signs-allow-color-codes.patch b/patches/Purpur/patches/server/0045-Signs-allow-color-codes.patch index 9d4cc49d..a02dc85b 100644 --- a/patches/Purpur/patches/server/0045-Signs-allow-color-codes.patch +++ b/patches/Purpur/patches/server/0045-Signs-allow-color-codes.patch @@ -17,10 +17,10 @@ index e875671ce985199bc37de131280935a859253954..ba71636527f173dfc5ddae9ef0f7c73d this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition())); } diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index ac36ca9251e3acb663c62ad7af05bfaf2fd68f5c..f45bbf7a4ab4d841a12270c1399fb09538b9fe90 100644 +index 1e7ae4a3947f2714159a6b93ef7d79541a6e070d..d2896d49b4b3cb0a6cf64ee29233ff59b8fba45d 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -3059,6 +3059,15 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -3072,6 +3072,15 @@ public class PlayerConnection implements PacketListenerPlayIn { } } // Paper end diff --git a/patches/Purpur/patches/server/0047-Controllable-Minecarts.patch b/patches/Purpur/patches/server/0047-Controllable-Minecarts.patch index 3ad58771..23ceb0ff 100644 --- a/patches/Purpur/patches/server/0047-Controllable-Minecarts.patch +++ b/patches/Purpur/patches/server/0047-Controllable-Minecarts.patch @@ -50,7 +50,7 @@ index ba71636527f173dfc5ddae9ef0f7c73d0423d9b3..c2e987808ae5ccb23cc7bcc5221faea1 if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index ee42f3d97c3453bacfe0be40ee99f08649d44acf..09c00dae1d25878a7d55bdc2498b7d6e325dc45a 100644 +index 5cdefe2a1b4085e3aae7dbbb751cfd368593ebd7..f1781c2100bf3a8fa7123b66f9ab682177d6490e 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -194,9 +194,9 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch b/patches/Purpur/patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch index 0ba069d6..0e3001d6 100644 --- a/patches/Purpur/patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch +++ b/patches/Purpur/patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Disable loot drops on death by cramming diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 09c00dae1d25878a7d55bdc2498b7d6e325dc45a..f338c3fc638d76eb6850573517c6123584bc7e04 100644 +index f1781c2100bf3a8fa7123b66f9ab682177d6490e..906791fc6180e011ce029ac95a63c92553f0377e 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -1598,8 +1598,10 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0052-Fix-the-dead-lagging-the-server.patch b/patches/Purpur/patches/server/0052-Fix-the-dead-lagging-the-server.patch index 732ea64f..0ab74f67 100644 --- a/patches/Purpur/patches/server/0052-Fix-the-dead-lagging-the-server.patch +++ b/patches/Purpur/patches/server/0052-Fix-the-dead-lagging-the-server.patch @@ -17,7 +17,7 @@ index c8071e2909c03bd8eafb92fbf8fd8701642df1f9..7c9fc120d2b58ca969b8a0ff9619e96f public void f(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index f338c3fc638d76eb6850573517c6123584bc7e04..7d1b5c992521ae1dae94d3e658d73491387e1d98 100644 +index 906791fc6180e011ce029ac95a63c92553f0377e..6fb4b06df010c3099a1af3b145749ea439a4aa39 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -2597,7 +2597,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0053-Skip-events-if-there-s-no-listeners.patch b/patches/Purpur/patches/server/0053-Skip-events-if-there-s-no-listeners.patch index 70de8683..8fd44bfa 100644 --- a/patches/Purpur/patches/server/0053-Skip-events-if-there-s-no-listeners.patch +++ b/patches/Purpur/patches/server/0053-Skip-events-if-there-s-no-listeners.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Skip events if there's no listeners diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java -index a70e0761aeddee8fafff971b5cbd0422ab560fb5..6fc5ee06c3bed8d9aa0e13dd7fa8d70ff6711f85 100644 +index 988d1c9e9f4f29325043eb083123d12dd5f8081d..c25440e810e61bcdc299a0caebaec54b6862dd3c 100644 --- a/src/main/java/net/minecraft/commands/CommandDispatcher.java +++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java @@ -362,6 +362,7 @@ public class CommandDispatcher { diff --git a/patches/Purpur/patches/server/0056-Configurable-TPS-Catchup.patch b/patches/Purpur/patches/server/0056-Configurable-TPS-Catchup.patch index 2e96afd5..b7a71037 100644 --- a/patches/Purpur/patches/server/0056-Configurable-TPS-Catchup.patch +++ b/patches/Purpur/patches/server/0056-Configurable-TPS-Catchup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable TPS Catchup diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 22ca3082fff5a630fe7d6a5ec1e70f5675a5a8bc..9cc171e17e0d5d8f60a6d229eb2d39fb9181412f 100644 +index a75a8322829f36045243d5fd61d28b126af1f0af..ab2424a868a3d29af96f36ce037f1ab9b9b2a635 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1122,7 +1122,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant RequiredArgumentBuilder a(String s, ArgumentType argumenttype) { return RequiredArgumentBuilder.argument(s, argumenttype); } -@@ -441,6 +444,7 @@ public class CommandDispatcher { - }; - } - -+ public com.mojang.brigadier.CommandDispatcher getDispatcher() { return a(); } // Purpur - OBFHELPER - public com.mojang.brigadier.CommandDispatcher a() { - return this.b; - } diff --git a/src/main/java/net/minecraft/commands/CommandListenerWrapper.java b/src/main/java/net/minecraft/commands/CommandListenerWrapper.java index 8402af32cc476d7f468842eb4f34c7521d72bcc8..4480fe75cfad35a5104b5116c5ec2c80d18f15f5 100644 --- a/src/main/java/net/minecraft/commands/CommandListenerWrapper.java diff --git a/patches/Purpur/patches/server/0083-Allow-color-codes-in-books.patch b/patches/Purpur/patches/server/0083-Allow-color-codes-in-books.patch index bf4cf886..4cf01a22 100644 --- a/patches/Purpur/patches/server/0083-Allow-color-codes-in-books.patch +++ b/patches/Purpur/patches/server/0083-Allow-color-codes-in-books.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow color codes in books diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index f45bbf7a4ab4d841a12270c1399fb09538b9fe90..38273c73610b23ba75db658763cbb2e4c4871d58 100644 +index d2896d49b4b3cb0a6cf64ee29233ff59b8fba45d..d309552f56f5ea695d57a95ed0a091f4c383ca34 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -1209,7 +1209,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1211,7 +1211,8 @@ public class PlayerConnection implements PacketListenerPlayIn { if (itemstack.getItem() == Items.WRITABLE_BOOK) { NBTTagList nbttaglist = new NBTTagList(); @@ -18,7 +18,7 @@ index f45bbf7a4ab4d841a12270c1399fb09538b9fe90..38273c73610b23ba75db658763cbb2e4 ItemStack old = itemstack.cloneItemStack(); // CraftBukkit itemstack.a("pages", (NBTBase) nbttaglist); this.player.inventory.setItem(i, CraftEventFactory.handleEditBookEvent(player, i, old, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) -@@ -1227,13 +1228,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1229,13 +1230,14 @@ public class PlayerConnection implements PacketListenerPlayIn { itemstack1.setTag(nbttagcompound.clone()); } @@ -35,7 +35,7 @@ index f45bbf7a4ab4d841a12270c1399fb09538b9fe90..38273c73610b23ba75db658763cbb2e4 ChatComponentText chatcomponenttext = new ChatComponentText(s1); String s2 = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext); -@@ -1245,6 +1247,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1247,6 +1249,16 @@ public class PlayerConnection implements PacketListenerPlayIn { } } diff --git a/patches/Purpur/patches/server/0084-Entity-lifespan.patch b/patches/Purpur/patches/server/0084-Entity-lifespan.patch index 6a1936a7..ab757fc5 100644 --- a/patches/Purpur/patches/server/0084-Entity-lifespan.patch +++ b/patches/Purpur/patches/server/0084-Entity-lifespan.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity lifespan diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index 38273c73610b23ba75db658763cbb2e4c4871d58..d30a9ef98cbe214c0258e7d5e8527ff8fd956ddd 100644 +index d309552f56f5ea695d57a95ed0a091f4c383ca34..77e7f3f33b13050ff383458ae294906c5ff77476 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -2455,6 +2455,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2457,6 +2457,7 @@ public class PlayerConnection implements PacketListenerPlayIn { boolean triggerLeashUpdate = itemInHand != null && itemInHand.getItem() == Items.LEAD && entity instanceof EntityInsentient; Item origItem = this.player.inventory.getItemInHand() == null ? null : this.player.inventory.getItemInHand().getItem(); PlayerInteractEntityEvent event; diff --git a/patches/Purpur/patches/server/0085-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch b/patches/Purpur/patches/server/0085-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch index 40bdba8f..9528fa75 100644 --- a/patches/Purpur/patches/server/0085-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch +++ b/patches/Purpur/patches/server/0085-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch @@ -36,7 +36,7 @@ index 97f82ac9fb8f91aea11660ad6d7284faed8e9434..8e76c11e6bec5357322ea906af9e30f7 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 35936f4651484c495a43529638d79b5df65b82ee..a2073fd6fc5c2a5fd2835445019c7ecf86c5eb47 100644 +index e2124f60b37436d2514f92e180e914b4d4a8470c..f4407cd0865b0e4861930645615c057d11079034 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -45,6 +45,7 @@ import net.minecraft.network.syncher.DataWatcher; diff --git a/patches/Purpur/patches/server/0086-Squid-EAR-immunity.patch b/patches/Purpur/patches/server/0086-Squid-EAR-immunity.patch index d3e35185..097dea7b 100644 --- a/patches/Purpur/patches/server/0086-Squid-EAR-immunity.patch +++ b/patches/Purpur/patches/server/0086-Squid-EAR-immunity.patch @@ -21,7 +21,7 @@ index b9e252c3db715c288493d5b98fc20d84de46c4e4..cdb7a97ecececa78a200acc898535d33 public boolean villagerUseBrainTicksOnlyWhenLagging = true; public boolean villagerCanBeLeashed = false; diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index dc2d880ded328f8377c207ce15f604ec5c25176c..5881497825b3c11ce5d23e4f609fd769ba6a76e1 100644 +index c94cd5a95f28190e88d31b522035fc7c74a2ac33..d04a21b93374c287b271deb6618b984abc8831bb 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -11,6 +11,7 @@ import net.minecraft.world.entity.EntityLiving; @@ -32,7 +32,7 @@ index dc2d880ded328f8377c207ce15f604ec5c25176c..5881497825b3c11ce5d23e4f609fd769 import net.minecraft.world.entity.boss.EntityComplexPart; import net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal; import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; -@@ -386,6 +387,7 @@ public class ActivationRange +@@ -387,6 +388,7 @@ public class ActivationRange */ public static boolean checkIfActive(Entity entity) { diff --git a/patches/Purpur/patches/server/0092-Totems-work-in-inventory.patch b/patches/Purpur/patches/server/0092-Totems-work-in-inventory.patch index ae6bc72d..d33321dc 100644 --- a/patches/Purpur/patches/server/0092-Totems-work-in-inventory.patch +++ b/patches/Purpur/patches/server/0092-Totems-work-in-inventory.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Totems work in inventory diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index a2073fd6fc5c2a5fd2835445019c7ecf86c5eb47..451a28b1950bad61de7181a2fb89549063d8e2bf 100644 +index f4407cd0865b0e4861930645615c057d11079034..8930ab8a39c50eaa84372f0e8caf8b92789bb0c4 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -1426,6 +1426,19 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0093-Populator-seed-controls.patch b/patches/Purpur/patches/server/0093-Populator-seed-controls.patch index 81310b66..87fb742c 100644 --- a/patches/Purpur/patches/server/0093-Populator-seed-controls.patch +++ b/patches/Purpur/patches/server/0093-Populator-seed-controls.patch @@ -18,7 +18,7 @@ index 5e672a0660d0aceffcdb26d185590ca18aa4f023..4b171a2a60e24947e884f8988920f335 } final Object val = config.get(key); diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index d29b537bbe4f852162b720d6b23b741829af21f9..c3669383050241df97e25c89d80720ad446c690d 100644 +index e1dc7c1025e19f7393a45719af8fe7aae016184d..dd45a896998e4d5637ef0dd08f2b72d6b6f891de 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -1,5 +1,6 @@ diff --git a/patches/Purpur/patches/server/0098-Add-no-random-tick-block-list.patch b/patches/Purpur/patches/server/0098-Add-no-random-tick-block-list.patch index dbe5450d..32754658 100644 --- a/patches/Purpur/patches/server/0098-Add-no-random-tick-block-list.patch +++ b/patches/Purpur/patches/server/0098-Add-no-random-tick-block-list.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add no-random-tick block list diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index 446dc23e9b16314b80767ce12b82f993f48824f6..f63c096218b7d984b1930667766021324ac72345 100644 +index c49b049351c36878238e65eb9cbf949a682e4a7d..50fac6013f14ddd427f51ba78ecf101df43f5b4a 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -532,14 +532,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { diff --git a/patches/Purpur/patches/server/0102-Ridables.patch b/patches/Purpur/patches/server/0102-Ridables.patch index 00855518..a4172828 100644 --- a/patches/Purpur/patches/server/0102-Ridables.patch +++ b/patches/Purpur/patches/server/0102-Ridables.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ridables diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fd32bd05973785c4fc64849a8b7a96551a3223b9..45cb8681fd0942084b56eb8d45390c2dbc8a4f3d 100644 +index cdddae4ff5178112d4523079144803f2694267d5..f6637353fb358e7720edabc355ea036d37d039ca 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1530,6 +1530,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper worldserver.hasEntityMoveEvent = EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper @@ -88,7 +88,7 @@ index 8e76c11e6bec5357322ea906af9e30f71e5718be..86bd39af6e3240b82f5afd6e7c554471 public void playerTick() { diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index f63c096218b7d984b1930667766021324ac72345..e4f08e0da995cfe8c8540a167bad246ce131e010 100644 +index 50fac6013f14ddd427f51ba78ecf101df43f5b4a..8d1debb8152176581041a14e28cfcca8f92ae261 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -216,6 +216,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -100,10 +100,10 @@ index f63c096218b7d984b1930667766021324ac72345..e4f08e0da995cfe8c8540a167bad246c return new Throwable(entity + " Added to world at " + new java.util.Date()); } diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index d30a9ef98cbe214c0258e7d5e8527ff8fd956ddd..e39e46cf3cb646dd100b698cbc6d4f9b6896696d 100644 +index 77e7f3f33b13050ff383458ae294906c5ff77476..cbd8b1b98256847795aca1a7b08f7eb3f9e232a7 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -2464,6 +2464,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2466,6 +2466,8 @@ public class PlayerConnection implements PacketListenerPlayIn { } this.server.getPluginManager().callEvent(event); @@ -419,7 +419,7 @@ index c9136f1b54ff0620a621b703b4e7487f4a63b01d..8b7f840bb1b24996b40c9bef85f4c1e9 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 451a28b1950bad61de7181a2fb89549063d8e2bf..c0a6bbe570e95f4449b404b21855860c7aba057a 100644 +index 8930ab8a39c50eaa84372f0e8caf8b92789bb0c4..bcf1d77f627e800b9dbbfd7f9ed99887e2aca714 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -559,7 +559,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0108-Allow-toggling-special-MobSpawners-per-world.patch b/patches/Purpur/patches/server/0108-Allow-toggling-special-MobSpawners-per-world.patch index bfc50d79..1d8b995b 100644 --- a/patches/Purpur/patches/server/0108-Allow-toggling-special-MobSpawners-per-world.patch +++ b/patches/Purpur/patches/server/0108-Allow-toggling-special-MobSpawners-per-world.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow toggling special MobSpawners per world In vanilla, these are all hardcoded on for world type 0 (overworld) and hardcoded off for every other world type. Default config behaviour matches this. diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index e4f08e0da995cfe8c8540a167bad246ce131e010..b374460bdb4c4dd0ed3d85380734ae39bc17fdd9 100644 +index 8d1debb8152176581041a14e28cfcca8f92ae261..373b4c24e105c343f9ba125514853a0d0dbdc524 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -92,6 +92,7 @@ import net.minecraft.world.entity.EnumCreatureType; diff --git a/patches/Purpur/patches/server/0117-Configurable-daylight-cycle.patch b/patches/Purpur/patches/server/0117-Configurable-daylight-cycle.patch index e6942b21..01fc8328 100644 --- a/patches/Purpur/patches/server/0117-Configurable-daylight-cycle.patch +++ b/patches/Purpur/patches/server/0117-Configurable-daylight-cycle.patch @@ -18,7 +18,7 @@ index 3086ee023685781d94e2fb99fc8dff5264f01165..74c1047305cac5673e274096709c757e public PacketPlayOutUpdateTime() {} diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index b374460bdb4c4dd0ed3d85380734ae39bc17fdd9..3588bd1e5dc9ad862086dc3f96f99cbb98250162 100644 +index 373b4c24e105c343f9ba125514853a0d0dbdc524..9a2cc5dfcfaefc8a257a85c0bc09456074ff76c2 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -64,6 +64,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutExplosion; diff --git a/patches/Purpur/patches/server/0133-Add-demo-command.patch b/patches/Purpur/patches/server/0133-Add-demo-command.patch index a0183616..911b8114 100644 --- a/patches/Purpur/patches/server/0133-Add-demo-command.patch +++ b/patches/Purpur/patches/server/0133-Add-demo-command.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Add demo command diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java -index e8fe4984fdc67536561a1ad08b328a30b30b8717..a551636c2c59e68a5abb1cd5611c1d5c7e36f514 100644 +index 2566c5ea7ba2bbeed43ba74944c038b53f7f9fde..d402a896a0094e6c379d71c63d744b4ee443c097 100644 --- a/src/main/java/net/minecraft/commands/CommandDispatcher.java +++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java @@ -191,6 +191,7 @@ public class CommandDispatcher { CommandIdleTimeout.a(this.b); CommandStop.a(this.b); CommandWhitelist.a(this.b); -+ net.pl3x.purpur.command.DemoCommand.register(getDispatcher()); // Purpur - net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur ++ net.pl3x.purpur.command.DemoCommand.register(dispatcher()); // Purpur + net.pl3x.purpur.command.PingCommand.register(dispatcher()); // Purpur } diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutGameStateChange.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutGameStateChange.java diff --git a/patches/Purpur/patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch b/patches/Purpur/patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch index 8066bfb5..824dd086 100644 --- a/patches/Purpur/patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch +++ b/patches/Purpur/patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch @@ -7,7 +7,7 @@ Configurable chance to spawn a wolf that is rabid. Rabid wolves attack all players, mobs, and animals. diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index c0a6bbe570e95f4449b404b21855860c7aba057a..04ae8af914e65ae9725d276a9dcc24893cbcabb9 100644 +index bcf1d77f627e800b9dbbfd7f9ed99887e2aca714..c957122f8463fc1eae632730a64bec7f8b0d1055 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -2200,6 +2200,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0152-Implement-TPSBar.patch b/patches/Purpur/patches/server/0152-Implement-TPSBar.patch index c36889e6..dfd1c37e 100644 --- a/patches/Purpur/patches/server/0152-Implement-TPSBar.patch +++ b/patches/Purpur/patches/server/0152-Implement-TPSBar.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Implement TPSBar diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java -index a551636c2c59e68a5abb1cd5611c1d5c7e36f514..b7663a3d64ae5202abb93eabba6ec013bae96334 100644 +index d402a896a0094e6c379d71c63d744b4ee443c097..3bcaafb1fe3af67fce2be1f62c7f1aa86ebd51ef 100644 --- a/src/main/java/net/minecraft/commands/CommandDispatcher.java +++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java @@ -193,6 +193,7 @@ public class CommandDispatcher { CommandWhitelist.a(this.b); - net.pl3x.purpur.command.DemoCommand.register(getDispatcher()); // Purpur - net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur -+ net.pl3x.purpur.command.TPSBarCommand.register(getDispatcher()); // Purpur + net.pl3x.purpur.command.DemoCommand.register(dispatcher()); // Purpur + net.pl3x.purpur.command.PingCommand.register(dispatcher()); // Purpur ++ net.pl3x.purpur.command.TPSBarCommand.register(dispatcher()); // Purpur } if (commanddispatcher_servertype.d) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 45cb8681fd0942084b56eb8d45390c2dbc8a4f3d..16c20b3e7dcbbdb08e8c2a15074495eacc001e70 100644 +index f6637353fb358e7720edabc355ea036d37d039ca..5e2c7f3bf9aa99b10260454b9957caff81a7cd26 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -979,6 +979,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 100) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages"); @@ -16,7 +16,7 @@ index e39e46cf3cb646dd100b698cbc6d4f9b6896696d..f9a232cbc5dc55f3de2286037ca526b1 minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!")); return; } -@@ -1133,6 +1134,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1135,6 +1136,7 @@ public class PlayerConnection implements PacketListenerPlayIn { int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with with a page too large!"); @@ -24,7 +24,7 @@ index e39e46cf3cb646dd100b698cbc6d4f9b6896696d..f9a232cbc5dc55f3de2286037ca526b1 minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!")); return; } -@@ -1156,6 +1158,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1158,6 +1160,7 @@ public class PlayerConnection implements PacketListenerPlayIn { if (byteTotal > byteAllowed) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); diff --git a/patches/Purpur/patches/server/0157-Add-mobGriefing-bypass-to-everything-affected.patch b/patches/Purpur/patches/server/0157-Add-mobGriefing-bypass-to-everything-affected.patch index 0f00ee20..a865cc19 100644 --- a/patches/Purpur/patches/server/0157-Add-mobGriefing-bypass-to-everything-affected.patch +++ b/patches/Purpur/patches/server/0157-Add-mobGriefing-bypass-to-everything-affected.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add mobGriefing bypass to everything affected This adds the "bypass-mob-griefing" world config option to everything that is affected by the gamerule. diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 04ae8af914e65ae9725d276a9dcc24893cbcabb9..1757e44ecb9d23fd0ca6f7e7f9c07509b377675f 100644 +index c957122f8463fc1eae632730a64bec7f8b0d1055..52bd6b4a3bcd44166bd4c897756fe06b19120907 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -1571,7 +1571,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch b/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch index bf216bfb..f5164f59 100644 --- a/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch +++ b/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch @@ -19,7 +19,7 @@ index 63d93060b350069040876aaacb91c853d674ea7b..e9793954c872baacfe7be80ecf3888e8 } return; diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 1757e44ecb9d23fd0ca6f7e7f9c07509b377675f..26ae5f5d0b8acfd173e3401aa07bc6fcdc860978 100644 +index 52bd6b4a3bcd44166bd4c897756fe06b19120907..f59d18195bf40f5589d50cee8d074005e98416a6 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -2977,6 +2977,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch b/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch index ce15e0a0..b49faaca 100644 --- a/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch +++ b/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Dont run with scissors! diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index f9a232cbc5dc55f3de2286037ca526b15c0842ba..1e64c2467c1c96e93f6843a9f7283baf2bd33a61 100644 +index 0fc053def9e632543c3ba54e5a700518efba95d8..7abd1e47b6f3bed48228ed6dc2a6a27a877e03c2 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -1545,6 +1545,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1547,6 +1547,12 @@ public class PlayerConnection implements PacketListenerPlayIn { this.player.fallDistance = 0.0F; } diff --git a/patches/Purpur/patches/server/0172-One-Punch-Man.patch b/patches/Purpur/patches/server/0172-One-Punch-Man.patch index 142d4760..a407fd84 100644 --- a/patches/Purpur/patches/server/0172-One-Punch-Man.patch +++ b/patches/Purpur/patches/server/0172-One-Punch-Man.patch @@ -5,7 +5,7 @@ Subject: [PATCH] One Punch Man! diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 26ae5f5d0b8acfd173e3401aa07bc6fcdc860978..2c5280fe13fa962cfa514b41b1da15c019e30715 100644 +index f59d18195bf40f5589d50cee8d074005e98416a6..cbfaa40c327fefe416c4c751846bcf278a36144a 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -2019,6 +2019,23 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Purpur/patches/server/0183-Config-for-skipping-night.patch b/patches/Purpur/patches/server/0183-Config-for-skipping-night.patch index 39502c6b..12c0162f 100644 --- a/patches/Purpur/patches/server/0183-Config-for-skipping-night.patch +++ b/patches/Purpur/patches/server/0183-Config-for-skipping-night.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Config for skipping night diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index 3588bd1e5dc9ad862086dc3f96f99cbb98250162..80b08904143b7656aa125a396bbd2866370c8906 100644 +index 9a2cc5dfcfaefc8a257a85c0bc09456074ff76c2..1b15216d6a03c1031d2bbea2e0243a0de9a9199f 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -1028,7 +1028,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { diff --git a/patches/Purpur/patches/server/0186-Drowning-Settings.patch b/patches/Purpur/patches/server/0186-Drowning-Settings.patch index 0327c64d..9bc0a597 100644 --- a/patches/Purpur/patches/server/0186-Drowning-Settings.patch +++ b/patches/Purpur/patches/server/0186-Drowning-Settings.patch @@ -18,7 +18,7 @@ index d321616b7f726f4ff307b46ced9efce6cc20b82f..c20787a20cf6f273092d2b7ef0d7d90a public Iterable bn() { diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 2c5280fe13fa962cfa514b41b1da15c019e30715..82d3aaaf9bbb493d54f6bf2d34edafc5498aee88 100644 +index cbfaa40c327fefe416c4c751846bcf278a36144a..be709c961cd85c1db32fb49c71c63814cbe6bd23 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -394,7 +394,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/Tuinity/patches/api/0003-Per-player-viewdistances.patch b/patches/Tuinity/patches/api/0003-Per-player-viewdistances.patch index b7b00bb8..12b6352f 100644 --- a/patches/Tuinity/patches/api/0003-Per-player-viewdistances.patch +++ b/patches/Tuinity/patches/api/0003-Per-player-viewdistances.patch @@ -8,7 +8,7 @@ Add per player no-tick, tick, and send view distances. Also add send view distance to World. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 4c80a999fcc4d656c047b96cb549782c693b33cd..226c9a1fc49b11a9dd7653c695f7031bb51c3a41 100644 +index 98512bddbb0c8bd6a3f487c60b1ec77b274b991e..3da0b1405de508b1b2e1b941c87c0f0ac0ff1e1a 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -3517,6 +3517,26 @@ public interface World extends PluginMessageRecipient, Metadatable, net.kyori.ad diff --git a/patches/Tuinity/patches/server/0002-Brand-changes.patch b/patches/Tuinity/patches/server/0002-Brand-changes.patch index a7ded9d1..74c4f6fc 100644 --- a/patches/Tuinity/patches/server/0002-Brand-changes.patch +++ b/patches/Tuinity/patches/server/0002-Brand-changes.patch @@ -40,10 +40,10 @@ index a0f53c9eff04a40780b3ba568dbfc5bbe9bd8504..3bc5cd1e53dd7c94b948e7f57f0dc8e0 throwable = throwable1; throw throwable1; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0db00322ebf600245bf9311e547c8c743a60a173..e3253796c70b990e000ed1073f4070fe07a3f845 100644 +index 8ee622108cebff2bba8a44fb255a3b6c03ed0220..bfd0d8e3e7b6409b8ef7620ef147120480878c51 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1569,7 +1569,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant currentLevel) { + // level increase @@ -1096,6 +1099,8 @@ index 0000000000000000000000000000000000000000..155d10994f2d7df9ac927d955d99016f + + // now we propagate the decreases (which will then re-propagate clobbered sources) + this.propagateDecreases(); ++ ++ return ret; + } + + protected void propagateIncreases() { @@ -1238,10 +1243,10 @@ index 0000000000000000000000000000000000000000..155d10994f2d7df9ac927d955d99016f +} diff --git a/src/main/java/com/tuinity/tuinity/util/misc/Delayed8WayDistancePropagator2D.java b/src/main/java/com/tuinity/tuinity/util/misc/Delayed8WayDistancePropagator2D.java new file mode 100644 -index 0000000000000000000000000000000000000000..606417a8aeaca2682595f417bba8e9d411999da9 +index 0000000000000000000000000000000000000000..cdd3c4032c1d6b34a10ba415bd4d0e377aa9af3c --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/util/misc/Delayed8WayDistancePropagator2D.java -@@ -0,0 +1,713 @@ +@@ -0,0 +1,718 @@ +package com.tuinity.tuinity.util.misc; + +import it.unimi.dsi.fastutil.HashCommon; @@ -1622,11 +1627,13 @@ index 0000000000000000000000000000000000000000..606417a8aeaca2682595f417bba8e9d4 + this.levelRemoveWorkQueueBitset |= (1L << level); + } + -+ public void propagateUpdates() { ++ public boolean propagateUpdates() { + if (this.updatedSources.isEmpty()) { -+ return; ++ return false; + } + ++ boolean ret = false; ++ + for (final LongIterator iterator = this.updatedSources.iterator(); iterator.hasNext();) { + final long coordinate = iterator.nextLong(); + @@ -1636,6 +1643,7 @@ index 0000000000000000000000000000000000000000..606417a8aeaca2682595f417bba8e9d4 + if (currentLevel == updatedSource) { + continue; + } ++ ret = true; + + if (updatedSource > currentLevel) { + // level increase @@ -1656,6 +1664,8 @@ index 0000000000000000000000000000000000000000..606417a8aeaca2682595f417bba8e9d4 + + // now we propagate the decreases (which will then re-propagate clobbered sources) + this.propagateDecreases(); ++ ++ return ret; + } + + protected void propagateIncreases() { @@ -2024,7 +2034,7 @@ index 1d72af9cace7aa8f1d20c7c1c5be621f533e2dad..006e7076932f6be576a64da09c4d84ca public static void mergeSortedSets(final java.util.function.Consumer consumer, final java.util.Comparator comparator, final java.util.SortedSet...sets) { final ObjectRBTreeSet all = new ObjectRBTreeSet<>(comparator); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e3253796c70b990e000ed1073f4070fe07a3f845..dda93749eef9cd63e47ffe269b839512fe4db695 100644 +index bfd0d8e3e7b6409b8ef7620ef147120480878c51..dafd5c368036afa4516da7eac04ddb7c649e8b97 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -267,6 +267,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public boolean serverAutoSave = false; // Paper -@@ -1088,6 +1089,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant(s, comparator, 0L); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 62513d3acb930c4c9fa3d875a1fc94bb4d948951..69b776b0a7e254a84fcf50784cde30629488a2d9 100644 +index 05098332d83b1abfaa0a6d3bd4a9e801ea90d2ad..8484542c108b69a310b19806db5e32a04e3ee991 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -505,6 +505,7 @@ public class CraftWorld implements World { diff --git a/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch b/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch index 32ff6aff..659bd220 100644 --- a/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch +++ b/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch @@ -35,7 +35,7 @@ index 5aa558bd05c4ab735730263f220478c36a4ba0fd..6473b951788a3ecbeee4811ea0288ff4 } \ No newline at end of file diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 69b776b0a7e254a84fcf50784cde30629488a2d9..4356d30353cc856c53731e9f10885d74a62027d2 100644 +index 8484542c108b69a310b19806db5e32a04e3ee991..7e377eb7ad2710b2541eaab0885c07c56602a1f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -342,6 +342,14 @@ public class CraftWorld implements World { diff --git a/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch b/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch index e258bef2..fd8682ec 100644 --- a/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch +++ b/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch @@ -18,10 +18,10 @@ index 4666d6582535d6e49c5bd40d4fcdcdfe07590aa9..b870cca05f0ba354e6976a7051123563 // re-schedule eventually toTick.tickState = STATE_SCHEDULED; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f6d443d0193ceea1b3248b66cb198be04822e9e7..5c909b776e111d6bd9e2429f25fed121bb391219 100644 +index 419d17d0eb9426e4f3f9f97a504e567401d175f3..dae8824a6034cdaaecbedeba5e05c62f4565583f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1105,7 +1105,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { @@ -148,7 +148,7 @@ index f6d443d0193ceea1b3248b66cb198be04822e9e7..5c909b776e111d6bd9e2429f25fed121 return !this.canOversleep(); }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); -@@ -1411,16 +1467,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant(), diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5c909b776e111d6bd9e2429f25fed121bb391219..d7e1c830764973c31dff8311a79e617d8f283a53 100644 +index dae8824a6034cdaaecbedeba5e05c62f4565583f..29677908376e111abead33b42920e07aeb1d4b02 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1441,6 +1441,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null); diff --git a/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch index 192eb5b1..b72a29af 100644 --- a/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimise collision checking in player move packet handling Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f61d76f9f 100644 +index de6e6152795f4f01c8b79def423f1cb59906a7f7..878c5342ca524768fbe2874b54bc12574852cefa 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -583,12 +583,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -585,12 +585,14 @@ public class PlayerConnection implements PacketListenerPlayIn { return; } @@ -25,7 +25,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f double d11 = d7; d6 = d3 - entity.locX(); -@@ -602,16 +604,25 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -604,16 +606,25 @@ public class PlayerConnection implements PacketListenerPlayIn { boolean flag1 = false; if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot @@ -55,7 +55,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f entity.setLocation(d0, d1, d2, f, f1); player.setLocation(d0, d1, d2, this.player.yaw, this.player.pitch); // CraftBukkit this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); -@@ -697,7 +708,32 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -699,7 +710,32 @@ public class PlayerConnection implements PacketListenerPlayIn { } private boolean a(Entity entity) { @@ -89,7 +89,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f } @Override -@@ -1219,7 +1255,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1221,7 +1257,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (this.teleportPos != null) { @@ -98,7 +98,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f this.A = this.e; this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); } -@@ -1306,7 +1342,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1308,7 +1344,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } } @@ -107,7 +107,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f d7 = d4 - this.o; d8 = d5 - this.p; -@@ -1345,6 +1381,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1347,6 +1383,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9)); @@ -115,7 +115,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move // Paper start - prevent position desync if (this.teleportPos != null) { -@@ -1364,12 +1401,23 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1366,12 +1403,23 @@ public class PlayerConnection implements PacketListenerPlayIn { boolean flag1 = false; if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot @@ -141,7 +141,7 @@ index 0b2a94d44a7321369dcb0a96529ff35366d98e09..40a7f69e5e14078977ef615abf3a0f1f this.a(d0, d1, d2, f, f1); } else { // CraftBukkit start - fire PlayerMoveEvent -@@ -1456,6 +1504,26 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1458,6 +1506,26 @@ public class PlayerConnection implements PacketListenerPlayIn { } } diff --git a/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch b/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch index abee0fe7..f85994bd 100644 --- a/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch +++ b/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch @@ -22,7 +22,7 @@ index e50731723d266ba65b2163df2e935afb8b013a93..a6736d15282715d920bab85eb92074cd } value.append("},"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 01821015a0737dd770524bf77c8cb46d0ff6562e..b0801ca77620753ab61dba62429ce76e95aaba8f 100644 +index 996042cfe0bbb49675bc5fcb84dc2c5fa79d95a3..0128a24f1de7468ff60ba2de0ed825ff62363f6b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -720,6 +720,30 @@ public class CraftWorld implements World { diff --git a/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch b/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch index 988642f8..bd058ef0 100644 --- a/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch +++ b/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch @@ -11,10 +11,10 @@ gui. It looks like during sigint shutdown there can be some deadlock between the server thread and awt shutdown thread here. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d7e1c830764973c31dff8311a79e617d8f283a53..02d8a8f13d81c47316f704fb700afd0214a5f546 100644 +index 29677908376e111abead33b42920e07aeb1d4b02..7b0b416c73c8914f3c8c570f2020490ef2babf64 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -868,10 +868,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant(chunk.getLightSources().collect(Collectors.toList())).iterator(); ++ } finally { ++ protoChunk.releaseLightSources(); ++ } ++ } else { ++ return new ArrayList<>(chunk.getLightSources().collect(Collectors.toList())).iterator(); ++ } + } + } + @@ -4447,7 +4459,7 @@ index f7e9a151ffbbb64cb8f8bc1d37516d7979277b17..980063ada85d7e9660a625d67b2f6a82 this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); // CraftBukkit this.lastHealthSent = this.getHealth(); diff --git a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java -index 0b80569648c1df01aab52d0b8d47028cda925d86..4d651cc21a9cb2fdeabff62d8978c3ec4abe2f68 100644 +index 0b80569648c1df01aab52d0b8d47028cda925d86..ad584ba21c6e201b778f32cea6d7cc5bf67f9746 100644 --- a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java +++ b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java @@ -2,6 +2,11 @@ package net.minecraft.server.level; @@ -4775,7 +4787,7 @@ index 0b80569648c1df01aab52d0b8d47028cda925d86..4d651cc21a9cb2fdeabff62d8978c3ec + LightEngineThreaded.this.queueUpdate(); + }).whenComplete((IChunkAccess chunk, Throwable throwable) -> { + if (throwable != null && !(throwable instanceof ThreadDeath)) { -+ LOGGER.fatal("Failed to light chunk " + ichunkaccess.getPos().toString() + " in world '" + this.theLightEngine.getWorld().getWorld().getName() + "'"); ++ LOGGER.fatal("Failed to light chunk " + ichunkaccess.getPos().toString() + " in world '" + this.theLightEngine.getWorld().getWorld().getName() + "'", throwable); + } + }); + } @@ -5191,10 +5203,19 @@ index 0fec15e141051863dbf51a2b3e1ace5028cd2fc1..d7757e60402be9939fc2d90ad79b2bb7 public String toString() { diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java -index 72c258ae5c3cc93e42b86af9426b5e9715dc1599..692658893f9d33938fc4fed854ad31c14c920e95 100644 +index 72c258ae5c3cc93e42b86af9426b5e9715dc1599..c90f530b9cf556da950d8f61156159941815bd99 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java -@@ -66,6 +66,54 @@ public class ProtoChunk implements IChunkAccess { +@@ -54,7 +54,7 @@ public class ProtoChunk implements IChunkAccess { + private final Map i; + private final ChunkSection[] j; + private final List k; +- private final List l; ++ private final List l; private final java.util.concurrent.atomic.AtomicBoolean lightSourcesLocked = new java.util.concurrent.atomic.AtomicBoolean(); // Tuinity - warn when light sources are accessed while locked + private final ShortList[] m; + private final Map, StructureStart> n; + private final Map, LongSet> o; +@@ -66,6 +66,73 @@ public class ProtoChunk implements IChunkAccess { private volatile boolean u; final World world; // Paper - Anti-Xray - Add world // Paper - private -> default @@ -5244,12 +5265,49 @@ index 72c258ae5c3cc93e42b86af9426b5e9715dc1599..692658893f9d33938fc4fed854ad31c1 + this.blockEmptinessMap = emptinessMap; + } + ++ private void checkLightSourceLock() { ++ if (!this.lightSourcesLocked.get()) { ++ return; ++ } ++ ++ IllegalStateException thr = new IllegalStateException("Concurrent access of light sources by thread '" + Thread.currentThread().getName() + "'"); ++ LOGGER.fatal(thr.getMessage(), thr); ++ throw thr; ++ } ++ ++ public void lockLightSources() { ++ if (this.lightSourcesLocked.getAndSet(true)) { ++ throw new IllegalStateException("Light sources is already locked!"); ++ } ++ } ++ ++ public void releaseLightSources() { ++ this.lightSourcesLocked.set(false); ++ } + // Tuinity end - rewrite light engine + // Paper start - Anti-Xray - Add world @Deprecated public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter) { this(chunkcoordintpair, chunkconverter, null); } // Notice for updates: Please make sure this constructor isn't used anywhere public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, World world) { -@@ -191,7 +239,7 @@ public class ProtoChunk implements IChunkAccess { +@@ -170,7 +237,9 @@ public class ProtoChunk implements IChunkAccess { + } + + public void k(BlockPosition blockposition) { ++ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently + this.l.add(blockposition.immutableCopy()); ++ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently + } + + @Nullable +@@ -185,13 +254,15 @@ public class ProtoChunk implements IChunkAccess { + return iblockdata; + } else { + if (iblockdata.f() > 0) { ++ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently + this.l.add(new BlockPosition((i & 15) + this.getPos().d(), j, (k & 15) + this.getPos().e())); ++ this.checkLightSourceLock(); // Tuinity - make sure we don't access this concurrently + } + ChunkSection chunksection = this.a(j >> 4); IBlockData iblockdata1 = chunksection.setType(i & 15, j & 15, k & 15, iblockdata); diff --git a/patches/Tuinity/patches/server/0075-Replace-player-chunk-loader-system.patch b/patches/Tuinity/patches/server/0075-Replace-player-chunk-loader-system.patch index cb76b882..f8694b9f 100644 --- a/patches/Tuinity/patches/server/0075-Replace-player-chunk-loader-system.patch +++ b/patches/Tuinity/patches/server/0075-Replace-player-chunk-loader-system.patch @@ -1032,7 +1032,7 @@ index 0000000000000000000000000000000000000000..0d577aa1c7868ce89c3902535adcb554 + } +} diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index edb9b246bf327f67a8500f77f81b46eb9e04c9b0..d29b537bbe4f852162b720d6b23b741829af21f9 100644 +index edb9b246bf327f67a8500f77f81b46eb9e04c9b0..e1dc7c1025e19f7393a45719af8fe7aae016184d 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -244,6 +244,25 @@ public final class TuinityConfig { @@ -1049,12 +1049,12 @@ index edb9b246bf327f67a8500f77f81b46eb9e04c9b0..d29b537bbe4f852162b720d6b23b7418 + + private static void newPlayerChunkManagement() { + playerMinChunkLoadRadius = TuinityConfig.getInt("player-chunks.min-load-radius", 2); -+ playerMaxConcurrentChunkSends = TuinityConfig.getDouble("player-chunks.max-concurrent-sends", 15.0); ++ playerMaxConcurrentChunkSends = TuinityConfig.getDouble("player-chunks.max-concurrent-sends", 5.0); + playerMaxConcurrentChunkLoads = TuinityConfig.getDouble("player-chunks.max-concurrent-loads", -6.0); + playerAutoConfigureSendViewDistance = TuinityConfig.getBoolean("player-chunks.autoconfig-send-distance", true); + // this costs server bandwidth. latest phosphor or starlight on the client fixes mc162253 anyways. + enableMC162253Workaround = TuinityConfig.getBoolean("player-chunks.enable-mc162253-workaround", true); -+ playerTargetChunkSendRate = TuinityConfig.getDouble("player-chunks.target-chunk-send-rate", 81.0 * 20.0); ++ playerTargetChunkSendRate = TuinityConfig.getDouble("player-chunks.target-chunk-send-rate", -35.0); + playerFrustumPrioritisation = TuinityConfig.getBoolean("player-chunks.enable-frustum-priority", false); + } + @@ -1661,7 +1661,7 @@ index a802c45538943b570ca0daa3a40607dc80e696eb..af01f5d635eada7175b9d7fdb47a6553 // Paper end - per player view distance } diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java -index d6b34c6abebeac8445da3e76f341066952182e2b..df35ae12ecbe88ab396bed9850ef80433ff42fd4 100644 +index d6b34c6abebeac8445da3e76f341066952182e2b..fc07e2014e961da5d97095c4ee6f972e2ece3ec3 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java @@ -406,12 +406,12 @@ public class Chunk implements IChunkAccess { @@ -1680,7 +1680,7 @@ index d6b34c6abebeac8445da3e76f341066952182e2b..df35ae12ecbe88ab396bed9850ef8043 } }); } -@@ -419,31 +419,7 @@ public class Chunk implements IChunkAccess { +@@ -419,31 +419,18 @@ public class Chunk implements IChunkAccess { // this code handles the chunk sending if (!areNeighboursLoaded(bitsetBefore, 1) && areNeighboursLoaded(bitsetAfter, 1)) { @@ -1709,11 +1709,22 @@ index d6b34c6abebeac8445da3e76f341066952182e2b..df35ae12ecbe88ab396bed9850ef8043 - } - }))); - } -+ chunkMap.playerChunkManager.onChunkSendReady(this.loc.x, this.loc.z); // Tuinity - replace old player chunk loading system ++ // Tuinity start - replace old player chunk loading system ++ chunkProviderServer.serverThreadQueue.execute(() -> { ++ if (!Chunk.this.areNeighboursLoaded(1)) { ++ return; ++ } ++ Chunk.this.A(); ++ if (!Chunk.this.areNeighboursLoaded(1)) { ++ return; ++ } ++ chunkMap.playerChunkManager.onChunkSendReady(this.loc.x, this.loc.z); ++ }); ++ // Tuinity end - replace old player chunk loading system } // Paper end - no-tick view distance } -@@ -1027,6 +1003,7 @@ public class Chunk implements IChunkAccess { +@@ -1027,6 +1014,7 @@ public class Chunk implements IChunkAccess { // Paper end - neighbour cache org.bukkit.Server server = this.world.getServer(); ((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper @@ -1739,10 +1750,10 @@ index 3fe1508b091e1fd0325eae50138d02fa6445c9ff..a19a26a88f247d359354902efeece992 return new Vec3D((double) baseblockposition.getX() + 0.5D, (double) baseblockposition.getY() + 0.5D, (double) baseblockposition.getZ() + 0.5D); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b0801ca77620753ab61dba62429ce76e95aaba8f..91005e112950d79e1120e5595570970b94cd3c67 100644 +index 0128a24f1de7468ff60ba2de0ed825ff62363f6b..09cef73a92679e47c8670e4e4c1ba988878aee24 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2638,14 +2638,14 @@ public class CraftWorld implements World { +@@ -2631,14 +2631,14 @@ public class CraftWorld implements World { throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); } PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; @@ -1759,7 +1770,7 @@ index b0801ca77620753ab61dba62429ce76e95aaba8f..91005e112950d79e1120e5595570970b } @Override -@@ -2654,11 +2654,22 @@ public class CraftWorld implements World { +@@ -2647,11 +2647,22 @@ public class CraftWorld implements World { throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); } PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; diff --git a/patches/Tuinity/patches/server/0080-Stop-large-move-vectors-in-player-packet-handling-fr.patch b/patches/Tuinity/patches/server/0080-Stop-large-move-vectors-in-player-packet-handling-fr.patch index a9439e7d..76ac05a4 100644 --- a/patches/Tuinity/patches/server/0080-Stop-large-move-vectors-in-player-packet-handling-fr.patch +++ b/patches/Tuinity/patches/server/0080-Stop-large-move-vectors-in-player-packet-handling-fr.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Stop large move vectors in player packet handling from Looks like we need to check three vectors, not two. fun. diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java -index 40a7f69e5e14078977ef615abf3a0f1f61d76f9f..83ad913e46f44aabb41b7e441cba2ef2f7bcbc46 100644 +index 878c5342ca524768fbe2874b54bc12574852cefa..80b77cdffd64690bb9066b8745ea0ee08d60a7a4 100644 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java -@@ -540,6 +540,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -542,6 +542,12 @@ public class PlayerConnection implements PacketListenerPlayIn { double currDeltaZ = toZ - fromZ; double d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); // Paper end - fix large move vectors killing the server @@ -23,7 +23,7 @@ index 40a7f69e5e14078977ef615abf3a0f1f61d76f9f..83ad913e46f44aabb41b7e441cba2ef2 // CraftBukkit start - handle custom speeds and skipped ticks -@@ -586,9 +592,9 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -588,9 +594,9 @@ public class PlayerConnection implements PacketListenerPlayIn { //boolean flag = worldserver.getCubes(entity, entity.getBoundingBox().shrink(0.0625D)); // Tuinity - replace with different checks AxisAlignedBB oldBox = entity.getBoundingBox(); // Tuinity - copy from player movement packet @@ -36,7 +36,7 @@ index 40a7f69e5e14078977ef615abf3a0f1f61d76f9f..83ad913e46f44aabb41b7e441cba2ef2 entity.move(EnumMoveType.PLAYER, new Vec3D(d6, d7, d8)); boolean didCollide = toX != entity.locX() || toY != entity.locY() || toZ != entity.locZ(); // Tuinity - needed here as the difference in Y can be reset - also note: this is only a guess at whether collisions took place, floating point errors can make this true when it shouldn't be... double d11 = d7; -@@ -1293,6 +1299,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1295,6 +1301,12 @@ public class PlayerConnection implements PacketListenerPlayIn { double currDeltaZ = toZ - prevZ; double d11 = Math.max(d7 * d7 + d8 * d8 + d9 * d9, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); // Paper end - fix large move vectors killing the server @@ -49,7 +49,7 @@ index 40a7f69e5e14078977ef615abf3a0f1f61d76f9f..83ad913e46f44aabb41b7e441cba2ef2 if (this.player.isSleeping()) { if (d11 > 1.0D) { -@@ -1344,9 +1356,9 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1346,9 +1358,9 @@ public class PlayerConnection implements PacketListenerPlayIn { AxisAlignedBB axisalignedbb = this.player.getBoundingBox(); // Tuinity - diff on change, should be old AABB diff --git a/patches/Tuinity/patches/server/0082-Do-not-schedule-poi-task-for-each-block-write-on-chu.patch b/patches/Tuinity/patches/server/0082-Do-not-schedule-poi-task-for-each-block-write-on-chu.patch new file mode 100644 index 00000000..9e9bfa36 --- /dev/null +++ b/patches/Tuinity/patches/server/0082-Do-not-schedule-poi-task-for-each-block-write-on-chu.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Tue, 20 Apr 2021 18:04:54 -0700 +Subject: [PATCH] Do not schedule poi task for each block write on chunk gen + +Most of the time optional == optional1, so we shouldn't +schedule a task for each write. + +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index fcf9af44702f34d75185eee0b3259fe0e57001b1..e3481eb71972c82edd892a99d1136c8248fb0f8c 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -2707,14 +2707,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { + Optional optional1 = VillagePlaceType.b(iblockdata1); + + // Paper start +- BlockPosition blockposition1 = blockposition.immutableCopy(); +- this.getMinecraftServer().execute(() -> { +- if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) { +- this.getPoiStorage().remove(blockposition1); +- } +- }); ++ // Tuinity - oh god not for each block set + if (!Objects.equals(optional, optional1)) { +- //BlockPosition blockposition1 = blockposition.immutableCopy(); ++ BlockPosition blockposition1 = blockposition.immutableCopy(); // Tuinity - oh god not for each block set + // Paper end + + optional.ifPresent((villageplacetype) -> { +@@ -2725,6 +2720,11 @@ public class WorldServer extends World implements GeneratorAccessSeed { + }); + optional1.ifPresent((villageplacetype) -> { + this.getMinecraftServer().execute(() -> { ++ // Tuinity start - remove POIs before inserting, better version of paper's diff ++ if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) { ++ this.getPoiStorage().remove(blockposition1); ++ } ++ // Tuinity end - remove POIs before inserting, better version of paper's diff + this.y().a(blockposition1, villageplacetype); + PacketDebug.a(this, blockposition1); + }); diff --git a/patches/Tuinity/patches/server/0083-Do-not-copy-visible-chunks.patch b/patches/Tuinity/patches/server/0083-Do-not-copy-visible-chunks.patch new file mode 100644 index 00000000..ce2504e8 --- /dev/null +++ b/patches/Tuinity/patches/server/0083-Do-not-copy-visible-chunks.patch @@ -0,0 +1,210 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Sun, 21 Mar 2021 11:22:10 -0700 +Subject: [PATCH] Do not copy visible chunks + +For servers with a lot of chunk holders, copying for each +tickDistanceManager call can take up quite a bit in +the function. I saw approximately 1/3rd of the function +on the copy. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java +index 848eb25ed0640db61a0f28bc26ddabd0444e9ed4..ec2b9995f1bf0f6cf029df7bfac526c2672acf3a 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java ++++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +@@ -407,7 +407,7 @@ public class PaperCommand extends Command { + int ticking = 0; + int entityTicking = 0; + +- for (PlayerChunk chunk : world.getChunkProvider().playerChunkMap.updatingChunks.values()) { ++ for (PlayerChunk chunk : world.getChunkProvider().playerChunkMap.updatingChunks.getUpdatingMap().values()) { // Tuinity - change updating chunks map + if (chunk.getFullChunkIfCached() == null) { + continue; + } +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..b28995ecfd7f45e6b6197be96c418aa0d05d3383 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -116,8 +116,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + private static final Logger LOGGER = LogManager.getLogger(); + public static final int GOLDEN_TICKET = 33 + ChunkStatus.b(); + // Paper start - faster copying +- public final Long2ObjectLinkedOpenHashMap updatingChunks = new com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy<>(); // Paper - faster copying +- public final Long2ObjectLinkedOpenHashMap visibleChunks = new ProtectedVisibleChunksMap(); // Paper - faster copying ++ // Tuinity start - Don't copy ++ public final com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object updatingChunks = new com.destroystokyo.paper.util.map.QueuedChangesMapLong2Object<>(); ++ // Tuinity end - Don't copy + + private class ProtectedVisibleChunksMap extends com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy { + @Override +@@ -140,8 +141,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + } + // Paper end +- public final com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy pendingVisibleChunks = new com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy(); // Paper - this is used if the visible chunks is updated while iterating only +- public transient com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy visibleChunksClone; // Paper - used for async access of visible chunks, clone and cache only when needed ++ // Tuinity - Don't copy + private final Long2ObjectLinkedOpenHashMap pendingUnload; + public final LongSet loadedChunks; // Paper - private -> public + public final WorldServer world; +@@ -735,7 +735,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + + @Nullable + public PlayerChunk getUpdatingChunk(long i) { // Paper +- return (PlayerChunk) this.updatingChunks.get(i); ++ return this.updatingChunks.getUpdating(i); // Tuinity - Don't copy + } + + // Paper start - remove cloning of visible chunks unless accessed as a collection async +@@ -743,47 +743,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + private boolean isIterating = false; + private boolean hasPendingVisibleUpdate = false; + public void forEachVisibleChunk(java.util.function.Consumer consumer) { +- org.spigotmc.AsyncCatcher.catchOp("forEachVisibleChunk"); +- boolean prev = isIterating; +- isIterating = true; +- try { +- for (PlayerChunk value : this.visibleChunks.values()) { +- consumer.accept(value); +- } +- } finally { +- this.isIterating = prev; +- if (!this.isIterating && this.hasPendingVisibleUpdate) { +- ((ProtectedVisibleChunksMap)this.visibleChunks).copyFrom(this.pendingVisibleChunks); +- this.pendingVisibleChunks.clear(); +- this.hasPendingVisibleUpdate = false; +- } +- } ++ throw new UnsupportedOperationException(); // Tuinity - Don't copy + } + public Long2ObjectLinkedOpenHashMap getVisibleChunks() { +- if (Thread.currentThread() == this.world.serverThread) { +- return this.visibleChunks; +- } else { +- synchronized (this.visibleChunks) { +- if (DEBUG_ASYNC_VISIBLE_CHUNKS) new Throwable("Async getVisibleChunks").printStackTrace(); +- if (this.visibleChunksClone == null) { +- this.visibleChunksClone = this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.clone() : ((ProtectedVisibleChunksMap)this.visibleChunks).clone(); +- } +- return this.visibleChunksClone; +- } ++ // Tuinity start - Don't copy (except in rare cases) ++ synchronized (this.updatingChunks) { ++ return this.updatingChunks.getVisibleMap().clone(); + } ++ // Tuinity end - Don't copy (except in rare cases) + } + // Paper end + + @Nullable + public PlayerChunk getVisibleChunk(long i) { // Paper - protected -> public +- // Paper start - mt safe get +- if (Thread.currentThread() != this.world.serverThread) { +- synchronized (this.visibleChunks) { +- return (PlayerChunk) (this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i)); +- } ++ // Tuinity start - Don't copy ++ if (Thread.currentThread() == this.world.serverThread) { ++ return this.updatingChunks.getVisible(i); + } +- return (PlayerChunk) (this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i)); +- // Paper end ++ return this.updatingChunks.getVisibleAsync(i); ++ // Tuinity end - Don't copy + } + + protected final IntSupplier getPrioritySupplier(long i) { return c(i); } // Paper - OBFHELPER +@@ -911,7 +889,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + this.getVillagePlace().dequeueUnload(playerchunk.location.pair()); // Tuinity - unload POI data + +- this.updatingChunks.put(i, playerchunk); ++ this.updatingChunks.queueUpdate(i, playerchunk); // Tuinity - Don't copy + this.updatingChunksModified = true; + } + +@@ -1064,7 +1042,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + while (longiterator.hasNext()) { // Spigot + long j = longiterator.nextLong(); + longiterator.remove(); // Spigot +- PlayerChunk playerchunk = (PlayerChunk) this.updatingChunks.remove(j); ++ PlayerChunk playerchunk = this.updatingChunks.queueRemove(j); // Tuinity - Don't copy + + if (playerchunk != null) { + this.pendingUnload.put(j, playerchunk); +@@ -1218,19 +1196,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + if (!this.updatingChunksModified) { + return false; + } else { +- // Paper start - stop cloning visibleChunks +- synchronized (this.visibleChunks) { +- if (isIterating) { +- hasPendingVisibleUpdate = true; +- this.pendingVisibleChunks.copyFrom((com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy)this.updatingChunks); +- } else { +- hasPendingVisibleUpdate = false; +- this.pendingVisibleChunks.clear(); +- ((ProtectedVisibleChunksMap)this.visibleChunks).copyFrom((com.destroystokyo.paper.util.map.Long2ObjectLinkedOpenHashMapFastCopy)this.updatingChunks); +- this.visibleChunksClone = null; +- } ++ // Tuinity start - Don't copy ++ synchronized (this.updatingChunks) { ++ this.updatingChunks.performUpdates(); + } +- // Paper end ++ // Tuinity end - Don't copy + + this.updatingChunksModified = false; + return true; +@@ -1701,7 +1671,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } + + public int d() { +- return this.visibleChunks.size(); ++ return this.updatingChunks.getVisibleMap().size(); // Tuinity - Don't copy + } + + protected PlayerChunkMap.a e() { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 09cef73a92679e47c8670e4e4c1ba988878aee24..f7b17db87e351e8218d7865c3f9a0162892ca269 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -298,7 +298,7 @@ public class CraftWorld implements World { + public int getTileEntityCount() { + return net.minecraft.server.MCUtil.ensureMain(() -> { + // We don't use the full world tile entity list, so we must iterate chunks +- Long2ObjectLinkedOpenHashMap chunks = world.getChunkProvider().playerChunkMap.visibleChunks; ++ Long2ObjectLinkedOpenHashMap chunks = world.getChunkProvider().playerChunkMap.updatingChunks.getVisibleMap(); // Tuinity - change updating chunks map + int size = 0; + for (PlayerChunk playerchunk : chunks.values()) { + net.minecraft.world.level.chunk.Chunk chunk = playerchunk.getChunk(); +@@ -317,7 +317,7 @@ public class CraftWorld implements World { + return net.minecraft.server.MCUtil.ensureMain(() -> { + int ret = 0; + +- for (PlayerChunk chunkHolder : world.getChunkProvider().playerChunkMap.visibleChunks.values()) { ++ for (PlayerChunk chunkHolder : world.getChunkProvider().playerChunkMap.updatingChunks.getVisibleMap().values()) { // Tuinity - change updating chunks map + if (chunkHolder.getChunk() != null) { + ++ret; + } +@@ -471,13 +471,16 @@ public class CraftWorld implements World { + public Chunk[] getLoadedChunks() { + // Paper start + if (Thread.currentThread() != world.getMinecraftWorld().serverThread) { +- synchronized (world.getChunkProvider().playerChunkMap.visibleChunks) { +- Long2ObjectLinkedOpenHashMap chunks = world.getChunkProvider().playerChunkMap.visibleChunks; +- return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.Chunk::getBukkitChunk).toArray(Chunk[]::new); ++ // Tuinity start - change updating chunks map ++ Long2ObjectLinkedOpenHashMap chunks; ++ synchronized (world.getChunkProvider().playerChunkMap.updatingChunks) { ++ chunks = world.getChunkProvider().playerChunkMap.updatingChunks.getVisibleMap().clone(); + } ++ return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.Chunk::getBukkitChunk).toArray(Chunk[]::new); ++ // Tuinity end - change updating chunks map + } + // Paper end +- Long2ObjectLinkedOpenHashMap chunks = world.getChunkProvider().playerChunkMap.visibleChunks; ++ Long2ObjectLinkedOpenHashMap chunks = world.getChunkProvider().playerChunkMap.updatingChunks.getVisibleMap(); // Tuinity - change updating chunks map + return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.Chunk::getBukkitChunk).toArray(Chunk[]::new); + } + diff --git a/patches/Tuinity/patches/server/0084-Correctly-handle-recursion-for-chunkholder-updates.patch b/patches/Tuinity/patches/server/0084-Correctly-handle-recursion-for-chunkholder-updates.patch new file mode 100644 index 00000000..b5dd6ebb --- /dev/null +++ b/patches/Tuinity/patches/server/0084-Correctly-handle-recursion-for-chunkholder-updates.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Sun, 21 Mar 2021 17:32:47 -0700 +Subject: [PATCH] Correctly handle recursion for chunkholder updates + +If a chunk ticket level is brought up while unloading it would +cause a recursive call which would handle the increase but then +the caller would think the chunk would be unloaded. + +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index d9b134302f739efd93f50e93c8730b474f9a8ccf..63c2f6d3312d9005ef2f821456e3946f3a9a0c3b 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -599,8 +599,10 @@ public class PlayerChunk { + this.ticketLevel = i; + } + ++ protected long updateCount; // Tuinity - correctly handle recursion + protected void a(PlayerChunkMap playerchunkmap) { + com.tuinity.tuinity.util.TickThread.ensureTickThread("Async ticket level update"); // Tuinity ++ long updateCount = ++this.updateCount; // Tuinity - correctly handle recursion + ChunkStatus chunkstatus = getChunkStatus(this.oldTicketLevel); + ChunkStatus chunkstatus1 = getChunkStatus(this.ticketLevel); + boolean flag = this.oldTicketLevel <= PlayerChunkMap.GOLDEN_TICKET; +@@ -630,6 +632,12 @@ public class PlayerChunk { + + // Run callback right away if the future was already done + playerchunkmap.callbackExecutor.run(); ++ // Tuinity start - correctly handle recursion ++ if (this.updateCount != updateCount) { ++ // something else updated ticket level for us. ++ return; ++ } ++ // Tuinity end - correctly handle recursion + } + // CraftBukkit end + CompletableFuture completablefuture; diff --git a/patches/Tuinity/patches/server/0085-Replace-ticket-level-propagator.patch b/patches/Tuinity/patches/server/0085-Replace-ticket-level-propagator.patch new file mode 100644 index 00000000..ba20d847 --- /dev/null +++ b/patches/Tuinity/patches/server/0085-Replace-ticket-level-propagator.patch @@ -0,0 +1,284 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Sun, 21 Mar 2021 16:25:42 -0700 +Subject: [PATCH] Replace ticket level propagator + +Mojang's propagator is slow, and this isn't surprising +given it's built on the same utilities the vanilla light engine +is built on. The simple propagator I wrote is approximately 4x +faster when simulating player movement. For a long time timing +reports have shown this function take up significant tick, ( +approx 10% or more), and async sampling data shows the level +propagation alone takes up a significant amount. So this +should help with that. A big side effect is that mid-tick +will be more effective, since more time will be allocated +to actually processing chunk tasks vs the ticket level updates. + +diff --git a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +index ad90735b5daa658cdd5467eadcb29183d018b1fd..a5fc023312c99e591fc269999c28a766a46f8849 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +@@ -8,6 +8,7 @@ import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap; + import it.unimi.dsi.fastutil.longs.Long2IntMap; + import it.unimi.dsi.fastutil.longs.Long2IntMaps; + import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; ++import it.unimi.dsi.fastutil.longs.Long2IntLinkedOpenHashMap; // Tuinity + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +@@ -40,7 +41,7 @@ public abstract class ChunkMapDistance { + private static final int b = 33 + ChunkStatus.a(ChunkStatus.FULL) - 2; + private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); + public final Long2ObjectOpenHashMap>> tickets = new Long2ObjectOpenHashMap(); +- private final ChunkMapDistance.a ticketLevelTracker = new ChunkMapDistance.a(); final ChunkMapDistance.a getTicketTracker() { return this.ticketLevelTracker; } // Tuinity - OBFHELPER ++ //private final ChunkMapDistance.a ticketLevelTracker = new ChunkMapDistance.a(); final ChunkMapDistance.a getTicketTracker() { return this.ticketLevelTracker; } // Tuinity - OBFHELPER // Tuinity - replace ticket level propagator + public static final int MOB_SPAWN_RANGE = 8; // private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); // Paper - no longer used + //private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); // Tuinity - no longer used + // Paper start use a queue, but still keep unique requirement +@@ -77,7 +78,7 @@ public abstract class ChunkMapDistance { + return ticket.getTicketType() == type; + }); + if (changed) { +- this.getTicketTracker().update(chunk, getLowestTicketLevel(tickets), false); ++ this.updateTicketLevel(chunk, getLowestTicketLevel(tickets)); // Tuinity - replace ticket level propagator + } + } + +@@ -102,6 +103,45 @@ public abstract class ChunkMapDistance { + tickets.add(ticket); // re-add with new expire time and ticket level + } + // Tuinity end - delay chunk unloads ++ // Tuinity start - replace ticket level propagator ++ protected final Long2IntLinkedOpenHashMap ticketLevelUpdates = new Long2IntLinkedOpenHashMap() { ++ @Override ++ protected void rehash(int newN) { ++ // no downsizing allowed ++ if (newN < this.n) { ++ return; ++ } ++ super.rehash(newN); ++ } ++ }; ++ protected final com.tuinity.tuinity.util.misc.Delayed8WayDistancePropagator2D ticketLevelPropagator = new com.tuinity.tuinity.util.misc.Delayed8WayDistancePropagator2D( ++ (long coordinate, byte oldLevel, byte newLevel) -> { ++ ChunkMapDistance.this.ticketLevelUpdates.putAndMoveToLast(coordinate, convertBetweenTicketLevels(newLevel)); ++ } ++ ); ++ // function for converting between ticket levels and propagator levels and vice versa ++ // the problem is the ticket level propagator will propagate from a set source down to zero, whereas mojang expects ++ // levels to propagate from a set value up to a maximum value. so we need to convert the levels we put into the propagator ++ // and the levels we get out of the propagator ++ ++ // this maps so that GOLDEN_TICKET + 1 will be 0 in the propagator, GOLDEN_TICKET will be 1, and so on ++ // we need GOLDEN_TICKET+1 as 0 because anything >= GOLDEN_TICKET+1 should be unloaded ++ public static int convertBetweenTicketLevels(final int level) { ++ return PlayerChunkMap.GOLDEN_TICKET - level + 1; ++ } ++ ++ protected final int getPropagatedTicketLevel(final long coordinate) { ++ return convertBetweenTicketLevels(this.ticketLevelPropagator.getLevel(coordinate)); ++ } ++ ++ protected final void updateTicketLevel(final long coordinate, final int ticketLevel) { ++ if (ticketLevel > PlayerChunkMap.GOLDEN_TICKET) { ++ this.ticketLevelPropagator.removeSource(coordinate); ++ } else { ++ this.ticketLevelPropagator.setSource(coordinate, convertBetweenTicketLevels(ticketLevel)); ++ } ++ } ++ // Tuinity end - replace ticket level propagator + + protected ChunkMapDistance(Executor executor, Executor executor1) { + executor1.getClass(); +@@ -146,7 +186,7 @@ public abstract class ChunkMapDistance { + this.computeDelayedTicketFor(entry.getLongKey(), tempLevel[0], entry.getValue()); + } + // Tuinity end - delay chunk unloads +- this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel((ArraySetSorted) entry.getValue()), false); ++ this.updateTicketLevel(entry.getLongKey(), getLowestTicketLevel((ArraySetSorted) entry.getValue())); // Tuinity - replace ticket level propagator + } + + if (((ArraySetSorted) entry.getValue()).isEmpty()) { +@@ -166,66 +206,99 @@ public abstract class ChunkMapDistance { + protected abstract boolean a(long i); + + @Nullable +- protected abstract PlayerChunk b(long i); ++ protected abstract PlayerChunk b(long i); protected final PlayerChunk getUpdatingChunk(long i) { return this.b(i); } // Tuinity - OBFHELPER + + @Nullable +- protected abstract PlayerChunk a(long i, int j, @Nullable PlayerChunk playerchunk, int k); ++ protected abstract PlayerChunk a(long i, int j, @Nullable PlayerChunk playerchunk, int k); protected final PlayerChunk updateTicketLevel(long coord, int newLevel, @Nullable PlayerChunk playerchunk, int oldLevel) { return this.a(coord, newLevel, playerchunk, oldLevel); } // Tuinity - OBFHELPER + ++ protected long ticketLevelUpdateCount; // Tuinity - replace ticket level propagator + public boolean a(PlayerChunkMap playerchunkmap) { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot tick ChunkMapDistance off of the main-thread");// Tuinity + //this.f.a(); // Paper - no longer used + AsyncCatcher.catchOp("DistanceManagerTick"); // Paper + //this.g.a(); // Tuinity - no longer used +- int i = Integer.MAX_VALUE - this.ticketLevelTracker.a(Integer.MAX_VALUE); +- boolean flag = i != 0; ++ boolean flag = this.ticketLevelPropagator.propagateUpdates(); // Tuinity - replace ticket level propagator + + if (flag) { + ; + } + +- // Paper start +- if (!this.pendingChunkUpdates.isEmpty()) { +- this.pollingPendingChunkUpdates = true; try { +- while(!this.pendingChunkUpdates.isEmpty()) { +- PlayerChunk remove = this.pendingChunkUpdates.remove(); +- remove.isUpdateQueued = false; +- remove.a(playerchunkmap); +- } +- } finally { this.pollingPendingChunkUpdates = false; } +- // Paper end +- return true; +- } else { +- if (!this.l.isEmpty()) { +- LongIterator longiterator = this.l.iterator(); ++ // Tuinity start - replace level propagator ++ if (!this.ticketLevelUpdates.isEmpty()) { ++ boolean oldPolling = this.pollingPendingChunkUpdates; ++ this.pollingPendingChunkUpdates = true; ++ try { ++ for (java.util.Iterator iterator = this.ticketLevelUpdates.long2IntEntrySet().fastIterator(); iterator.hasNext(); ) { ++ Long2IntMap.Entry entry = iterator.next(); ++ long key = entry.getLongKey(); ++ int newLevel = entry.getIntValue(); ++ PlayerChunk chunk = this.getUpdatingChunk(key); + +- while (longiterator.hasNext()) { +- long j = longiterator.nextLong(); ++ if (chunk == null && newLevel > PlayerChunkMap.GOLDEN_TICKET) { ++ // not loaded and it shouldn't be loaded! ++ continue; ++ } + +- if (this.e(j).stream().anyMatch((ticket) -> { +- return ticket.getTicketType() == TicketType.PLAYER; +- })) { +- PlayerChunk playerchunk = playerchunkmap.getUpdatingChunk(j); ++ int currentLevel = chunk == null ? PlayerChunkMap.GOLDEN_TICKET + 1 : chunk.getTicketLevel(); + +- if (playerchunk == null) { +- throw new IllegalStateException(); ++ if (currentLevel == newLevel) { ++ // nothing to do ++ continue; ++ } ++ ++ this.updateTicketLevel(key, newLevel, chunk, currentLevel); ++ } ++ ++ long recursiveCheck = ++this.ticketLevelUpdateCount; ++ while (!this.ticketLevelUpdates.isEmpty()) { ++ long key = this.ticketLevelUpdates.firstLongKey(); ++ int newLevel = this.ticketLevelUpdates.removeFirstInt(); ++ PlayerChunk chunk = this.getUpdatingChunk(key); ++ ++ if (chunk == null) { ++ if (newLevel <= PlayerChunkMap.GOLDEN_TICKET) { ++ throw new IllegalStateException("Expected chunk holder to be created"); + } ++ // not loaded and it shouldn't be loaded! ++ continue; ++ } + +- CompletableFuture> completablefuture = playerchunk.b(); ++ int currentLevel = chunk.oldTicketLevel; + +- completablefuture.thenAccept((either) -> { +- this.m.execute(() -> { +- this.k.a(ChunkTaskQueueSorter.a(() -> { +- }, j, false)); +- }); +- }); ++ if (currentLevel == newLevel) { ++ // nothing to do ++ continue; ++ } ++ ++ chunk.handleLevelUpdate(playerchunkmap); ++ if (recursiveCheck != this.ticketLevelUpdateCount) { ++ if (!this.ticketLevelUpdates.isEmpty()) { ++ throw new IllegalStateException("Recursive call should have processed updates"); ++ } ++ break; + } + } + +- this.l.clear(); ++ for (;;) { ++ if (recursiveCheck != this.ticketLevelUpdateCount) { ++ break; ++ } ++ PlayerChunk pendingUpdate = this.pendingChunkUpdates.poll(); ++ if (pendingUpdate == null) { ++ break; ++ } ++ ++ pendingUpdate.handleLevelUpdate(playerchunkmap); ++ } ++ } finally { ++ this.pollingPendingChunkUpdates = oldPolling; + } + +- return flag; ++ return true; + } ++ ++ return flag; ++ // Tuinity end - replace level propagator + } + boolean pollingPendingChunkUpdates = false; // Paper + +@@ -237,7 +310,7 @@ public abstract class ChunkMapDistance { + + ticket1.a(this.currentTick); + if (ticket.b() < j) { +- this.ticketLevelTracker.update(i, ticket.b(), true); ++ this.updateTicketLevel(i, ticket.b()); // Tuinity - replace ticket level propagator + } + + return ticket == ticket1; // CraftBukkit +@@ -263,7 +336,7 @@ public abstract class ChunkMapDistance { + } + + int newLevel = getLowestTicketLevel(arraysetsorted); // Paper +- if (newLevel > oldLevel) this.ticketLevelTracker.update(i, newLevel, false); // Paper ++ if (newLevel > oldLevel) this.updateTicketLevel(i, newLevel); // Paper // Tuinity - replace ticket level propagator + return removed; // CraftBukkit + } + +@@ -517,7 +590,7 @@ public abstract class ChunkMapDistance { + ArraySetSorted> tickets = entry.getValue(); + if (tickets.remove(target)) { + // copied from removeTicket +- this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel(tickets), false); ++ this.updateTicketLevel(entry.getLongKey(), getLowestTicketLevel(tickets)); // Tuinity - replace ticket level propagator + + // can't use entry after it's removed + if (tickets.isEmpty()) { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index 63c2f6d3312d9005ef2f821456e3946f3a9a0c3b..86f156587a0939b28c5cf6f64907255c1c4f8b35 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -55,7 +55,7 @@ public class PlayerChunk { + private volatile CompletableFuture> entityTickingFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage + private CompletableFuture chunkSave; + public int oldTicketLevel; +- private int ticketLevel; ++ private int ticketLevel; public final void setTicketLevel(final int level) { this.ticketLevel = level; } // Tuinity - OBFHELPER + volatile int n; public final int getCurrentPriority() { return n; } // Paper - OBFHELPER - make volatile since this is concurrently accessed + public final ChunkCoordIntPair location; // Paper - private -> public + private boolean p; +@@ -600,6 +600,7 @@ public class PlayerChunk { + } + + protected long updateCount; // Tuinity - correctly handle recursion ++ protected final void handleLevelUpdate(PlayerChunkMap playerchunkmap) { this.a(playerchunkmap); } // Tuinity - OBFHELPER + protected void a(PlayerChunkMap playerchunkmap) { + com.tuinity.tuinity.util.TickThread.ensureTickThread("Async ticket level update"); // Tuinity + long updateCount = ++this.updateCount; // Tuinity - correctly handle recursion diff --git a/patches/server/0001-Modify-POM.patch b/patches/server/0001-Modify-POM.patch index 27b70b95..ada8f241 100644 --- a/patches/server/0001-Modify-POM.patch +++ b/patches/server/0001-Modify-POM.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM diff --git a/pom.xml b/pom.xml -index cea712b94bb32ccda2895670859839d660bd0748..8f864ce333418e6eb617dd55a9e9f73887f981a6 100644 +index 6fe8dad8df109531f2b38fbfcb58b6807dbb8cf0..48c53278ab9a02c614219e87fbe0a52f2c322e96 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ @@ -106,15 +106,7 @@ index cea712b94bb32ccda2895670859839d660bd0748..8f864ce333418e6eb617dd55a9e9f738 -@@ -190,27 +205,37 @@ - jitpack.io - https://jitpack.io - -- -- -- - - +@@ -190,19 +205,32 @@ purpur-snapshots https://repo.pl3x.net/ diff --git a/patches/server/0002-Brandings.patch b/patches/server/0002-Brandings.patch index b587385e..51b2b459 100644 --- a/patches/server/0002-Brandings.patch +++ b/patches/server/0002-Brandings.patch @@ -27,18 +27,18 @@ index 4d8740678049aa749b42618470e9cc838555528d..159f72efe20f8fee940bd00ae7af00f0 metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 4d9e685c691a37078ff7452e50ab8c13999dbe10..0751ce5b578eff8b1dad44e976b656b6cfa7daf3 100644 +index e56ebeaaa12494817d31099eed54ef2c50b98b9e..eb0509386feb156ae9c8ca0eb25c0120c9332b19 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { +@@ -19,7 +19,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @Override protected LineReader buildReader(LineReaderBuilder builder) { - return super.buildReader(builder + builder - .appName("Purpur") // Purpur + .appName("Yatopia") // Yatopia .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) - ); + .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java index 6355f246809982f6da34671be22066a83cfba42c..9a9e2692cc058ed3bcafd0cee37c4c9012e4a983 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java diff --git a/patches/server/0003-Utilities.patch b/patches/server/0003-Utilities.patch index 557ae411..823dbf43 100644 --- a/patches/server/0003-Utilities.patch +++ b/patches/server/0003-Utilities.patch @@ -9,7 +9,7 @@ Co-authored-by: Mykyta Komarnytskyy Co-authored-by: Ivan Pekov diff --git a/pom.xml b/pom.xml -index 8f864ce333418e6eb617dd55a9e9f73887f981a6..eb1c3ea442ca73317b18179ad7de3ce16a60d3d5 100644 +index 48c53278ab9a02c614219e87fbe0a52f2c322e96..3a05118d764a6a934b4f834c3080e4ed20c227e9 100644 --- a/pom.xml +++ b/pom.xml @@ -197,6 +197,12 @@ diff --git a/patches/server/0005-Add-last-tick-time-API.patch b/patches/server/0005-Add-last-tick-time-API.patch index e19ed8a7..848897e6 100644 --- a/patches/server/0005-Add-last-tick-time-API.patch +++ b/patches/server/0005-Add-last-tick-time-API.patch @@ -7,10 +7,10 @@ Original patch by: Co-authored-by: tr7zw diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f31b49381d1a70f66406dc6d048f84b45257c860..78d462ca99da4f8d3bab94b081e8cd88699389cb 100644 +index 7fa91a3cb0d48396d106a4a729533f95e91562c0..0ca3e2d7366ee295d369e87b7ce2edd84df68ab5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1054,6 +1054,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrantnet/minecraft/server/v${minecraft_version}/$2 true diff --git a/patches/server/0010-Modify-default-configs.patch b/patches/server/0010-Modify-default-configs.patch index 9a3b3e26..1cb7fea3 100644 --- a/patches/server/0010-Modify-default-configs.patch +++ b/patches/server/0010-Modify-default-configs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify default configs diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 4b9fdb4f04b333ce32f7fca8f279bf989e6fd728..992eb7b286becc03549136d031b677dbd6877c17 100644 +index a0ed8ed1d6b89a4f10dff645e09eaff303fb3f8a..3115c6b308c1371f065dcbb60d9443f439e24560 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -206,7 +206,7 @@ public class PaperConfig { diff --git a/patches/server/0013-lithium-enum_values.patch b/patches/server/0013-lithium-enum_values.patch index eebf05a6..7372f2b8 100644 --- a/patches/server/0013-lithium-enum_values.patch +++ b/patches/server/0013-lithium-enum_values.patch @@ -65,7 +65,7 @@ index 8078e4f5b79eaada03508265ba6b81db636e822a..b2d26289a6f501b093ec229394f75864 }; diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index d24daa68e7acdc76c35e41d6d6dc64399f1e25f2..5096afa6c11810decc4b4bd73867c48594b932b2 100644 +index 1e326c5506dcd1dc4c5e5252a901c61485105eb3..cb4d336e0812ad44d0a936f875853440c556f8b7 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -2736,10 +2736,12 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/server/0014-lithium-MixinGoalSelector.patch b/patches/server/0014-lithium-MixinGoalSelector.patch index 9e7a68e1..f63cccc9 100644 --- a/patches/server/0014-lithium-MixinGoalSelector.patch +++ b/patches/server/0014-lithium-MixinGoalSelector.patch @@ -9,7 +9,7 @@ Original code by JellySquid, licensed under GNU Lesser General Public License v3 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java -index f303c5d6b2e55fc9fd8b49ec21121805e7351034..0e76758fb85870d0030e7a06a384f6411080dd01 100644 +index 02e8288473138dcea008d6157318758e8d7ee3be..10611b8c72b0c0c3202e9ae5b956974ec1a37aa3 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java @@ -12,6 +12,7 @@ import java.util.stream.Stream; diff --git a/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch b/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch index 3ab25fd6..9c271bd2 100644 --- a/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch +++ b/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize some stuff in WorldServer ticking Replaced some streams and some array lists with glue lists diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index 80b08904143b7656aa125a396bbd2866370c8906..e6b9becb87130ee76ccdd087e3c8dee7b18898e4 100644 +index 1b15216d6a03c1031d2bbea2e0243a0de9a9199f..66b5fdd78aa8d394795550aec1203a4de9e4143d 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -1007,12 +1007,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { diff --git a/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch b/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch index 2fe93618..46c5fc8e 100644 --- a/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch +++ b/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix LightEngineThreaded memory leak diff --git a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java -index 4d651cc21a9cb2fdeabff62d8978c3ec4abe2f68..470a45d2a59abf9223166bfe5376c3fb3f5d212c 100644 +index ad584ba21c6e201b778f32cea6d7cc5bf67f9746..229bc64e65696319a83a0f7a7ba6f75752de44cd 100644 --- a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java +++ b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java @@ -123,6 +123,8 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @@ -18,7 +18,7 @@ index 4d651cc21a9cb2fdeabff62d8978c3ec4abe2f68..470a45d2a59abf9223166bfe5376c3fb return this.size == 0 && this.pendingTasks.isEmpty(); } diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index e6b9becb87130ee76ccdd087e3c8dee7b18898e4..7cedb4aaf4a002945866a0ca56eb9b0e7ae28de6 100644 +index 66b5fdd78aa8d394795550aec1203a4de9e4143d..8e978b74e3f5573123fa831bc1e64c38c4cbd2e6 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -2055,6 +2055,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { diff --git a/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch b/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch index c40db683..9d7fa2a9 100644 --- a/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch +++ b/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch @@ -10,10 +10,10 @@ added. These changes aim to reduce that load whenever you are using the /whitelist command. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 78d462ca99da4f8d3bab94b081e8cd88699389cb..df1d8aa345518101320a4ec0636c34ebb872ff98 100644 +index 0ca3e2d7366ee295d369e87b7ce2edd84df68ab5..a317cd679a840d8e5c5a6f08ad760c53ebaf3edf 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2107,6 +2107,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ada7639c31fe6952f689bc2e437db57abe1b1037..0f7fec04ac5c46dec5947be337499f4f93df39f0 100644 +index 95922cdce7483f215aa139f280e20a8858955879..2309e55be7d120dc5b97a985ded4ea4178e7d1ac 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -941,7 +941,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0) { BlockPosition blockposition1 = blockposition.down(); @@ -351,7 +351,7 @@ index 5096afa6c11810decc4b4bd73867c48594b932b2..c1d4dd2ba75115b1f53c4ce6a3b49bd8 if (iblockdata.getMaterial().isSolid()) { flag2 = true; -@@ -3644,7 +3647,7 @@ public abstract class EntityLiving extends Entity { +@@ -3645,7 +3648,7 @@ public abstract class EntityLiving extends Entity { this.stopRiding(); } @@ -360,7 +360,7 @@ index 5096afa6c11810decc4b4bd73867c48594b932b2..c1d4dd2ba75115b1f53c4ce6a3b49bd8 if (iblockdata.getBlock() instanceof BlockBed) { this.world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockBed.OCCUPIED, true), 3); -@@ -3663,7 +3666,7 @@ public abstract class EntityLiving extends Entity { +@@ -3664,7 +3667,7 @@ public abstract class EntityLiving extends Entity { private boolean x() { return (Boolean) this.getBedPosition().map((blockposition) -> { @@ -369,7 +369,7 @@ index 5096afa6c11810decc4b4bd73867c48594b932b2..c1d4dd2ba75115b1f53c4ce6a3b49bd8 }).orElse(false); } -@@ -3673,7 +3676,7 @@ public abstract class EntityLiving extends Entity { +@@ -3674,7 +3677,7 @@ public abstract class EntityLiving extends Entity { this.world.getClass(); optional.filter(world::isLoaded).ifPresent((blockposition) -> { diff --git a/patches/server/0065-lithium-AI.patch b/patches/server/0065-lithium-AI.patch index acfc5ff7..812ed1d1 100644 --- a/patches/server/0065-lithium-AI.patch +++ b/patches/server/0065-lithium-AI.patch @@ -865,7 +865,7 @@ index a206a729b3afa01bf591fa4da1e5c14902da4778..716f91246c4a45fd49af806afd1781f1 return (int) (i << 22 >> 42); } diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java -index e054e98e413ed02b76e63b29c52bd70a559ad15d..9ae4377bb9277ca15d2c56f3db880fe3d6435f4f 100644 +index d7f95bd32842fdee0ce53fc97d31ffb3577cdc78..e6f85b07f731859c8b8c380afad699ccc1d6c3e8 100644 --- a/src/main/java/net/minecraft/server/level/WorldServer.java +++ b/src/main/java/net/minecraft/server/level/WorldServer.java @@ -177,6 +177,7 @@ import org.bukkit.event.world.TimeSkipEvent; @@ -906,7 +906,7 @@ index cd1f94e5c1c923ee9d8dd451406ac2bee360e9c3..7befe4263a2d046922438e1a9853f2d8 public Throwable addedToWorldStack; // Paper - entity debug public CraftEntity getBukkitEntity() { diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index c1d4dd2ba75115b1f53c4ce6a3b49bd840973b8e..4cae70c41bbd977b6a5661e43a5ddd3694e89580 100644 +index a057be22f488f76b926c81dc5c63e7f9c3fb54a1..a897ad3de8c18be8bb3c320950a7421477040e8a 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -141,9 +141,11 @@ import org.bukkit.event.player.PlayerItemConsumeEvent; @@ -1723,7 +1723,7 @@ index b6de70c3630d96d0782a657c0389ce03839d8c43..611066964d11b2da7ab6dd59c6083c5c // Tuinity start - optimise culling shape cache for light if (this.a != null && this.a.getCullingShapeCache() != null) { diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java -index c07fb5ca761c0f2067bd103026ded618a8620947..cbe21ec18561c991aa27dd48d536c78e358d5b0e 100644 +index 2e8eb0bb8fb4f7ce6b92fe01a81327da30e614ae..34af81b75e7927cccc0d4aea1b80ab677ca31795 100644 --- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java @@ -68,6 +68,7 @@ import net.minecraft.world.level.material.FluidTypes; @@ -1734,7 +1734,7 @@ index c07fb5ca761c0f2067bd103026ded618a8620947..cbe21ec18561c991aa27dd48d536c78e public class Chunk implements IChunkAccess { -@@ -852,6 +853,11 @@ public class Chunk implements IChunkAccess { +@@ -863,6 +864,11 @@ public class Chunk implements IChunkAccess { if (!this.entitySlices[i].remove(entity)) { // Tuinity - optimise hard colliding entities // Tuinity - entities by class // Tuinity return; } @@ -1746,7 +1746,7 @@ index c07fb5ca761c0f2067bd103026ded618a8620947..cbe21ec18561c991aa27dd48d536c78e if (entity instanceof EntityItem) { itemCounts[i]--; } else if (entity instanceof IInventory) { -@@ -861,6 +867,11 @@ public class Chunk implements IChunkAccess { +@@ -872,6 +878,11 @@ public class Chunk implements IChunkAccess { this.markDirty(); // Paper // Paper end this.entities.remove(entity); // Paper diff --git a/patches/server/0067-lithium-entity.patch b/patches/server/0067-lithium-entity.patch index cf5dcb00..aac0736f 100644 --- a/patches/server/0067-lithium-entity.patch +++ b/patches/server/0067-lithium-entity.patch @@ -6,7 +6,7 @@ Subject: [PATCH] lithium entity Co-authored-by: Hugo Planque diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java -index 4cae70c41bbd977b6a5661e43a5ddd3694e89580..29b30c159fae686a28f395d3e5a2236bc9237c1b 100644 +index a897ad3de8c18be8bb3c320950a7421477040e8a..a182cb8d641dbf8756267901a682f8e3e2a4c67c 100644 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java @@ -286,6 +286,10 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/server/0071-Multithreaded-Entity-Tracker-fixup.patch b/patches/server/0071-Multithreaded-Entity-Tracker-fixup.patch new file mode 100644 index 00000000..c309415a --- /dev/null +++ b/patches/server/0071-Multithreaded-Entity-Tracker-fixup.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Simon Gardling +Date: Wed, 21 Apr 2021 14:44:35 -0400 +Subject: [PATCH] Multithreaded Entity Tracker fixup + + +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 9097884f71d7986c8185a4b2b2a65b8c66fa7354..0b9ed4042612f5242e5b2d057b716170f22c78b1 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -763,11 +763,6 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + return this.updatingChunks.getVisibleAsync(i); + // Tuinity end - Don't copy + } +- // Airplane start - since neither map can be updated during tracker tick, it's safe to allow direct retrieval here +- private PlayerChunk trackerGetVisibleChunk(long i) { +- return this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap) this.visibleChunks).safeGet(i); +- } +- // Airplane end + + protected final IntSupplier getPrioritySupplier(long i) { return c(i); } // Paper - OBFHELPER + protected IntSupplier c(long i) { +@@ -2581,7 +2576,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + + if (!flag1) { + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); +- PlayerChunk playerchunk = PlayerChunkMap.this.trackerGetVisibleChunk(chunkcoordintpair.pair()); // Airplane ++ PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair()); // Airplane + + if (playerchunk != null && playerchunk.getSendingChunk() != null && PlayerChunkMap.this.playerChunkManager.isChunkSent(entityplayer, MathHelper.floor(this.tracker.locX()) >> 4, MathHelper.floor(this.tracker.locZ()) >> 4)) { // Paper - no-tick view distance // Tuinity - don't broadcast in chunks the player hasn't received + flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance; diff --git a/patches/server/0071-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch b/patches/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch similarity index 100% rename from patches/server/0071-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch rename to patches/server/0072-lithium-AI-fixup-use-vanilla-method-for-getClosestEn.patch diff --git a/upstream/Airplane b/upstream/Airplane index 07897895..3b3cde7b 160000 --- a/upstream/Airplane +++ b/upstream/Airplane @@ -1 +1 @@ -Subproject commit 07897895befebc681563b37336042e3041349ad0 +Subproject commit 3b3cde7b0efc30c80e831985bacf91fdde90cc05 diff --git a/upstream/Empirecraft b/upstream/Empirecraft index 018fcff7..efda8c5b 160000 --- a/upstream/Empirecraft +++ b/upstream/Empirecraft @@ -1 +1 @@ -Subproject commit 018fcff79da8bb20926395bba934b90733ee6968 +Subproject commit efda8c5b9a4e2517f6cd3f5a276d10607b08642b diff --git a/upstream/Purpur b/upstream/Purpur index 2e626184..5674cdc7 160000 --- a/upstream/Purpur +++ b/upstream/Purpur @@ -1 +1 @@ -Subproject commit 2e626184bb0fcdb69444cdc58636b3ed86f916d9 +Subproject commit 5674cdc743bbb80e92293ee9d30f475f176a2af0 diff --git a/upstream/Tuinity b/upstream/Tuinity index 32b4d526..b12d0cce 160000 --- a/upstream/Tuinity +++ b/upstream/Tuinity @@ -1 +1 @@ -Subproject commit 32b4d526b4bed2f84a511a0aba36cccef0abea1e +Subproject commit b12d0cce3c69e97b9e68dbbbc2c9be5f8e60a4ab diff --git a/upstreamCommits/Airplane b/upstreamCommits/Airplane index f8effa55..aab0f4b3 100644 --- a/upstreamCommits/Airplane +++ b/upstreamCommits/Airplane @@ -1 +1 @@ -07897895befebc681563b37336042e3041349ad0 \ No newline at end of file +3b3cde7b0efc30c80e831985bacf91fdde90cc05 \ No newline at end of file diff --git a/upstreamCommits/Empirecraft b/upstreamCommits/Empirecraft index 74ef6067..5ff6aaff 100644 --- a/upstreamCommits/Empirecraft +++ b/upstreamCommits/Empirecraft @@ -1 +1 @@ -018fcff79da8bb20926395bba934b90733ee6968 \ No newline at end of file +efda8c5b9a4e2517f6cd3f5a276d10607b08642b \ No newline at end of file diff --git a/upstreamCommits/Purpur b/upstreamCommits/Purpur index 02342d49..5e48d312 100644 --- a/upstreamCommits/Purpur +++ b/upstreamCommits/Purpur @@ -1 +1 @@ -2e626184bb0fcdb69444cdc58636b3ed86f916d9 \ No newline at end of file +5674cdc743bbb80e92293ee9d30f475f176a2af0 \ No newline at end of file diff --git a/upstreamCommits/Tuinity b/upstreamCommits/Tuinity index 1816b4d3..97c224c5 100644 --- a/upstreamCommits/Tuinity +++ b/upstreamCommits/Tuinity @@ -1 +1 @@ -32b4d526b4bed2f84a511a0aba36cccef0abea1e \ No newline at end of file +b12d0cce3c69e97b9e68dbbbc2c9be5f8e60a4ab \ No newline at end of file