From abb8b1fda4bc96005ffbc6fbb68c4ae2a7edec2f Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sat, 12 Jul 2025 16:03:27 +0800 Subject: [PATCH] Add Leaf JUnit test suite --- leaf-server/build.gradle.kts.patch | 18 ++- .../features/0008-Leaf-JUnit-test-suite.patch | 111 ++++++++++++++++++ ...=> 0009-Purpur-Server-Paper-Changes.patch} | 0 ...0-Fix-Pufferfish-and-Purpur-patches.patch} | 0 ...pelessRecipe-comparison-for-vanilla.patch} | 0 ...-for-plugins-not-shutting-down-task.patch} | 0 ...-support.patch => 0013-SIMD-support.patch} | 0 ...0014-Make-book-writing-configurable.patch} | 0 ...-log-legacy-Material-initialization.patch} | 0 ...> 0016-Do-not-log-Not-Secure-marker.patch} | 0 ...ch => 0017-Reduce-array-allocations.patch} | 0 ... 0018-CraftBukkit-UUID-to-world-map.patch} | 0 ...h => 0019-Specific-interval-TPS-API.patch} | 0 ....patch => 0020-5-second-TPS-average.patch} | 0 ...PI.patch => 0021-Last-tick-time-API.patch} | 0 ...-Show-last-tick-time-in-tps-command.patch} | 0 ...h => 0023-Pre-compute-VarLong-sizes.patch} | 6 +- ...mize-VarInt-write-and-VarLong-write.patch} | 4 +- ...atch => 0025-Virtual-thread-support.patch} | 0 ...imings.patch => 0026-Remove-Timings.patch} | 0 ...patch => 0027-KeYi-Player-Skull-API.patch} | 0 ...atch => 0028-Slice-Smooth-Teleports.patch} | 0 ....patch => 0029-Leaves-Protocol-Core.patch} | 0 ...patch => 0030-Leaves-Replay-Mod-API.patch} | 0 ... => 0031-Skip-event-if-no-listeners.patch} | 0 ...SparklyPaper-Optimize-canSee-checks.patch} | 0 ...atch => 0033-Including-5s-in-getTPS.patch} | 0 ...eption-on-missing-ResourceKey-value.patch} | 0 ...-Virtual-Thread-for-async-scheduler.patch} | 0 ...onfigurable-chat-message-signatures.patch} | 0 ...ed.patch => 0037-Matter-Secure-Seed.patch} | 0 ...tch => 0038-Faster-random-generator.patch} | 0 ...onfigurable-unknown-command-message.patch} | 0 ...world-map-with-optimized-collection.patch} | 0 ...ntityType-minecraftToBukkit-convert.patch} | 0 ...patch => 0042-Multithreaded-Tracker.patch} | 0 ....patch => 0043-Asynchronous-locator.patch} | 0 ...-snapshots-for-acquiring-blockstate.patch} | 0 ...CraftServer-getworlds-list-creation.patch} | 0 ...k-key.patch => 0046-Cache-chunk-key.patch} | 0 ... => 0047-Async-structure-locate-api.patch} | 0 ...> 0048-PlayerInventoryOverflowEvent.patch} | 0 ...SparklyPaper-Parallel-world-ticking.patch} | 0 ...r-PR-Throttle-failed-spawn-attempts.patch} | 0 ...tch => 0051-Async-playerdata-saving.patch} | 0 ...g.patch => 0052-Async-chunk-sending.patch} | 0 ...053-Optimise-player-movement-checks.patch} | 0 ...atch => 0054-optimise-ReferenceList.patch} | 0 ...tBiome.patch => 0055-cache-getBiome.patch} | 0 ...hread.patch => 0056-dump-pwt-thread.patch} | 0 ...tion.patch => 0057-Paw-optimization.patch} | 0 ...pawn.patch => 0058-optimize-despawn.patch} | 0 ...patch => 0059-optimize-mob-spawning.patch} | 0 ...ch => 0060-Toggleable-async-catcher.patch} | 0 54 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 leaf-server/paper-patches/features/0008-Leaf-JUnit-test-suite.patch rename leaf-server/paper-patches/features/{0008-Purpur-Server-Paper-Changes.patch => 0009-Purpur-Server-Paper-Changes.patch} (100%) rename leaf-server/paper-patches/features/{0009-Fix-Pufferfish-and-Purpur-patches.patch => 0010-Fix-Pufferfish-and-Purpur-patches.patch} (100%) rename leaf-server/paper-patches/features/{0010-Simpler-ShapelessRecipe-comparison-for-vanilla.patch => 0011-Simpler-ShapelessRecipe-comparison-for-vanilla.patch} (100%) rename leaf-server/paper-patches/features/{0011-Print-stack-trace-for-plugins-not-shutting-down-task.patch => 0012-Print-stack-trace-for-plugins-not-shutting-down-task.patch} (100%) rename leaf-server/paper-patches/features/{0012-SIMD-support.patch => 0013-SIMD-support.patch} (100%) rename leaf-server/paper-patches/features/{0013-Make-book-writing-configurable.patch => 0014-Make-book-writing-configurable.patch} (100%) rename leaf-server/paper-patches/features/{0014-Do-not-log-legacy-Material-initialization.patch => 0015-Do-not-log-legacy-Material-initialization.patch} (100%) rename leaf-server/paper-patches/features/{0015-Do-not-log-Not-Secure-marker.patch => 0016-Do-not-log-Not-Secure-marker.patch} (100%) rename leaf-server/paper-patches/features/{0016-Reduce-array-allocations.patch => 0017-Reduce-array-allocations.patch} (100%) rename leaf-server/paper-patches/features/{0017-CraftBukkit-UUID-to-world-map.patch => 0018-CraftBukkit-UUID-to-world-map.patch} (100%) rename leaf-server/paper-patches/features/{0018-Specific-interval-TPS-API.patch => 0019-Specific-interval-TPS-API.patch} (100%) rename leaf-server/paper-patches/features/{0019-5-second-TPS-average.patch => 0020-5-second-TPS-average.patch} (100%) rename leaf-server/paper-patches/features/{0020-Last-tick-time-API.patch => 0021-Last-tick-time-API.patch} (100%) rename leaf-server/paper-patches/features/{0021-Show-last-tick-time-in-tps-command.patch => 0022-Show-last-tick-time-in-tps-command.patch} (100%) rename leaf-server/paper-patches/features/{0022-Pre-compute-VarLong-sizes.patch => 0023-Pre-compute-VarLong-sizes.patch} (97%) rename leaf-server/paper-patches/features/{0023-Optimize-VarInt-write-and-VarLong-write.patch => 0024-Optimize-VarInt-write-and-VarLong-write.patch} (96%) rename leaf-server/paper-patches/features/{0024-Virtual-thread-support.patch => 0025-Virtual-thread-support.patch} (100%) rename leaf-server/paper-patches/features/{0025-Remove-Timings.patch => 0026-Remove-Timings.patch} (100%) rename leaf-server/paper-patches/features/{0026-KeYi-Player-Skull-API.patch => 0027-KeYi-Player-Skull-API.patch} (100%) rename leaf-server/paper-patches/features/{0027-Slice-Smooth-Teleports.patch => 0028-Slice-Smooth-Teleports.patch} (100%) rename leaf-server/paper-patches/features/{0028-Leaves-Protocol-Core.patch => 0029-Leaves-Protocol-Core.patch} (100%) rename leaf-server/paper-patches/features/{0029-Leaves-Replay-Mod-API.patch => 0030-Leaves-Replay-Mod-API.patch} (100%) rename leaf-server/paper-patches/features/{0030-Skip-event-if-no-listeners.patch => 0031-Skip-event-if-no-listeners.patch} (100%) rename leaf-server/paper-patches/features/{0031-SparklyPaper-Optimize-canSee-checks.patch => 0032-SparklyPaper-Optimize-canSee-checks.patch} (100%) rename leaf-server/paper-patches/features/{0032-Including-5s-in-getTPS.patch => 0033-Including-5s-in-getTPS.patch} (100%) rename leaf-server/paper-patches/features/{0033-Don-t-throw-exception-on-missing-ResourceKey-value.patch => 0034-Don-t-throw-exception-on-missing-ResourceKey-value.patch} (100%) rename leaf-server/paper-patches/features/{0034-Virtual-Thread-for-async-scheduler.patch => 0035-Virtual-Thread-for-async-scheduler.patch} (100%) rename leaf-server/paper-patches/features/{0035-Mirai-Configurable-chat-message-signatures.patch => 0036-Mirai-Configurable-chat-message-signatures.patch} (100%) rename leaf-server/paper-patches/features/{0036-Matter-Secure-Seed.patch => 0037-Matter-Secure-Seed.patch} (100%) rename leaf-server/paper-patches/features/{0037-Faster-random-generator.patch => 0038-Faster-random-generator.patch} (100%) rename leaf-server/paper-patches/features/{0038-Configurable-unknown-command-message.patch => 0039-Configurable-unknown-command-message.patch} (100%) rename leaf-server/paper-patches/features/{0039-Replace-world-map-with-optimized-collection.patch => 0040-Replace-world-map-with-optimized-collection.patch} (100%) rename leaf-server/paper-patches/features/{0040-Cache-CraftEntityType-minecraftToBukkit-convert.patch => 0041-Cache-CraftEntityType-minecraftToBukkit-convert.patch} (100%) rename leaf-server/paper-patches/features/{0041-Multithreaded-Tracker.patch => 0042-Multithreaded-Tracker.patch} (100%) rename leaf-server/paper-patches/features/{0042-Asynchronous-locator.patch => 0043-Asynchronous-locator.patch} (100%) rename leaf-server/paper-patches/features/{0043-EMC-Don-t-use-snapshots-for-acquiring-blockstate.patch => 0044-EMC-Don-t-use-snapshots-for-acquiring-blockstate.patch} (100%) rename leaf-server/paper-patches/features/{0044-Faster-CraftServer-getworlds-list-creation.patch => 0045-Faster-CraftServer-getworlds-list-creation.patch} (100%) rename leaf-server/paper-patches/features/{0045-Cache-chunk-key.patch => 0046-Cache-chunk-key.patch} (100%) rename leaf-server/paper-patches/features/{0046-Async-structure-locate-api.patch => 0047-Async-structure-locate-api.patch} (100%) rename leaf-server/paper-patches/features/{0047-PlayerInventoryOverflowEvent.patch => 0048-PlayerInventoryOverflowEvent.patch} (100%) rename leaf-server/paper-patches/features/{0048-SparklyPaper-Parallel-world-ticking.patch => 0049-SparklyPaper-Parallel-world-ticking.patch} (100%) rename leaf-server/paper-patches/features/{0049-Paper-PR-Throttle-failed-spawn-attempts.patch => 0050-Paper-PR-Throttle-failed-spawn-attempts.patch} (100%) rename leaf-server/paper-patches/features/{0050-Async-playerdata-saving.patch => 0051-Async-playerdata-saving.patch} (100%) rename leaf-server/paper-patches/features/{0051-Async-chunk-sending.patch => 0052-Async-chunk-sending.patch} (100%) rename leaf-server/paper-patches/features/{0052-Optimise-player-movement-checks.patch => 0053-Optimise-player-movement-checks.patch} (100%) rename leaf-server/paper-patches/features/{0053-optimise-ReferenceList.patch => 0054-optimise-ReferenceList.patch} (100%) rename leaf-server/paper-patches/features/{0054-cache-getBiome.patch => 0055-cache-getBiome.patch} (100%) rename leaf-server/paper-patches/features/{0055-dump-pwt-thread.patch => 0056-dump-pwt-thread.patch} (100%) rename leaf-server/paper-patches/features/{0056-Paw-optimization.patch => 0057-Paw-optimization.patch} (100%) rename leaf-server/paper-patches/features/{0057-optimize-despawn.patch => 0058-optimize-despawn.patch} (100%) rename leaf-server/paper-patches/features/{0058-optimize-mob-spawning.patch => 0059-optimize-mob-spawning.patch} (100%) rename leaf-server/paper-patches/features/{0059-Toggleable-async-catcher.patch => 0060-Toggleable-async-catcher.patch} (100%) diff --git a/leaf-server/build.gradle.kts.patch b/leaf-server/build.gradle.kts.patch index 1ba6ed84..6ba79334 100644 --- a/leaf-server/build.gradle.kts.patch +++ b/leaf-server/build.gradle.kts.patch @@ -234,7 +234,7 @@ doFirst { workingDir.mkdirs() -@@ -391,3 +_,62 @@ +@@ -391,3 +_,78 @@ } } } @@ -297,3 +297,19 @@ + } +} +// Gale end - branding changes - package license into jar ++ ++// Leaf start - Leaf JUnit test suite ++tasks.register("runLeafTests") { ++ group = LifecycleBasePlugin.VERIFICATION_GROUP ++ include("**/LeafTestSuite.class") ++ workingDir = temporaryDir ++ useJUnitPlatform { ++ forkEvery = 1 ++ } ++ ++ // Configure mockito agent that is needed in newer java versions ++ val provider = objects.newInstance() ++ provider.fileCollection.from(mockitoAgent) ++ jvmArgumentProviders.add(provider) ++} ++// Leaf end - Leaf JUnit test suite diff --git a/leaf-server/paper-patches/features/0008-Leaf-JUnit-test-suite.patch b/leaf-server/paper-patches/features/0008-Leaf-JUnit-test-suite.patch new file mode 100644 index 00000000..7b7d20ef --- /dev/null +++ b/leaf-server/paper-patches/features/0008-Leaf-JUnit-test-suite.patch @@ -0,0 +1,111 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> +Date: Sat, 12 Jul 2025 15:33:40 +0800 +Subject: [PATCH] Leaf JUnit test suite + + +diff --git a/src/test/java/org/bukkit/support/environment/LeafTest.java b/src/test/java/org/bukkit/support/environment/LeafTest.java +new file mode 100644 +index 0000000000000000000000000000000000000000..d8741167ee7003265540bb3010eb7b9587a181ce +--- /dev/null ++++ b/src/test/java/org/bukkit/support/environment/LeafTest.java +@@ -0,0 +1,22 @@ ++package org.bukkit.support.environment; ++ ++import org.junit.jupiter.api.Tag; ++import org.junit.jupiter.api.extension.ExtendWith; ++import org.bukkit.support.extension.LeafExtension; ++import org.bukkit.support.extension.VanillaFeatureExtension; ++ ++import java.lang.annotation.ElementType; ++import java.lang.annotation.Retention; ++import java.lang.annotation.RetentionPolicy; ++import java.lang.annotation.Target; ++ ++/** ++ * Indicates that a class or method should be tested when tested Leaf JUnit tests. ++ * All Minecraft feature flags set will be used. ++ */ ++@Target({ElementType.TYPE, ElementType.METHOD}) ++@Retention(RetentionPolicy.RUNTIME) ++@Tag("LeafTest") ++@ExtendWith({LeafExtension.class}) ++public @interface LeafTest { ++} +diff --git a/src/test/java/org/bukkit/support/extension/LeafExtension.java b/src/test/java/org/bukkit/support/extension/LeafExtension.java +new file mode 100644 +index 0000000000000000000000000000000000000000..1b66f5fdb4af3cf1d1f01dc219577ab6b6f52f4e +--- /dev/null ++++ b/src/test/java/org/bukkit/support/extension/LeafExtension.java +@@ -0,0 +1,50 @@ ++package org.bukkit.support.extension; ++ ++import java.util.HashMap; ++import java.util.Map; ++import net.minecraft.world.flag.FeatureFlags; ++import org.bukkit.Bukkit; ++import org.bukkit.Keyed; ++import org.bukkit.Registry; ++import org.bukkit.Server; ++import org.bukkit.craftbukkit.CraftRegistry; ++import org.bukkit.support.DummyServerHelper; ++import org.bukkit.support.RegistryHelper; ++import org.junit.jupiter.api.extension.ExtensionContext; ++ ++/** ++ * Identical with {@link org.bukkit.support.extension.AllFeaturesExtension} ++ */ ++public class LeafExtension extends BaseExtension { ++ ++ private static final Map, Registry> realRegistries = new HashMap<>(); ++ ++ public LeafExtension() { ++ super("LeafTest"); ++ } ++ ++ public static Registry getRealRegistry(Class clazz) { ++ return (Registry) LeafExtension.realRegistries.get(clazz); ++ } ++ ++ public static Map, Registry> getRealRegistries() { ++ return LeafExtension.realRegistries; ++ } ++ ++ @Override ++ public void init(ExtensionContext extensionContext) { ++ RegistryHelper.setup(FeatureFlags.REGISTRY.allFlags()); ++ ++ Server server = DummyServerHelper.setup(); ++ ++ Bukkit.setServer(server); ++ ++ // Paper - Add RegistryAccess for managing registries - replaced with registry access ++ ++ CraftRegistry.setMinecraftRegistry(RegistryHelper.getRegistry()); ++ } ++ ++ @Override ++ void runBeforeEach(ExtensionContext extensionContext) { ++ } ++} +diff --git a/src/test/java/org/bukkit/support/suite/LeafTestSuite.java b/src/test/java/org/bukkit/support/suite/LeafTestSuite.java +new file mode 100644 +index 0000000000000000000000000000000000000000..28417468c8d5faeef37eeeb940f0cf9a90b7d9e8 +--- /dev/null ++++ b/src/test/java/org/bukkit/support/suite/LeafTestSuite.java +@@ -0,0 +1,15 @@ ++package org.bukkit.support.suite; ++ ++import org.junit.platform.suite.api.ConfigurationParameter; ++import org.junit.platform.suite.api.IncludeTags; ++import org.junit.platform.suite.api.SelectPackages; ++import org.junit.platform.suite.api.Suite; ++import org.junit.platform.suite.api.SuiteDisplayName; ++ ++@Suite(failIfNoTests = false) ++@SuiteDisplayName("Test suite for tests used by Leaf") ++@SelectPackages({"net.minecraft"}) ++@IncludeTags("LeafTest") ++@ConfigurationParameter(key = "TestSuite", value = "LeafTest") ++public class LeafTestSuite { ++} diff --git a/leaf-server/paper-patches/features/0008-Purpur-Server-Paper-Changes.patch b/leaf-server/paper-patches/features/0009-Purpur-Server-Paper-Changes.patch similarity index 100% rename from leaf-server/paper-patches/features/0008-Purpur-Server-Paper-Changes.patch rename to leaf-server/paper-patches/features/0009-Purpur-Server-Paper-Changes.patch diff --git a/leaf-server/paper-patches/features/0009-Fix-Pufferfish-and-Purpur-patches.patch b/leaf-server/paper-patches/features/0010-Fix-Pufferfish-and-Purpur-patches.patch similarity index 100% rename from leaf-server/paper-patches/features/0009-Fix-Pufferfish-and-Purpur-patches.patch rename to leaf-server/paper-patches/features/0010-Fix-Pufferfish-and-Purpur-patches.patch diff --git a/leaf-server/paper-patches/features/0010-Simpler-ShapelessRecipe-comparison-for-vanilla.patch b/leaf-server/paper-patches/features/0011-Simpler-ShapelessRecipe-comparison-for-vanilla.patch similarity index 100% rename from leaf-server/paper-patches/features/0010-Simpler-ShapelessRecipe-comparison-for-vanilla.patch rename to leaf-server/paper-patches/features/0011-Simpler-ShapelessRecipe-comparison-for-vanilla.patch diff --git a/leaf-server/paper-patches/features/0011-Print-stack-trace-for-plugins-not-shutting-down-task.patch b/leaf-server/paper-patches/features/0012-Print-stack-trace-for-plugins-not-shutting-down-task.patch similarity index 100% rename from leaf-server/paper-patches/features/0011-Print-stack-trace-for-plugins-not-shutting-down-task.patch rename to leaf-server/paper-patches/features/0012-Print-stack-trace-for-plugins-not-shutting-down-task.patch diff --git a/leaf-server/paper-patches/features/0012-SIMD-support.patch b/leaf-server/paper-patches/features/0013-SIMD-support.patch similarity index 100% rename from leaf-server/paper-patches/features/0012-SIMD-support.patch rename to leaf-server/paper-patches/features/0013-SIMD-support.patch diff --git a/leaf-server/paper-patches/features/0013-Make-book-writing-configurable.patch b/leaf-server/paper-patches/features/0014-Make-book-writing-configurable.patch similarity index 100% rename from leaf-server/paper-patches/features/0013-Make-book-writing-configurable.patch rename to leaf-server/paper-patches/features/0014-Make-book-writing-configurable.patch diff --git a/leaf-server/paper-patches/features/0014-Do-not-log-legacy-Material-initialization.patch b/leaf-server/paper-patches/features/0015-Do-not-log-legacy-Material-initialization.patch similarity index 100% rename from leaf-server/paper-patches/features/0014-Do-not-log-legacy-Material-initialization.patch rename to leaf-server/paper-patches/features/0015-Do-not-log-legacy-Material-initialization.patch diff --git a/leaf-server/paper-patches/features/0015-Do-not-log-Not-Secure-marker.patch b/leaf-server/paper-patches/features/0016-Do-not-log-Not-Secure-marker.patch similarity index 100% rename from leaf-server/paper-patches/features/0015-Do-not-log-Not-Secure-marker.patch rename to leaf-server/paper-patches/features/0016-Do-not-log-Not-Secure-marker.patch diff --git a/leaf-server/paper-patches/features/0016-Reduce-array-allocations.patch b/leaf-server/paper-patches/features/0017-Reduce-array-allocations.patch similarity index 100% rename from leaf-server/paper-patches/features/0016-Reduce-array-allocations.patch rename to leaf-server/paper-patches/features/0017-Reduce-array-allocations.patch diff --git a/leaf-server/paper-patches/features/0017-CraftBukkit-UUID-to-world-map.patch b/leaf-server/paper-patches/features/0018-CraftBukkit-UUID-to-world-map.patch similarity index 100% rename from leaf-server/paper-patches/features/0017-CraftBukkit-UUID-to-world-map.patch rename to leaf-server/paper-patches/features/0018-CraftBukkit-UUID-to-world-map.patch diff --git a/leaf-server/paper-patches/features/0018-Specific-interval-TPS-API.patch b/leaf-server/paper-patches/features/0019-Specific-interval-TPS-API.patch similarity index 100% rename from leaf-server/paper-patches/features/0018-Specific-interval-TPS-API.patch rename to leaf-server/paper-patches/features/0019-Specific-interval-TPS-API.patch diff --git a/leaf-server/paper-patches/features/0019-5-second-TPS-average.patch b/leaf-server/paper-patches/features/0020-5-second-TPS-average.patch similarity index 100% rename from leaf-server/paper-patches/features/0019-5-second-TPS-average.patch rename to leaf-server/paper-patches/features/0020-5-second-TPS-average.patch diff --git a/leaf-server/paper-patches/features/0020-Last-tick-time-API.patch b/leaf-server/paper-patches/features/0021-Last-tick-time-API.patch similarity index 100% rename from leaf-server/paper-patches/features/0020-Last-tick-time-API.patch rename to leaf-server/paper-patches/features/0021-Last-tick-time-API.patch diff --git a/leaf-server/paper-patches/features/0021-Show-last-tick-time-in-tps-command.patch b/leaf-server/paper-patches/features/0022-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from leaf-server/paper-patches/features/0021-Show-last-tick-time-in-tps-command.patch rename to leaf-server/paper-patches/features/0022-Show-last-tick-time-in-tps-command.patch diff --git a/leaf-server/paper-patches/features/0022-Pre-compute-VarLong-sizes.patch b/leaf-server/paper-patches/features/0023-Pre-compute-VarLong-sizes.patch similarity index 97% rename from leaf-server/paper-patches/features/0022-Pre-compute-VarLong-sizes.patch rename to leaf-server/paper-patches/features/0023-Pre-compute-VarLong-sizes.patch index 9ed13cbf..2e4a9274 100644 --- a/leaf-server/paper-patches/features/0022-Pre-compute-VarLong-sizes.patch +++ b/leaf-server/paper-patches/features/0023-Pre-compute-VarLong-sizes.patch @@ -22,10 +22,10 @@ This includes a test to ensure that the behavior is as expected and fixes the in diff --git a/src/test/java/net/minecraft/network/VarIntLongTest.java b/src/test/java/net/minecraft/network/VarIntLongTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..bbea09ffc2180c3c62e15d7dff51f8c220425bfe +index 0000000000000000000000000000000000000000..04959045a14ccdce3f836e43e270bcf3349b28bb --- /dev/null +++ b/src/test/java/net/minecraft/network/VarIntLongTest.java -@@ -0,0 +1,159 @@ +@@ -0,0 +1,161 @@ +// Gale - Velocity - VarInt and VarLong optimizations + +package net.minecraft.network; @@ -36,7 +36,9 @@ index 0000000000000000000000000000000000000000..bbea09ffc2180c3c62e15d7dff51f8c2 +import it.unimi.dsi.fastutil.longs.LongSet; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; ++import org.bukkit.support.environment.LeafTest; + ++@LeafTest +public class VarIntLongTest { + + private static String padStringWithLeadingZeros(String string, int length) { diff --git a/leaf-server/paper-patches/features/0023-Optimize-VarInt-write-and-VarLong-write.patch b/leaf-server/paper-patches/features/0024-Optimize-VarInt-write-and-VarLong-write.patch similarity index 96% rename from leaf-server/paper-patches/features/0023-Optimize-VarInt-write-and-VarLong-write.patch rename to leaf-server/paper-patches/features/0024-Optimize-VarInt-write-and-VarLong-write.patch index 03e7a4fe..84479665 100644 --- a/leaf-server/paper-patches/features/0023-Optimize-VarInt-write-and-VarLong-write.patch +++ b/leaf-server/paper-patches/features/0024-Optimize-VarInt-write-and-VarLong-write.patch @@ -21,7 +21,7 @@ Given that we do a lot of varint writing as well, this should provide a small pe This includes a test to ensure that the behavior is as expected and fixes the initialization loop so that the correct results will be given. Much thanks to @octylFractal for acting as my duck while trying to figure this out. diff --git a/src/test/java/net/minecraft/network/VarIntLongTest.java b/src/test/java/net/minecraft/network/VarIntLongTest.java -index bbea09ffc2180c3c62e15d7dff51f8c220425bfe..0c11670d8d7307307a7cd12be5d0dca40155829d 100644 +index 04959045a14ccdce3f836e43e270bcf3349b28bb..96853a1db7998e68cb0404eb1c339e807cfd339e 100644 --- a/src/test/java/net/minecraft/network/VarIntLongTest.java +++ b/src/test/java/net/minecraft/network/VarIntLongTest.java @@ -2,6 +2,7 @@ @@ -32,7 +32,7 @@ index bbea09ffc2180c3c62e15d7dff51f8c220425bfe..0c11670d8d7307307a7cd12be5d0dca4 import it.unimi.dsi.fastutil.ints.IntOpenHashSet; import it.unimi.dsi.fastutil.ints.IntSet; import it.unimi.dsi.fastutil.longs.LongOpenHashSet; -@@ -156,4 +157,46 @@ public class VarIntLongTest { +@@ -158,4 +159,46 @@ public class VarIntLongTest { } // Gale end - Velocity - pre-compute VarInt and VarLong sizes diff --git a/leaf-server/paper-patches/features/0024-Virtual-thread-support.patch b/leaf-server/paper-patches/features/0025-Virtual-thread-support.patch similarity index 100% rename from leaf-server/paper-patches/features/0024-Virtual-thread-support.patch rename to leaf-server/paper-patches/features/0025-Virtual-thread-support.patch diff --git a/leaf-server/paper-patches/features/0025-Remove-Timings.patch b/leaf-server/paper-patches/features/0026-Remove-Timings.patch similarity index 100% rename from leaf-server/paper-patches/features/0025-Remove-Timings.patch rename to leaf-server/paper-patches/features/0026-Remove-Timings.patch diff --git a/leaf-server/paper-patches/features/0026-KeYi-Player-Skull-API.patch b/leaf-server/paper-patches/features/0027-KeYi-Player-Skull-API.patch similarity index 100% rename from leaf-server/paper-patches/features/0026-KeYi-Player-Skull-API.patch rename to leaf-server/paper-patches/features/0027-KeYi-Player-Skull-API.patch diff --git a/leaf-server/paper-patches/features/0027-Slice-Smooth-Teleports.patch b/leaf-server/paper-patches/features/0028-Slice-Smooth-Teleports.patch similarity index 100% rename from leaf-server/paper-patches/features/0027-Slice-Smooth-Teleports.patch rename to leaf-server/paper-patches/features/0028-Slice-Smooth-Teleports.patch diff --git a/leaf-server/paper-patches/features/0028-Leaves-Protocol-Core.patch b/leaf-server/paper-patches/features/0029-Leaves-Protocol-Core.patch similarity index 100% rename from leaf-server/paper-patches/features/0028-Leaves-Protocol-Core.patch rename to leaf-server/paper-patches/features/0029-Leaves-Protocol-Core.patch diff --git a/leaf-server/paper-patches/features/0029-Leaves-Replay-Mod-API.patch b/leaf-server/paper-patches/features/0030-Leaves-Replay-Mod-API.patch similarity index 100% rename from leaf-server/paper-patches/features/0029-Leaves-Replay-Mod-API.patch rename to leaf-server/paper-patches/features/0030-Leaves-Replay-Mod-API.patch diff --git a/leaf-server/paper-patches/features/0030-Skip-event-if-no-listeners.patch b/leaf-server/paper-patches/features/0031-Skip-event-if-no-listeners.patch similarity index 100% rename from leaf-server/paper-patches/features/0030-Skip-event-if-no-listeners.patch rename to leaf-server/paper-patches/features/0031-Skip-event-if-no-listeners.patch diff --git a/leaf-server/paper-patches/features/0031-SparklyPaper-Optimize-canSee-checks.patch b/leaf-server/paper-patches/features/0032-SparklyPaper-Optimize-canSee-checks.patch similarity index 100% rename from leaf-server/paper-patches/features/0031-SparklyPaper-Optimize-canSee-checks.patch rename to leaf-server/paper-patches/features/0032-SparklyPaper-Optimize-canSee-checks.patch diff --git a/leaf-server/paper-patches/features/0032-Including-5s-in-getTPS.patch b/leaf-server/paper-patches/features/0033-Including-5s-in-getTPS.patch similarity index 100% rename from leaf-server/paper-patches/features/0032-Including-5s-in-getTPS.patch rename to leaf-server/paper-patches/features/0033-Including-5s-in-getTPS.patch diff --git a/leaf-server/paper-patches/features/0033-Don-t-throw-exception-on-missing-ResourceKey-value.patch b/leaf-server/paper-patches/features/0034-Don-t-throw-exception-on-missing-ResourceKey-value.patch similarity index 100% rename from leaf-server/paper-patches/features/0033-Don-t-throw-exception-on-missing-ResourceKey-value.patch rename to leaf-server/paper-patches/features/0034-Don-t-throw-exception-on-missing-ResourceKey-value.patch diff --git a/leaf-server/paper-patches/features/0034-Virtual-Thread-for-async-scheduler.patch b/leaf-server/paper-patches/features/0035-Virtual-Thread-for-async-scheduler.patch similarity index 100% rename from leaf-server/paper-patches/features/0034-Virtual-Thread-for-async-scheduler.patch rename to leaf-server/paper-patches/features/0035-Virtual-Thread-for-async-scheduler.patch diff --git a/leaf-server/paper-patches/features/0035-Mirai-Configurable-chat-message-signatures.patch b/leaf-server/paper-patches/features/0036-Mirai-Configurable-chat-message-signatures.patch similarity index 100% rename from leaf-server/paper-patches/features/0035-Mirai-Configurable-chat-message-signatures.patch rename to leaf-server/paper-patches/features/0036-Mirai-Configurable-chat-message-signatures.patch diff --git a/leaf-server/paper-patches/features/0036-Matter-Secure-Seed.patch b/leaf-server/paper-patches/features/0037-Matter-Secure-Seed.patch similarity index 100% rename from leaf-server/paper-patches/features/0036-Matter-Secure-Seed.patch rename to leaf-server/paper-patches/features/0037-Matter-Secure-Seed.patch diff --git a/leaf-server/paper-patches/features/0037-Faster-random-generator.patch b/leaf-server/paper-patches/features/0038-Faster-random-generator.patch similarity index 100% rename from leaf-server/paper-patches/features/0037-Faster-random-generator.patch rename to leaf-server/paper-patches/features/0038-Faster-random-generator.patch diff --git a/leaf-server/paper-patches/features/0038-Configurable-unknown-command-message.patch b/leaf-server/paper-patches/features/0039-Configurable-unknown-command-message.patch similarity index 100% rename from leaf-server/paper-patches/features/0038-Configurable-unknown-command-message.patch rename to leaf-server/paper-patches/features/0039-Configurable-unknown-command-message.patch diff --git a/leaf-server/paper-patches/features/0039-Replace-world-map-with-optimized-collection.patch b/leaf-server/paper-patches/features/0040-Replace-world-map-with-optimized-collection.patch similarity index 100% rename from leaf-server/paper-patches/features/0039-Replace-world-map-with-optimized-collection.patch rename to leaf-server/paper-patches/features/0040-Replace-world-map-with-optimized-collection.patch diff --git a/leaf-server/paper-patches/features/0040-Cache-CraftEntityType-minecraftToBukkit-convert.patch b/leaf-server/paper-patches/features/0041-Cache-CraftEntityType-minecraftToBukkit-convert.patch similarity index 100% rename from leaf-server/paper-patches/features/0040-Cache-CraftEntityType-minecraftToBukkit-convert.patch rename to leaf-server/paper-patches/features/0041-Cache-CraftEntityType-minecraftToBukkit-convert.patch diff --git a/leaf-server/paper-patches/features/0041-Multithreaded-Tracker.patch b/leaf-server/paper-patches/features/0042-Multithreaded-Tracker.patch similarity index 100% rename from leaf-server/paper-patches/features/0041-Multithreaded-Tracker.patch rename to leaf-server/paper-patches/features/0042-Multithreaded-Tracker.patch diff --git a/leaf-server/paper-patches/features/0042-Asynchronous-locator.patch b/leaf-server/paper-patches/features/0043-Asynchronous-locator.patch similarity index 100% rename from leaf-server/paper-patches/features/0042-Asynchronous-locator.patch rename to leaf-server/paper-patches/features/0043-Asynchronous-locator.patch diff --git a/leaf-server/paper-patches/features/0043-EMC-Don-t-use-snapshots-for-acquiring-blockstate.patch b/leaf-server/paper-patches/features/0044-EMC-Don-t-use-snapshots-for-acquiring-blockstate.patch similarity index 100% rename from leaf-server/paper-patches/features/0043-EMC-Don-t-use-snapshots-for-acquiring-blockstate.patch rename to leaf-server/paper-patches/features/0044-EMC-Don-t-use-snapshots-for-acquiring-blockstate.patch diff --git a/leaf-server/paper-patches/features/0044-Faster-CraftServer-getworlds-list-creation.patch b/leaf-server/paper-patches/features/0045-Faster-CraftServer-getworlds-list-creation.patch similarity index 100% rename from leaf-server/paper-patches/features/0044-Faster-CraftServer-getworlds-list-creation.patch rename to leaf-server/paper-patches/features/0045-Faster-CraftServer-getworlds-list-creation.patch diff --git a/leaf-server/paper-patches/features/0045-Cache-chunk-key.patch b/leaf-server/paper-patches/features/0046-Cache-chunk-key.patch similarity index 100% rename from leaf-server/paper-patches/features/0045-Cache-chunk-key.patch rename to leaf-server/paper-patches/features/0046-Cache-chunk-key.patch diff --git a/leaf-server/paper-patches/features/0046-Async-structure-locate-api.patch b/leaf-server/paper-patches/features/0047-Async-structure-locate-api.patch similarity index 100% rename from leaf-server/paper-patches/features/0046-Async-structure-locate-api.patch rename to leaf-server/paper-patches/features/0047-Async-structure-locate-api.patch diff --git a/leaf-server/paper-patches/features/0047-PlayerInventoryOverflowEvent.patch b/leaf-server/paper-patches/features/0048-PlayerInventoryOverflowEvent.patch similarity index 100% rename from leaf-server/paper-patches/features/0047-PlayerInventoryOverflowEvent.patch rename to leaf-server/paper-patches/features/0048-PlayerInventoryOverflowEvent.patch diff --git a/leaf-server/paper-patches/features/0048-SparklyPaper-Parallel-world-ticking.patch b/leaf-server/paper-patches/features/0049-SparklyPaper-Parallel-world-ticking.patch similarity index 100% rename from leaf-server/paper-patches/features/0048-SparklyPaper-Parallel-world-ticking.patch rename to leaf-server/paper-patches/features/0049-SparklyPaper-Parallel-world-ticking.patch diff --git a/leaf-server/paper-patches/features/0049-Paper-PR-Throttle-failed-spawn-attempts.patch b/leaf-server/paper-patches/features/0050-Paper-PR-Throttle-failed-spawn-attempts.patch similarity index 100% rename from leaf-server/paper-patches/features/0049-Paper-PR-Throttle-failed-spawn-attempts.patch rename to leaf-server/paper-patches/features/0050-Paper-PR-Throttle-failed-spawn-attempts.patch diff --git a/leaf-server/paper-patches/features/0050-Async-playerdata-saving.patch b/leaf-server/paper-patches/features/0051-Async-playerdata-saving.patch similarity index 100% rename from leaf-server/paper-patches/features/0050-Async-playerdata-saving.patch rename to leaf-server/paper-patches/features/0051-Async-playerdata-saving.patch diff --git a/leaf-server/paper-patches/features/0051-Async-chunk-sending.patch b/leaf-server/paper-patches/features/0052-Async-chunk-sending.patch similarity index 100% rename from leaf-server/paper-patches/features/0051-Async-chunk-sending.patch rename to leaf-server/paper-patches/features/0052-Async-chunk-sending.patch diff --git a/leaf-server/paper-patches/features/0052-Optimise-player-movement-checks.patch b/leaf-server/paper-patches/features/0053-Optimise-player-movement-checks.patch similarity index 100% rename from leaf-server/paper-patches/features/0052-Optimise-player-movement-checks.patch rename to leaf-server/paper-patches/features/0053-Optimise-player-movement-checks.patch diff --git a/leaf-server/paper-patches/features/0053-optimise-ReferenceList.patch b/leaf-server/paper-patches/features/0054-optimise-ReferenceList.patch similarity index 100% rename from leaf-server/paper-patches/features/0053-optimise-ReferenceList.patch rename to leaf-server/paper-patches/features/0054-optimise-ReferenceList.patch diff --git a/leaf-server/paper-patches/features/0054-cache-getBiome.patch b/leaf-server/paper-patches/features/0055-cache-getBiome.patch similarity index 100% rename from leaf-server/paper-patches/features/0054-cache-getBiome.patch rename to leaf-server/paper-patches/features/0055-cache-getBiome.patch diff --git a/leaf-server/paper-patches/features/0055-dump-pwt-thread.patch b/leaf-server/paper-patches/features/0056-dump-pwt-thread.patch similarity index 100% rename from leaf-server/paper-patches/features/0055-dump-pwt-thread.patch rename to leaf-server/paper-patches/features/0056-dump-pwt-thread.patch diff --git a/leaf-server/paper-patches/features/0056-Paw-optimization.patch b/leaf-server/paper-patches/features/0057-Paw-optimization.patch similarity index 100% rename from leaf-server/paper-patches/features/0056-Paw-optimization.patch rename to leaf-server/paper-patches/features/0057-Paw-optimization.patch diff --git a/leaf-server/paper-patches/features/0057-optimize-despawn.patch b/leaf-server/paper-patches/features/0058-optimize-despawn.patch similarity index 100% rename from leaf-server/paper-patches/features/0057-optimize-despawn.patch rename to leaf-server/paper-patches/features/0058-optimize-despawn.patch diff --git a/leaf-server/paper-patches/features/0058-optimize-mob-spawning.patch b/leaf-server/paper-patches/features/0059-optimize-mob-spawning.patch similarity index 100% rename from leaf-server/paper-patches/features/0058-optimize-mob-spawning.patch rename to leaf-server/paper-patches/features/0059-optimize-mob-spawning.patch diff --git a/leaf-server/paper-patches/features/0059-Toggleable-async-catcher.patch b/leaf-server/paper-patches/features/0060-Toggleable-async-catcher.patch similarity index 100% rename from leaf-server/paper-patches/features/0059-Toggleable-async-catcher.patch rename to leaf-server/paper-patches/features/0060-Toggleable-async-catcher.patch