From 33b0fd1dafd03c82707f3e381a38c5504ea657a3 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Wed, 11 Jun 2025 07:56:22 +0800 Subject: [PATCH 01/16] Some fixes for failed to shutdown if some async are disabled --- .../leaf/async/AsyncPlayerDataSaving.java | 30 ++++-- .../dreeam/leaf/async/ShutdownExecutors.java | 7 +- .../leaf/async/path/AsyncPathProcessor.java | 102 +++++++++++------- .../modules/async/AsyncPathfinding.java | 4 + .../modules/async/AsyncPlayerDataSave.java | 4 + .../modules/async/MultithreadedTracker.java | 1 + 6 files changed, 97 insertions(+), 51 deletions(-) diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java b/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java index 3df32778..b67eda75 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java @@ -12,20 +12,30 @@ import java.util.concurrent.TimeUnit; public class AsyncPlayerDataSaving { - public static final ExecutorService IO_POOL = new ThreadPoolExecutor( - 1, 1, 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(), - new com.google.common.util.concurrent.ThreadFactoryBuilder() - .setPriority(Thread.NORM_PRIORITY - 2) - .setNameFormat("Leaf IO Thread") - .setUncaughtExceptionHandler(Util::onThreadException) - .build(), - new ThreadPoolExecutor.DiscardPolicy() - ); + public static ExecutorService IO_POOL = null; private AsyncPlayerDataSaving() { } + public static void init() { + if (IO_POOL == null) { + IO_POOL = new ThreadPoolExecutor( + 1, + 1, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<>(), + new com.google.common.util.concurrent.ThreadFactoryBuilder() + .setPriority(Thread.NORM_PRIORITY - 2) + .setNameFormat("Leaf IO Thread") + .setUncaughtExceptionHandler(Util::onThreadException) + .build(), + new ThreadPoolExecutor.DiscardPolicy() + ); + } else { + throw new IllegalStateException(); + } + } + public static Optional> submit(Runnable runnable) { if (!AsyncPlayerDataSave.enabled) { runnable.run(); diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java b/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java index b3d1f658..be79ba70 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java @@ -10,6 +10,7 @@ import org.dreeam.leaf.async.tracker.MultithreadedTracker; import java.util.concurrent.TimeUnit; public class ShutdownExecutors { + public static final Logger LOGGER = LogManager.getLogger("Leaf"); public static void shutdown(MinecraftServer server) { @@ -48,11 +49,11 @@ public class ShutdownExecutors { } } - if (AsyncPathProcessor.pathProcessingExecutor != null) { + if (AsyncPathProcessor.PATH_PROCESSING_EXECUTOR != null) { LOGGER.info("Waiting for mob pathfinding executor to shutdown..."); - AsyncPathProcessor.pathProcessingExecutor.shutdown(); + AsyncPathProcessor.PATH_PROCESSING_EXECUTOR.shutdown(); try { - AsyncPathProcessor.pathProcessingExecutor.awaitTermination(10L, TimeUnit.SECONDS); + AsyncPathProcessor.PATH_PROCESSING_EXECUTOR.awaitTermination(10L, TimeUnit.SECONDS); } catch (InterruptedException ignored) { } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java b/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java index 3fac5839..a1f2fb95 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java @@ -1,6 +1,7 @@ package org.dreeam.leaf.async.path; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import net.minecraft.Util; import net.minecraft.server.MinecraftServer; import net.minecraft.world.level.pathfinder.Path; import org.apache.logging.log4j.LogManager; @@ -15,6 +16,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -28,49 +30,25 @@ public class AsyncPathProcessor { private static final String THREAD_PREFIX = "Leaf Async Pathfinding"; private static final Logger LOGGER = LogManager.getLogger(THREAD_PREFIX); private static long lastWarnMillis = System.currentTimeMillis(); - public static final ThreadPoolExecutor pathProcessingExecutor = new ThreadPoolExecutor( - 1, - AsyncPathfinding.asyncPathfindingMaxThreads, - AsyncPathfinding.asyncPathfindingKeepalive, TimeUnit.SECONDS, - getQueueImpl(), - new ThreadFactoryBuilder() - .setNameFormat(THREAD_PREFIX + " Thread - %d") - .setPriority(Thread.NORM_PRIORITY - 2) - .build(), - new RejectedTaskHandler() - ); + public static ThreadPoolExecutor PATH_PROCESSING_EXECUTOR = null; - private static class RejectedTaskHandler implements RejectedExecutionHandler { - @Override - public void rejectedExecution(Runnable rejectedTask, ThreadPoolExecutor executor) { - BlockingQueue workQueue = executor.getQueue(); - if (!executor.isShutdown()) { - switch (AsyncPathfinding.asyncPathfindingRejectPolicy) { - case FLUSH_ALL -> { - if (!workQueue.isEmpty()) { - List pendingTasks = new ArrayList<>(workQueue.size()); - - workQueue.drainTo(pendingTasks); - - for (Runnable pendingTask : pendingTasks) { - pendingTask.run(); - } - } - rejectedTask.run(); - } - case CALLER_RUNS -> rejectedTask.run(); - } - } - - if (System.currentTimeMillis() - lastWarnMillis > 30000L) { - LOGGER.warn("Async pathfinding processor is busy! Pathfinding tasks will be treated as policy defined in config. Increasing max-threads in Leaf config may help."); - lastWarnMillis = System.currentTimeMillis(); - } + public static void init() { + if (PATH_PROCESSING_EXECUTOR == null) { + PATH_PROCESSING_EXECUTOR = new ThreadPoolExecutor( + getCorePoolSize(), + getMaxPoolSize(), + getKeepAliveTime(), TimeUnit.SECONDS, + getQueueImpl(), + getThreadFactory(), + getRejectedPolicy() + ); + } else { + throw new IllegalStateException(); } } protected static CompletableFuture queue(@NotNull AsyncPath path) { - return CompletableFuture.runAsync(path::process, pathProcessingExecutor) + return CompletableFuture.runAsync(path::process, PATH_PROCESSING_EXECUTOR) .orTimeout(60L, TimeUnit.SECONDS) .exceptionally(throwable -> { if (throwable instanceof TimeoutException e) { @@ -98,9 +76,57 @@ public class AsyncPathProcessor { } } + private static int getCorePoolSize() { + return 1; + } + + private static int getMaxPoolSize() { + return AsyncPathfinding.asyncPathfindingMaxThreads; + } + + private static long getKeepAliveTime() { + return AsyncPathfinding.asyncPathfindingKeepalive; + } + private static BlockingQueue getQueueImpl() { final int queueCapacity = AsyncPathfinding.asyncPathfindingQueueSize; return new LinkedBlockingQueue<>(queueCapacity); } + + private static @NotNull ThreadFactory getThreadFactory() { + return new ThreadFactoryBuilder() + .setNameFormat(THREAD_PREFIX + " Thread - %d") + .setPriority(Thread.NORM_PRIORITY - 2) + .setUncaughtExceptionHandler(Util::onThreadException) + .build(); + } + + private static @NotNull RejectedExecutionHandler getRejectedPolicy() { + return (Runnable rejectedTask, ThreadPoolExecutor executor) -> { + BlockingQueue workQueue = executor.getQueue(); + if (!executor.isShutdown()) { + switch (AsyncPathfinding.asyncPathfindingRejectPolicy) { + case FLUSH_ALL -> { + if (!workQueue.isEmpty()) { + List pendingTasks = new ArrayList<>(workQueue.size()); + + workQueue.drainTo(pendingTasks); + + for (Runnable pendingTask : pendingTasks) { + pendingTask.run(); + } + } + rejectedTask.run(); + } + case CALLER_RUNS -> rejectedTask.run(); + } + } + + if (System.currentTimeMillis() - lastWarnMillis > 30000L) { + LOGGER.warn("Async pathfinding processor is busy! Pathfinding tasks will be treated as policy defined in config. Increasing max-threads in Leaf config may help."); + lastWarnMillis = System.currentTimeMillis(); + } + }; + } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPathfinding.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPathfinding.java index 003458e5..19eabb55 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPathfinding.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPathfinding.java @@ -60,5 +60,9 @@ public class AsyncPathfinding extends ConfigModules { ? PathfindTaskRejectPolicy.FLUSH_ALL.toString() : PathfindTaskRejectPolicy.CALLER_RUNS.toString()) ); + + if (enabled) { + org.dreeam.leaf.async.path.AsyncPathProcessor.init(); + } } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java index 6d555ce0..c87908e2 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/AsyncPlayerDataSave.java @@ -19,5 +19,9 @@ public class AsyncPlayerDataSave extends ConfigModules { 异步保存玩家数据."""); enabled = config.getBoolean(getBasePath() + ".enabled", enabled); + + if (enabled) { + org.dreeam.leaf.async.AsyncPlayerDataSaving.init(); + } } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java index 7a01b4b1..8c6c257f 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/async/MultithreadedTracker.java @@ -57,6 +57,7 @@ public class MultithreadedTracker extends ConfigModules { if (asyncEntityTrackerQueueSize <= 0) asyncEntityTrackerQueueSize = asyncEntityTrackerMaxThreads * 384; + if (enabled) { org.dreeam.leaf.async.tracker.MultithreadedTracker.init(); } From 6873fde47d77c0a900614c42fa2f62dbf25c067e Mon Sep 17 00:00:00 2001 From: hayanesuru Date: Wed, 11 Jun 2025 11:50:45 +0900 Subject: [PATCH 02/16] [ci skip] cleanup --- .../0177-optimize-getEntityStatus.patch | 20 ------------------- .../features/0187-Paw-optimization.patch | 12 +++++------ 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0177-optimize-getEntityStatus.patch b/leaf-server/minecraft-patches/features/0177-optimize-getEntityStatus.patch index 533f1aec..463a0268 100644 --- a/leaf-server/minecraft-patches/features/0177-optimize-getEntityStatus.patch +++ b/leaf-server/minecraft-patches/features/0177-optimize-getEntityStatus.patch @@ -41,23 +41,3 @@ index 7554c109c35397bc1a43dd80e87764fd78645bbf..8ae35834bb35ace0bf0ad2c79a80500c } protected boolean addEntity(final Entity entity, final boolean fromDisk, final boolean event) { -diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 64f24d3e0ecb91e0b4df6229354aeac549234f1b..5ea5ff08c8e22b8a4aeef06ab0fc7a60255c27ee 100644 ---- a/net/minecraft/world/entity/Entity.java -+++ b/net/minecraft/world/entity/Entity.java -@@ -381,6 +381,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - // Paper end - // Paper start - rewrite chunk system - private final boolean isHardColliding = this.moonrise$isHardCollidingUncached(); -+ @org.jetbrains.annotations.Nullable // Leaf - optimize getEntityStatus - private net.minecraft.server.level.FullChunkStatus chunkStatus; - private ca.spottedleaf.moonrise.patches.chunk_system.level.chunk.ChunkData chunkData; - private int sectionX = Integer.MIN_VALUE; -@@ -394,6 +395,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - } - - @Override -+ @org.jetbrains.annotations.Nullable // Leaf - optimize getEntityStatus - public final net.minecraft.server.level.FullChunkStatus moonrise$getChunkStatus() { - return this.chunkStatus; - } diff --git a/leaf-server/minecraft-patches/features/0187-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0187-Paw-optimization.patch index 64263972..a735ae35 100644 --- a/leaf-server/minecraft-patches/features/0187-Paw-optimization.patch +++ b/leaf-server/minecraft-patches/features/0187-Paw-optimization.patch @@ -149,10 +149,10 @@ index 7955a8fa9c4de139b24c9d53018b055ff4008e02..eb849c57992658005e0f514c6f7923f8 private void tickPassenger(Entity ridingEntity, Entity passengerEntity, final boolean isActive) { // Paper - EAR 2 diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 5ea5ff08c8e22b8a4aeef06ab0fc7a60255c27ee..02cd62b29f17307d82101bc4e0104afc813536c1 100644 +index 64f24d3e0ecb91e0b4df6229354aeac549234f1b..df23d80d6b18e900414aa02e5c1812f0a10f0fb7 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -1147,31 +1147,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1145,31 +1145,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return this.onGround; } @@ -184,7 +184,7 @@ index 5ea5ff08c8e22b8a4aeef06ab0fc7a60255c27ee..02cd62b29f17307d82101bc4e0104afc public void move(MoverType type, Vec3 movement) { // Gale start - VMP - skip entity move if movement is zero if (!this.boundingBoxChanged && movement.equals(Vec3.ZERO)) { -@@ -1179,16 +1154,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1177,16 +1152,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // Gale end - VMP - skip entity move if movement is zero final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity @@ -201,7 +201,7 @@ index 5ea5ff08c8e22b8a4aeef06ab0fc7a60255c27ee..02cd62b29f17307d82101bc4e0104afc if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -1309,13 +1275,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1307,13 +1273,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // Gale end - skip negligible planar movement multiplication } } @@ -215,7 +215,7 @@ index 5ea5ff08c8e22b8a4aeef06ab0fc7a60255c27ee..02cd62b29f17307d82101bc4e0104afc } private void applyMovementEmissionAndPlaySound(Entity.MovementEmission movementEmission, Vec3 movement, BlockPos pos, BlockState state) { -@@ -4881,9 +4840,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4879,9 +4838,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public void setDeltaMovement(Vec3 deltaMovement) { @@ -225,7 +225,7 @@ index 5ea5ff08c8e22b8a4aeef06ab0fc7a60255c27ee..02cd62b29f17307d82101bc4e0104afc } public void addDeltaMovement(Vec3 addend) { -@@ -4989,9 +4946,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4987,9 +4944,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // Paper end - Fix MC-4 if (this.position.x != x || this.position.y != y || this.position.z != z) { From d2dc5a0895a7fc6612f626e3a7fa4ee91da5bd9a Mon Sep 17 00:00:00 2001 From: hayanesuru Date: Wed, 11 Jun 2025 12:35:21 +0900 Subject: [PATCH 03/16] remove preload mob spawning position --- .../0184-preload-mob-spawning-position.patch | 1 + ...ch => 0184-Add-BlockExplosionHitEvent.patch} | 0 ...-Blast-Protection-explosion-knockback.patch} | 2 +- ...zation.patch => 0186-Paw-optimization.patch} | 0 ... => 0187-Use-UUID-for-cure-reputation.patch} | 0 ...88-Cache-potential-behaviors-in-Brain.patch} | 0 ...se-ActivationList-on-runningBehaviors.patch} | 0 ...er-Fix-infinite-loop-in-RegionFile-IO.patch} | 0 .../modules/opt/PreloadNaturalMobSpawning.java | 17 ----------------- 9 files changed, 2 insertions(+), 18 deletions(-) rename {leaf-server/minecraft-patches/features => leaf-archived-patches/removed/hardfork/server}/0184-preload-mob-spawning-position.patch (99%) rename leaf-server/minecraft-patches/features/{0185-Add-BlockExplosionHitEvent.patch => 0184-Add-BlockExplosionHitEvent.patch} (100%) rename leaf-server/minecraft-patches/features/{0186-Old-Blast-Protection-explosion-knockback.patch => 0185-Old-Blast-Protection-explosion-knockback.patch} (98%) rename leaf-server/minecraft-patches/features/{0187-Paw-optimization.patch => 0186-Paw-optimization.patch} (100%) rename leaf-server/minecraft-patches/features/{0188-Use-UUID-for-cure-reputation.patch => 0187-Use-UUID-for-cure-reputation.patch} (100%) rename leaf-server/minecraft-patches/features/{0189-Cache-potential-behaviors-in-Brain.patch => 0188-Cache-potential-behaviors-in-Brain.patch} (100%) rename leaf-server/minecraft-patches/features/{0190-Use-ActivationList-on-runningBehaviors.patch => 0189-Use-ActivationList-on-runningBehaviors.patch} (100%) rename leaf-server/minecraft-patches/features/{0191-Paper-Fix-infinite-loop-in-RegionFile-IO.patch => 0190-Paper-Fix-infinite-loop-in-RegionFile-IO.patch} (100%) delete mode 100644 leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/PreloadNaturalMobSpawning.java diff --git a/leaf-server/minecraft-patches/features/0184-preload-mob-spawning-position.patch b/leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0184-preload-mob-spawning-position.patch rename to leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch index 33a1b50f..19db2558 100644 --- a/leaf-server/minecraft-patches/features/0184-preload-mob-spawning-position.patch +++ b/leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch @@ -3,6 +3,7 @@ From: hayanesuru Date: Wed, 4 Jun 2025 20:54:32 +0900 Subject: [PATCH] preload mob spawning position +No need diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java index 458b17dca84c87591b030679c5aac6259c0f8308..c69922ac2b831d8af35c9e98a34825e6b8a268da 100644 diff --git a/leaf-server/minecraft-patches/features/0185-Add-BlockExplosionHitEvent.patch b/leaf-server/minecraft-patches/features/0184-Add-BlockExplosionHitEvent.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0185-Add-BlockExplosionHitEvent.patch rename to leaf-server/minecraft-patches/features/0184-Add-BlockExplosionHitEvent.patch diff --git a/leaf-server/minecraft-patches/features/0186-Old-Blast-Protection-explosion-knockback.patch b/leaf-server/minecraft-patches/features/0185-Old-Blast-Protection-explosion-knockback.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0186-Old-Blast-Protection-explosion-knockback.patch rename to leaf-server/minecraft-patches/features/0185-Old-Blast-Protection-explosion-knockback.patch index 188eb903..09ef9a74 100644 --- a/leaf-server/minecraft-patches/features/0186-Old-Blast-Protection-explosion-knockback.patch +++ b/leaf-server/minecraft-patches/features/0185-Old-Blast-Protection-explosion-knockback.patch @@ -17,7 +17,7 @@ index 0a5611b1ece4dbe2887e7fbdef45f58e7f4d53ad..9f6fc274525f2fe4e4e35e0feaa410bf public static final StringRepresentable.EnumCodec CODEC = StringRepresentable.fromEnum(EquipmentSlot::values); public static final StreamCodec STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, equipmentSlot -> equipmentSlot.id); diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index a43192a4c0b89cf9436e1e3144037420005d85d9..6ca263eead9b1fe527cc16a659eb9f55496a180a 100644 +index f76ec9520f6a2ee42ed3ba65068c01f4b9bc8746..18f11006f0f4b3214c311f2db193df11736cd75c 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java @@ -532,7 +532,7 @@ public class ServerExplosion implements Explosion { diff --git a/leaf-server/minecraft-patches/features/0187-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0186-Paw-optimization.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0187-Paw-optimization.patch rename to leaf-server/minecraft-patches/features/0186-Paw-optimization.patch diff --git a/leaf-server/minecraft-patches/features/0188-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0187-Use-UUID-for-cure-reputation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0188-Use-UUID-for-cure-reputation.patch rename to leaf-server/minecraft-patches/features/0187-Use-UUID-for-cure-reputation.patch diff --git a/leaf-server/minecraft-patches/features/0189-Cache-potential-behaviors-in-Brain.patch b/leaf-server/minecraft-patches/features/0188-Cache-potential-behaviors-in-Brain.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0189-Cache-potential-behaviors-in-Brain.patch rename to leaf-server/minecraft-patches/features/0188-Cache-potential-behaviors-in-Brain.patch diff --git a/leaf-server/minecraft-patches/features/0190-Use-ActivationList-on-runningBehaviors.patch b/leaf-server/minecraft-patches/features/0189-Use-ActivationList-on-runningBehaviors.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0190-Use-ActivationList-on-runningBehaviors.patch rename to leaf-server/minecraft-patches/features/0189-Use-ActivationList-on-runningBehaviors.patch diff --git a/leaf-server/minecraft-patches/features/0191-Paper-Fix-infinite-loop-in-RegionFile-IO.patch b/leaf-server/minecraft-patches/features/0190-Paper-Fix-infinite-loop-in-RegionFile-IO.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0191-Paper-Fix-infinite-loop-in-RegionFile-IO.patch rename to leaf-server/minecraft-patches/features/0190-Paper-Fix-infinite-loop-in-RegionFile-IO.patch diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/PreloadNaturalMobSpawning.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/PreloadNaturalMobSpawning.java deleted file mode 100644 index 50a5742e..00000000 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/PreloadNaturalMobSpawning.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.dreeam.leaf.config.modules.opt; - -import org.dreeam.leaf.config.ConfigModules; -import org.dreeam.leaf.config.EnumConfigCategory; - -public class PreloadNaturalMobSpawning extends ConfigModules { - public String getBasePath() { - return EnumConfigCategory.PERF.getBaseKeyName() + ".preload-mob-spawning-position"; - } - - public static boolean enabled = false; - - @Override - public void onLoaded() { - enabled = config.getBoolean(getBasePath() + ".enabled", enabled); - } -} From ab24c46fb54bc9606a6e0d1aad885e4f9d30ef61 Mon Sep 17 00:00:00 2001 From: hayanesuru Date: Wed, 11 Jun 2025 12:48:38 +0900 Subject: [PATCH 04/16] remove shutdown log if mob spawning disabled --- .../main/java/gg/pufferfish/pufferfish/util/AsyncExecutor.java | 2 +- .../src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/leaf-server/src/main/java/gg/pufferfish/pufferfish/util/AsyncExecutor.java b/leaf-server/src/main/java/gg/pufferfish/pufferfish/util/AsyncExecutor.java index 2b57a863..85d37d3d 100644 --- a/leaf-server/src/main/java/gg/pufferfish/pufferfish/util/AsyncExecutor.java +++ b/leaf-server/src/main/java/gg/pufferfish/pufferfish/util/AsyncExecutor.java @@ -13,7 +13,7 @@ public class AsyncExecutor implements Runnable { private final Logger LOGGER = LogManager.getLogger("Leaf"); private final PriorityQueue jobs = PriorityQueues.synchronize(new ObjectArrayFIFOQueue<>()); - private final Thread thread; + public final Thread thread; private volatile boolean killswitch = false; public AsyncExecutor(String threadName) { diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java b/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java index be79ba70..3103e125 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/ShutdownExecutors.java @@ -14,7 +14,7 @@ public class ShutdownExecutors { public static final Logger LOGGER = LogManager.getLogger("Leaf"); public static void shutdown(MinecraftServer server) { - if (server.mobSpawnExecutor != null) { + if (server.mobSpawnExecutor != null && server.mobSpawnExecutor.thread.isAlive()) { LOGGER.info("Waiting for mob spawning thread to shutdown..."); try { server.mobSpawnExecutor.join(3000L); From 46e876280c18d0812808a5a793e24516b3e6f561 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Wed, 11 Jun 2025 20:56:06 +0800 Subject: [PATCH 05/16] [ci skip] Update license information --- LICENSE.md | 7 +- README.md | 6 +- ...he-for-kickPermission-instead-of-usi.patch | 17 ++ licenses/Apache-2.0.txt | 202 ++++++++++++++++++ public/readme/README_CN.md | 6 +- 5 files changed, 229 insertions(+), 9 deletions(-) create mode 100644 licenses/Apache-2.0.txt diff --git a/LICENSE.md b/LICENSE.md index be435f08..dce2fa9d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,10 @@ # Leaf license +Leaf inherits licenses from upstream projects. + Paperweight files are licensed under [MIT](https://opensource.org/licenses/MIT) (included in `license/MIT.txt`). -Patches are licensed under MIT, unless indicated differently in their header (some patches are licensed under [GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.html) (included in `license/GPL-3.0.txt`) or [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html) (included in `license/LGPL-3.0.txt`)). +Patches are licensed under MIT, unless indicated differently in their header (some patches are licensed under [GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.html) (included in `license/GPL-3.0.txt`), [LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.html) (included in `license/LGPL-3.0.txt`), or [Apache-2.0](https://www.apache.org/licenses/) (included in `license/Apache-2.0.txt`)). +Certain patches are derived from other projects and retain the original licenses, as noted in the patch header. Binaries are licensed under GPL-3.0. + +Also see [PaperMC/Paper](https://github.com/PaperMC/Paper), [PaperMC/paperweight](https://github.com/PaperMC/paperweight), and the repositories of other dependencies used by this project for their respective licenses. diff --git a/README.md b/README.md index c974508f..6d21354f 100644 --- a/README.md +++ b/README.md @@ -87,11 +87,9 @@ java { ``` ## ⚖️ License -Paperweight files are licensed under [MIT](licenses/MIT.txt). -Patches are licensed under [MIT](licenses/MIT.txt), unless indicated differently in their header. -Binaries are licensed under [GPL-3.0](licenses/GPL-3.0.txt). +Leaf is licensed under multiple open source licenses depending on upstream projects and other materials, -Also see [PaperMC/Paper](https://github.com/PaperMC/Paper) and [PaperMC/paperweight](https://github.com/PaperMC/paperweight) for the licenses of some materials used by this project. +see [LICENSE.md](LICENSE.md) for full license information. ## 📜 Credits Thanks to these projects below. Leaf includes some patches taken from them.
diff --git a/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch b/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch index 775ac9f6..9f5834ef 100644 --- a/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch +++ b/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch @@ -4,6 +4,23 @@ Date: Sun, 23 Jun 2024 11:26:20 +0800 Subject: [PATCH] Use caffeine cache for kickPermission instead of using google.common.cache +This patch includes code that references the Caffeine caching library, +which is licensed under the Apache License, Version 2.0. + +Caffeine (https://github.com/ben-manes/caffeine) +Copyright (c) Ben Manes + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 24aca7ba2cc3ec5f05bb4ea7d373feb730d8dd90..c30e017e6cffa6aa828b0f6e8889885dbaaa4680 100644 diff --git a/licenses/Apache-2.0.txt b/licenses/Apache-2.0.txt new file mode 100644 index 00000000..c3850578 --- /dev/null +++ b/licenses/Apache-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/public/readme/README_CN.md b/public/readme/README_CN.md index 4b1be0f8..74cba815 100644 --- a/public/readme/README_CN.md +++ b/public/readme/README_CN.md @@ -87,11 +87,9 @@ java { ``` ## ⚖️ 许可证 -Paperweight 文件基于 [MIT](licenses/MIT.txt) 许可证。 -补丁基于 [MIT](licenses/MIT.txt) 许可证,除非在补丁顶部注释中另有说明。 -二进制文件基于 [GPL-3.0](licenses/GPL-3.0.txt) 许可证。 +Leaf 根据其上游项目及其他材料,采用多种开源许可证授权, -另请参阅 [PaperMC/Paper](https://github.com/PaperMC/Paper) 和 [PaperMC/paperweight](https://github.com/PaperMC/paperweight) 了解本项目使用的一些材料的许可证。 +请参阅 [LICENSE.md](../../LICENSE.md) 获取完整的许可信息。 ## 📜 致谢 感谢以下项目。Leaf 包含了一些取自这些项目的补丁。
From 66856d9382e2cd8bf9327317a4bb74e24d987b92 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:00:48 +0800 Subject: [PATCH 06/16] [ci skip] Add missing license notice header --- .../0048-Cache-player-profileResult.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch b/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch index 36ccec15..dee7238a 100644 --- a/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch +++ b/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch @@ -3,6 +3,23 @@ From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:36:09 -0400 Subject: [PATCH] Cache player profileResult +This patch includes code that references the Caffeine caching library, +which is licensed under the Apache License, Version 2.0. + +Caffeine (https://github.com/ben-manes/caffeine) +Copyright (c) Ben Manes + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java index 069477e524a28b20a0289221858bdc802704a890..114b25f933c6a1b011523581a5a02a5a2c1e827e 100644 From 0dae9854269c55edc7c3933c15a8cf1b436b144d Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Wed, 11 Jun 2025 21:02:33 +0800 Subject: [PATCH 07/16] [ci skip] Fix --- .../0074-Airplane-Remove-stream-in-PoiCompetitorScan.patch | 2 +- .../features/0005-Pufferfish-Dynamic-Activation-of-Brain.patch | 2 +- .../features/0048-Cache-player-profileResult.patch | 2 +- ...2-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch | 2 +- licenses/Apache-2.0.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/leaf-archived-patches/removed/hardfork/server/0074-Airplane-Remove-stream-in-PoiCompetitorScan.patch b/leaf-archived-patches/removed/hardfork/server/0074-Airplane-Remove-stream-in-PoiCompetitorScan.patch index 4264fe76..7e8ae181 100644 --- a/leaf-archived-patches/removed/hardfork/server/0074-Airplane-Remove-stream-in-PoiCompetitorScan.patch +++ b/leaf-archived-patches/removed/hardfork/server/0074-Airplane-Remove-stream-in-PoiCompetitorScan.patch @@ -28,7 +28,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program. If not, see . +along with this program. If not, see . diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/PoiCompetitorScan.java b/src/main/java/net/minecraft/world/entity/ai/behavior/PoiCompetitorScan.java index 7302d397d39d8400527ab2da4adaf8d792256749..faeb1d42d8361c02b63e33059edaeff78e719c71 100644 diff --git a/leaf-server/minecraft-patches/features/0005-Pufferfish-Dynamic-Activation-of-Brain.patch b/leaf-server/minecraft-patches/features/0005-Pufferfish-Dynamic-Activation-of-Brain.patch index 515b5091..5bba7a99 100644 --- a/leaf-server/minecraft-patches/features/0005-Pufferfish-Dynamic-Activation-of-Brain.patch +++ b/leaf-server/minecraft-patches/features/0005-Pufferfish-Dynamic-Activation-of-Brain.patch @@ -29,7 +29,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program. If not, see . +along with this program. If not, see . diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java index 6db99585fa47fe2d2ae6eff8efe16190dd756511..a9269356de964585028e69a3713ca64f67ba02bf 100644 diff --git a/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch b/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch index dee7238a..5b903ec9 100644 --- a/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch +++ b/leaf-server/minecraft-patches/features/0048-Cache-player-profileResult.patch @@ -13,7 +13,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch b/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch index 9f5834ef..fbcb9faa 100644 --- a/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch +++ b/leaf-server/minecraft-patches/features/0072-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch @@ -14,7 +14,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/licenses/Apache-2.0.txt b/licenses/Apache-2.0.txt index c3850578..62589edd 100644 --- a/licenses/Apache-2.0.txt +++ b/licenses/Apache-2.0.txt @@ -193,7 +193,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, From b26a5063d1ccf4c6717f13740fcc9621aba168b5 Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Wed, 11 Jun 2025 18:13:19 +0200 Subject: [PATCH 08/16] fix citizens requesting treemap from maps --- .../0070-Replace-brain-maps-with-optimized-collection.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch index 653864fd..d3c61cfe 100644 --- a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch +++ b/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Replace brain maps with optimized collection diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 083eb9a7a0bc14d30db944f356d98ca552fa1784..778e3b99a7f941a53b87cbec510db8deed5d77c8 100644 +index 083eb9a7a0bc14d30db944f356d98ca552fa1784..0f50db187e04582e9b66a63201af987f6db74939 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -45,14 +45,18 @@ public class Brain { @@ -18,7 +18,7 @@ index 083eb9a7a0bc14d30db944f356d98ca552fa1784..778e3b99a7f941a53b87cbec510db8de + // Leaf start - Replace brain maps with optimized collection + private final Map, Optional>> memories = new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(); + private final Map>, Sensor> sensors = new it.unimi.dsi.fastutil.objects.Reference2ReferenceLinkedOpenHashMap<>(); -+ private final Map>>> availableBehaviorsByPriority = new it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<>(); ++ private final Map>>> availableBehaviorsByPriority = org.dreeam.leaf.config.modules.async.MultithreadedTracker.compatModeEnabled ? Maps.newTreeMap() : new it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<>(); + // Leaf end - Replace brain maps with optimized collection private Schedule schedule = Schedule.EMPTY; - private final Map, MemoryStatus>>> activityRequirements = Maps.newHashMap(); From 71e5da40da55d982e3b1aea154d68d45acc638aa Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Wed, 11 Jun 2025 20:59:22 +0200 Subject: [PATCH 09/16] Paper: Fix excess slot updates / inventory state id desync --- ...-slot-updates-inventory-state-id-des.patch | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 leaf-server/minecraft-patches/features/0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch diff --git a/leaf-server/minecraft-patches/features/0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch b/leaf-server/minecraft-patches/features/0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch new file mode 100644 index 00000000..d921c5df --- /dev/null +++ b/leaf-server/minecraft-patches/features/0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Taiyou06 +Date: Wed, 11 Jun 2025 20:51:36 +0200 +Subject: [PATCH] Paper: Fix excess slot updates / inventory state id desync + +Original Patch: https://github.com/PaperMC/Paper/pull/12654 + +diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java +index ff2ff95ec9d94e2e31e8174196b384c37d56f38a..2a49a0bdeb61c4fadddc241c8ebca908959d7e9c 100644 +--- a/net/minecraft/world/inventory/AbstractContainerMenu.java ++++ b/net/minecraft/world/inventory/AbstractContainerMenu.java +@@ -553,7 +553,7 @@ public abstract class AbstractContainerMenu { + + slot.setChanged(); + // CraftBukkit start - Make sure the client has the right slot contents +- if (player instanceof ServerPlayer serverPlayer && slot.getMaxStackSize() != 64) { ++ if (player instanceof ServerPlayer serverPlayer && slot.getMaxStackSize() != net.minecraft.world.Container.MAX_STACK) { + serverPlayer.connection.send(new ClientboundContainerSetSlotPacket(this.containerId, this.incrementStateId(), slot.index, slot.getItem())); + // Updating a crafting inventory makes the client reset the result slot, have to send it again + if (this.getBukkitView().getType() == org.bukkit.event.inventory.InventoryType.WORKBENCH || this.getBukkitView().getType() == org.bukkit.event.inventory.InventoryType.CRAFTING) { From a11f042109e6a7c397b7574436e9dd8c7800d1fd Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Fri, 13 Jun 2025 04:07:23 +0800 Subject: [PATCH 10/16] Fix entity bounding box traverse blocks iterate Reset both x and y values on z level iteration , to prevent skip entire y level loop on z level iteration and cause some issues, e.g. inconsistent with vanilla --- .../leaf/util/map/BlockPosIterator.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/leaf-server/src/main/java/org/dreeam/leaf/util/map/BlockPosIterator.java b/leaf-server/src/main/java/org/dreeam/leaf/util/map/BlockPosIterator.java index 7e4b0baf..2165d64e 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/util/map/BlockPosIterator.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/util/map/BlockPosIterator.java @@ -46,25 +46,25 @@ public final class BlockPosIterator extends AbstractIterator { MutableBlockPos pos = this.pos; if (pos == null) { return this.pos = new MutableBlockPos(this.startX, this.startY, this.startZ); - } else { - int x = pos.getX(); - int y = pos.getY(); - int z = pos.getZ(); - - if (y < this.endY) { - y += 1; - } else if (x < this.endX) { - x += 1; - y = this.startY; - } else if (z < this.endZ) { - z += 1; - x = this.startX; - } else { - return this.endOfData(); - } - - pos.set(x, y, z); - return pos; } + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + if (y < this.endY) { + y += 1; + } else if (x < this.endX) { + x += 1; + y = this.startY; + } else if (z < this.endZ) { + z += 1; + x = this.startX; + y = this.startY; // Reset y also! + } else { + return this.endOfData(); + } + + pos.set(x, y, z); + return pos; } } From 15ef4ca9012e738aec994cda8d17d6e752ef26d9 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Fri, 13 Jun 2025 07:57:11 +0800 Subject: [PATCH 11/16] Optimize more for rail optimization (#368) * Optimize more for rail optimization * remove threadlocal --- .../world/block/OptimizedPoweredRails.java | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java b/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java index f888ff94..9580adc4 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java @@ -1,5 +1,6 @@ package org.dreeam.leaf.world.block; +import it.unimi.dsi.fastutil.objects.Object2BooleanOpenHashMap; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.Level; @@ -8,8 +9,6 @@ import net.minecraft.world.level.block.PoweredRailBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.RailShape; -import java.util.HashMap; - import static net.minecraft.world.level.block.Block.*; import static net.minecraft.world.level.block.PoweredRailBlock.POWERED; import static net.minecraft.world.level.block.PoweredRailBlock.SHAPE; @@ -23,6 +22,8 @@ public class OptimizedPoweredRails { private static int RAIL_POWER_LIMIT = 8; + private static final Object2BooleanOpenHashMap CHECKED_POS_POOL = new Object2BooleanOpenHashMap<>(); + private static void giveShapeUpdate(Level level, BlockState state, BlockPos pos, BlockPos fromPos, Direction direction) { BlockState oldState = level.getBlockState(pos); Block.updateOrDestroy( @@ -45,8 +46,8 @@ public class OptimizedPoweredRails { public static void updateState(PoweredRailBlock self, BlockState state, Level level, BlockPos pos) { boolean shouldBePowered = level.hasNeighborSignal(pos) || - self.findPoweredRailSignal(level, pos, state, true, 0) || - self.findPoweredRailSignal(level, pos, state, false, 0); + findPoweredRailSignalFaster(self, level, pos, state, true, 0, CHECKED_POS_POOL) || + findPoweredRailSignalFaster(self, level, pos, state, false, 0, CHECKED_POS_POOL); if (shouldBePowered != state.getValue(POWERED)) { RailShape railShape = state.getValue(SHAPE); if (railShape.isSlope()) { @@ -63,9 +64,9 @@ public class OptimizedPoweredRails { private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level world, BlockPos pos, boolean bl, int distance, RailShape shape, - HashMap checkedPos) { + Object2BooleanOpenHashMap checkedPos) { BlockState blockState = world.getBlockState(pos); - boolean speedCheck = checkedPos.containsKey(pos) && checkedPos.get(pos); + boolean speedCheck = checkedPos.containsKey(pos) && checkedPos.getBoolean(pos); if (speedCheck) { return world.hasNeighborSignal(pos) || findPoweredRailSignalFaster(self, world, pos, blockState, bl, distance + 1, checkedPos); @@ -95,7 +96,7 @@ public class OptimizedPoweredRails { private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, boolean bl, int distance, - HashMap checkedPos) { + Object2BooleanOpenHashMap checkedPos) { if (distance >= RAIL_POWER_LIMIT - 1) return false; int i = pos.getX(); int j = pos.getY(); @@ -165,7 +166,8 @@ public class OptimizedPoweredRails { private static void powerLane(PoweredRailBlock self, Level world, BlockPos pos, BlockState mainState, RailShape railShape) { world.setBlock(pos, mainState.setValue(POWERED, true), UPDATE_FORCE_PLACE); - HashMap checkedPos = new HashMap<>(); + Object2BooleanOpenHashMap checkedPos = CHECKED_POS_POOL; + checkedPos.clear(); checkedPos.put(pos, true); int[] count = new int[2]; if (railShape == RailShape.NORTH_SOUTH) { // Order: +z, -z @@ -179,6 +181,7 @@ public class OptimizedPoweredRails { } updateRails(self, true, world, pos, mainState, count); } + checkedPos.clear(); } private static void dePowerLane(PoweredRailBlock self, Level world, BlockPos pos, @@ -199,39 +202,46 @@ public class OptimizedPoweredRails { } private static void setRailPositionsPower(PoweredRailBlock self, Level world, BlockPos pos, - HashMap checkedPos, int[] count, int i, Direction dir) { + Object2BooleanOpenHashMap checkedPos, int[] count, int i, Direction dir) { for (int z = 1; z < RAIL_POWER_LIMIT; z++) { BlockPos newPos = pos.relative(dir, z); BlockState state = world.getBlockState(newPos); if (checkedPos.containsKey(newPos)) { - if (!checkedPos.get(newPos)) break; + if (!checkedPos.getBoolean(newPos)) + break; count[i]++; - } else if (!state.is(self) || state.getValue(POWERED) || !( - world.hasNeighborSignal(newPos) || + } else if (!state.is(self) || state.getValue(POWERED) || !(world.hasNeighborSignal(newPos) || findPoweredRailSignalFaster(self, world, newPos, state, true, 0, checkedPos) || - findPoweredRailSignalFaster(self, world, newPos, state, false, 0, checkedPos) - )) { + findPoweredRailSignalFaster(self, world, newPos, state, false, 0, checkedPos))) { checkedPos.put(newPos, false); break; } else { checkedPos.put(newPos, true); - world.setBlock(newPos, state.setValue(POWERED, true), UPDATE_FORCE_PLACE); + if (!state.getValue(POWERED)) { + world.setBlock(newPos, state.setValue(POWERED, true), UPDATE_FORCE_PLACE); + } count[i]++; } } } private static void setRailPositionsDePower(PoweredRailBlock self, Level world, BlockPos pos, - int[] count, int i, Direction dir) { + int[] count, int i, Direction dir) { + Object2BooleanOpenHashMap checkedPos = CHECKED_POS_POOL; + checkedPos.clear(); for (int z = 1; z < RAIL_POWER_LIMIT; z++) { BlockPos newPos = pos.relative(dir, z); BlockState state = world.getBlockState(newPos); if (!state.is(self) || !state.getValue(POWERED) || world.hasNeighborSignal(newPos) || - self.findPoweredRailSignal(world, newPos, state, true, 0) || - self.findPoweredRailSignal(world, newPos, state, false, 0)) break; - world.setBlock(newPos, state.setValue(POWERED, false), UPDATE_FORCE_PLACE); + findPoweredRailSignalFaster(self, world, newPos, state, true, 0, checkedPos) || + findPoweredRailSignalFaster(self, world, newPos, state, false, 0, checkedPos)) + break; + if (state.getValue(POWERED)) { + world.setBlock(newPos, state.setValue(POWERED, false), UPDATE_FORCE_PLACE); + } count[i]++; } + checkedPos.clear(); } private static void shapeUpdateEnd(PoweredRailBlock self, Level world, BlockPos pos, BlockState mainState, From df7eef099c1e12681a18e4806a9d3e84a3408f6b Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Fri, 13 Jun 2025 09:54:39 +0200 Subject: [PATCH 12/16] fix it when it's off too --- .../0070-Replace-brain-maps-with-optimized-collection.patch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch index d3c61cfe..1e725029 100644 --- a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch +++ b/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Replace brain maps with optimized collection diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 083eb9a7a0bc14d30db944f356d98ca552fa1784..0f50db187e04582e9b66a63201af987f6db74939 100644 +index 083eb9a7a0bc14d30db944f356d98ca552fa1784..10986e50bd3307f81074c4cb371eb4d7defc9cfc 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -45,14 +45,18 @@ public class Brain { @@ -14,11 +14,10 @@ index 083eb9a7a0bc14d30db944f356d98ca552fa1784..0f50db187e04582e9b66a63201af987f private static final int SCHEDULE_UPDATE_DELAY = 20; - private final Map, Optional>> memories = Maps.newHashMap(); - private final Map>, Sensor> sensors = Maps.newLinkedHashMap(); -- private final Map>>> availableBehaviorsByPriority = Maps.newTreeMap(); + // Leaf start - Replace brain maps with optimized collection + private final Map, Optional>> memories = new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(); + private final Map>, Sensor> sensors = new it.unimi.dsi.fastutil.objects.Reference2ReferenceLinkedOpenHashMap<>(); -+ private final Map>>> availableBehaviorsByPriority = org.dreeam.leaf.config.modules.async.MultithreadedTracker.compatModeEnabled ? Maps.newTreeMap() : new it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<>(); + private final Map>>> availableBehaviorsByPriority = Maps.newTreeMap(); + // Leaf end - Replace brain maps with optimized collection private Schedule schedule = Schedule.EMPTY; - private final Map, MemoryStatus>>> activityRequirements = Maps.newHashMap(); From 4308de7b7f81eb0a9b64da8f9346b4e037727614 Mon Sep 17 00:00:00 2001 From: hayanesuru Date: Fri, 13 Jun 2025 18:11:40 +0900 Subject: [PATCH 13/16] remove Lithium: equipment tracking (#367) --- .../server}/0101-Lithium-equipment-tracking.patch | 0 ...patch => 0101-C2ME-Optimize-world-gen-math.patch} | 0 ...he-chunk-key.patch => 0102-Cache-chunk-key.patch} | 0 ...tch => 0103-Cache-random-tick-block-status.patch} | 0 ... => 0104-Cache-part-of-canHoldFluid-result.patch} | 0 ...e.patch => 0105-Configurable-tripwire-dupe.patch} | 0 ...x-MC-117075-Block-Entities-Unload-Lag-Spik.patch} | 0 ...Sepals-Rearrange-the-attackable-conditions.patch} | 0 ...er-Skip-dirty-stats-copy-when-requesting-p.patch} | 0 ...er-Reset-dirty-flag-when-loading-maps-from.patch} | 0 ...imize-checking-nearby-players-for-spawning.patch} | 0 ...patch => 0111-Cache-supporting-block-check.patch} | 0 ...ess-deque-clear-on-LevelTicks-cleanupAfter.patch} | 0 ...ain-activity-maps-with-optimized-collectio.patch} | 2 +- ...s.patch => 0114-Remove-stream-in-villagers.patch} | 0 ...atch => 0115-Optimize-baby-villager-sensor.patch} | 0 ...ushable.patch => 0116-Only-player-pushable.patch} | 12 ++++++------ ...7-Remove-iterators-from-Inventory-contains.patch} | 0 ...-Cache-eligible-players-for-despawn-checks.patch} | 4 ++-- ...=> 0119-Slightly-optimise-getNearestPlayer.patch} | 0 ...Capacity-to-pre-populate-the-size-of-ticki.patch} | 0 ...se-the-pre-filtered-ticking-chunks-list-as.patch} | 0 ...tes-to-writeLongArray-during-chunk-loading.patch} | 0 ... => 0123-Improve-sorting-in-SortedArraySet.patch} | 0 ...atch => 0124-Make-removeIf-slightly-faster.patch} | 0 ...lette.patch => 0125-Optimize-LinearPalette.patch} | 0 ...ch => 0126-Slightly-optimized-VarInt-write.patch} | 0 ...7-Rewrite-ClientboundLightUpdatePacketData.patch} | 0 ...-chunk-send.patch => 0128-Async-chunk-send.patch} | 0 ...tions.patch => 0129-Spawner-Configurations.patch} | 0 ...> 0130-SparklyPaper-Parallel-world-ticking.patch} | 4 ++-- ...=> 0131-SparklyPaper-Track-each-world-MSPT.patch} | 0 ...x-cancelled-Projectile-Events-still-consum.patch} | 0 ...etLookAndInteract-and-NearestVisibleLiving.patch} | 0 ... 0134-Remove-streams-on-InsideBrownianWalk.patch} | 0 ....patch => 0135-Use-BFS-on-getSlopeDistance.patch} | 0 ...36-Paper-PR-Throttle-failed-spawn-attempts.patch} | 0 ...mprove-BlockEntity-ticking-isRemoved-check.patch} | 0 ... => 0138-Raytrace-AntiXray-SDK-integration.patch} | 0 ...0139-Optimize-addOrUpdateTransientModifier.patch} | 0 ...e.patch => 0140-Optimize-ContextMap.create.patch} | 0 ...> 0141-Micro-optimizations-for-random-tick.patch} | 0 ...reams-on-updateConnectedPlayersWithinRange.patch} | 0 ...h => 0143-Remove-streams-on-PlayerDetector.patch} | 0 ... 0144-Use-direct-iteration-on-Sensing.tick.patch} | 0 ... => 0145-Optimise-non-flush-packet-sending.patch} | 0 ...uble-chunk-retrieving-in-entity-fluid-push.patch} | 0 ...=> 0147-Null-handling-on-MultifaceSpreader.patch} | 0 ...threads.patch => 0148-More-virtual-threads.patch} | 0 ...finding.patch => 0149-Async-target-finding.patch} | 4 ++-- ...150-Optimize-ThreadedTicketLevelPropagator.patch} | 0 ...ise-MobEffectUtil-getDigSpeedAmplification.patch} | 0 ...nloads.patch => 0152-Optimise-chunkUnloads.patch} | 0 ...h => 0153-Optimize-BlockEntityType-isValid.patch} | 0 ...d-ticket-on-player-join-to-avoid-chunk-loa.patch} | 0 ...55-PaperPR-Fix-save-load-NaN-Entity-Motion.patch} | 0 ...156-PaperPR-Fix-unnecessary-map-data-saves.patch} | 0 ...imise-check-inside-blocks-and-traverse-blo.patch} | 0 ...y-EntityList-implementation-to-BasicEntity.patch} | 0 ...-Protocol-Core.patch => 0159-Protocol-Core.patch} | 0 ...s.patch => 0160-Reduce-PlayerChunk-Updates.patch} | 0 ...atch => 0161-Async-switch-connection-state.patch} | 0 ...0162-Optimize-BlockEntities-tickersInLevel.patch} | 0 ...k-if-the-cactus-can-even-survive-being-pla.patch} | 0 ...tch => 0164-Flush-location-while-knockback.patch} | 0 ...hand.patch => 0165-Only-tick-items-at-hand.patch} | 0 ...0166-Smart-sort-items-in-NearestItemSensor.patch} | 0 ...ch => 0167-Optimise-player-movement-checks.patch} | 0 ....patch => 0168-Remove-streams-in-MobSensor.patch} | 0 ...h => 0169-Remove-streams-in-TemptingSensor.patch} | 0 ... 0170-Use-HashedList-on-WeightedRandomList.patch} | 0 ...gurable-death-item-drop-knockback-settings.patch} | 0 ...=> 0172-Optimize-getScaledTrackingDistance.patch} | 0 ... 0173-Optimize-SynchedEntityData-packDirty.patch} | 0 ...nFluid.patch => 0174-Optimize-isEyeInFluid.patch} | 0 ...h-type.patch => 0175-Cache-block-path-type.patch} | 0 ...tus.patch => 0176-optimize-getEntityStatus.patch} | 0 ...imization-optimized-PoweredRailBlock-logic.patch} | 0 ... => 0178-optimise-ChunkGenerator-getMobsAt.patch} | 0 ...e-getBiome.patch => 0179-optimise-getBiome.patch} | 0 ...awning.patch => 0180-optimize-mob-spawning.patch} | 0 ...e-map.patch => 0181-optimize-structure-map.patch} | 0 ...awning.patch => 0182-throttle-mob-spawning.patch} | 0 ...t.patch => 0183-Add-BlockExplosionHitEvent.patch} | 0 ...4-Old-Blast-Protection-explosion-knockback.patch} | 0 ...ptimization.patch => 0185-Paw-optimization.patch} | 0 ...patch => 0186-Use-UUID-for-cure-reputation.patch} | 0 ...=> 0187-Cache-potential-behaviors-in-Brain.patch} | 2 +- ...188-Use-ActivationList-on-runningBehaviors.patch} | 2 +- ...9-Paper-Fix-infinite-loop-in-RegionFile-IO.patch} | 0 ...excess-slot-updates-inventory-state-id-des.patch} | 0 91 files changed, 15 insertions(+), 15 deletions(-) rename {leaf-server/minecraft-patches/features => leaf-archived-patches/work/server}/0101-Lithium-equipment-tracking.patch (100%) rename leaf-server/minecraft-patches/features/{0102-C2ME-Optimize-world-gen-math.patch => 0101-C2ME-Optimize-world-gen-math.patch} (100%) rename leaf-server/minecraft-patches/features/{0103-Cache-chunk-key.patch => 0102-Cache-chunk-key.patch} (100%) rename leaf-server/minecraft-patches/features/{0104-Cache-random-tick-block-status.patch => 0103-Cache-random-tick-block-status.patch} (100%) rename leaf-server/minecraft-patches/features/{0105-Cache-part-of-canHoldFluid-result.patch => 0104-Cache-part-of-canHoldFluid-result.patch} (100%) rename leaf-server/minecraft-patches/features/{0106-Configurable-tripwire-dupe.patch => 0105-Configurable-tripwire-dupe.patch} (100%) rename leaf-server/minecraft-patches/features/{0107-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch => 0106-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch} (100%) rename leaf-server/minecraft-patches/features/{0108-Sepals-Rearrange-the-attackable-conditions.patch => 0107-Sepals-Rearrange-the-attackable-conditions.patch} (100%) rename leaf-server/minecraft-patches/features/{0109-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch => 0108-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch} (100%) rename leaf-server/minecraft-patches/features/{0110-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch => 0109-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch} (100%) rename leaf-server/minecraft-patches/features/{0111-Optimize-checking-nearby-players-for-spawning.patch => 0110-Optimize-checking-nearby-players-for-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0112-Cache-supporting-block-check.patch => 0111-Cache-supporting-block-check.patch} (100%) rename leaf-server/minecraft-patches/features/{0113-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch => 0112-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch} (100%) rename leaf-server/minecraft-patches/features/{0114-Replace-brain-activity-maps-with-optimized-collectio.patch => 0113-Replace-brain-activity-maps-with-optimized-collectio.patch} (92%) rename leaf-server/minecraft-patches/features/{0115-Remove-stream-in-villagers.patch => 0114-Remove-stream-in-villagers.patch} (100%) rename leaf-server/minecraft-patches/features/{0116-Optimize-baby-villager-sensor.patch => 0115-Optimize-baby-villager-sensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0117-Only-player-pushable.patch => 0116-Only-player-pushable.patch} (89%) rename leaf-server/minecraft-patches/features/{0118-Remove-iterators-from-Inventory-contains.patch => 0117-Remove-iterators-from-Inventory-contains.patch} (100%) rename leaf-server/minecraft-patches/features/{0119-Cache-eligible-players-for-despawn-checks.patch => 0118-Cache-eligible-players-for-despawn-checks.patch} (96%) rename leaf-server/minecraft-patches/features/{0120-Slightly-optimise-getNearestPlayer.patch => 0119-Slightly-optimise-getNearestPlayer.patch} (100%) rename leaf-server/minecraft-patches/features/{0121-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch => 0120-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch} (100%) rename leaf-server/minecraft-patches/features/{0122-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch => 0121-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch} (100%) rename leaf-server/minecraft-patches/features/{0123-Bulk-writes-to-writeLongArray-during-chunk-loading.patch => 0122-Bulk-writes-to-writeLongArray-during-chunk-loading.patch} (100%) rename leaf-server/minecraft-patches/features/{0124-Improve-sorting-in-SortedArraySet.patch => 0123-Improve-sorting-in-SortedArraySet.patch} (100%) rename leaf-server/minecraft-patches/features/{0125-Make-removeIf-slightly-faster.patch => 0124-Make-removeIf-slightly-faster.patch} (100%) rename leaf-server/minecraft-patches/features/{0126-Optimize-LinearPalette.patch => 0125-Optimize-LinearPalette.patch} (100%) rename leaf-server/minecraft-patches/features/{0127-Slightly-optimized-VarInt-write.patch => 0126-Slightly-optimized-VarInt-write.patch} (100%) rename leaf-server/minecraft-patches/features/{0128-Rewrite-ClientboundLightUpdatePacketData.patch => 0127-Rewrite-ClientboundLightUpdatePacketData.patch} (100%) rename leaf-server/minecraft-patches/features/{0129-Async-chunk-send.patch => 0128-Async-chunk-send.patch} (100%) rename leaf-server/minecraft-patches/features/{0130-Spawner-Configurations.patch => 0129-Spawner-Configurations.patch} (100%) rename leaf-server/minecraft-patches/features/{0131-SparklyPaper-Parallel-world-ticking.patch => 0130-SparklyPaper-Parallel-world-ticking.patch} (99%) rename leaf-server/minecraft-patches/features/{0132-SparklyPaper-Track-each-world-MSPT.patch => 0131-SparklyPaper-Track-each-world-MSPT.patch} (100%) rename leaf-server/minecraft-patches/features/{0133-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch => 0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch} (100%) rename leaf-server/minecraft-patches/features/{0134-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch => 0133-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch} (100%) rename leaf-server/minecraft-patches/features/{0135-Remove-streams-on-InsideBrownianWalk.patch => 0134-Remove-streams-on-InsideBrownianWalk.patch} (100%) rename leaf-server/minecraft-patches/features/{0136-Use-BFS-on-getSlopeDistance.patch => 0135-Use-BFS-on-getSlopeDistance.patch} (100%) rename leaf-server/minecraft-patches/features/{0137-Paper-PR-Throttle-failed-spawn-attempts.patch => 0136-Paper-PR-Throttle-failed-spawn-attempts.patch} (100%) rename leaf-server/minecraft-patches/features/{0138-Improve-BlockEntity-ticking-isRemoved-check.patch => 0137-Improve-BlockEntity-ticking-isRemoved-check.patch} (100%) rename leaf-server/minecraft-patches/features/{0139-Raytrace-AntiXray-SDK-integration.patch => 0138-Raytrace-AntiXray-SDK-integration.patch} (100%) rename leaf-server/minecraft-patches/features/{0140-Optimize-addOrUpdateTransientModifier.patch => 0139-Optimize-addOrUpdateTransientModifier.patch} (100%) rename leaf-server/minecraft-patches/features/{0141-Optimize-ContextMap.create.patch => 0140-Optimize-ContextMap.create.patch} (100%) rename leaf-server/minecraft-patches/features/{0142-Micro-optimizations-for-random-tick.patch => 0141-Micro-optimizations-for-random-tick.patch} (100%) rename leaf-server/minecraft-patches/features/{0143-Remove-streams-on-updateConnectedPlayersWithinRange.patch => 0142-Remove-streams-on-updateConnectedPlayersWithinRange.patch} (100%) rename leaf-server/minecraft-patches/features/{0144-Remove-streams-on-PlayerDetector.patch => 0143-Remove-streams-on-PlayerDetector.patch} (100%) rename leaf-server/minecraft-patches/features/{0145-Use-direct-iteration-on-Sensing.tick.patch => 0144-Use-direct-iteration-on-Sensing.tick.patch} (100%) rename leaf-server/minecraft-patches/features/{0146-Optimise-non-flush-packet-sending.patch => 0145-Optimise-non-flush-packet-sending.patch} (100%) rename leaf-server/minecraft-patches/features/{0147-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch => 0146-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch} (100%) rename leaf-server/minecraft-patches/features/{0148-Null-handling-on-MultifaceSpreader.patch => 0147-Null-handling-on-MultifaceSpreader.patch} (100%) rename leaf-server/minecraft-patches/features/{0149-More-virtual-threads.patch => 0148-More-virtual-threads.patch} (100%) rename leaf-server/minecraft-patches/features/{0150-Async-target-finding.patch => 0149-Async-target-finding.patch} (99%) rename leaf-server/minecraft-patches/features/{0151-Optimize-ThreadedTicketLevelPropagator.patch => 0150-Optimize-ThreadedTicketLevelPropagator.patch} (100%) rename leaf-server/minecraft-patches/features/{0152-Optimise-MobEffectUtil-getDigSpeedAmplification.patch => 0151-Optimise-MobEffectUtil-getDigSpeedAmplification.patch} (100%) rename leaf-server/minecraft-patches/features/{0153-Optimise-chunkUnloads.patch => 0152-Optimise-chunkUnloads.patch} (100%) rename leaf-server/minecraft-patches/features/{0154-Optimize-BlockEntityType-isValid.patch => 0153-Optimize-BlockEntityType-isValid.patch} (100%) rename leaf-server/minecraft-patches/features/{0155-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch => 0154-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch} (100%) rename leaf-server/minecraft-patches/features/{0156-PaperPR-Fix-save-load-NaN-Entity-Motion.patch => 0155-PaperPR-Fix-save-load-NaN-Entity-Motion.patch} (100%) rename leaf-server/minecraft-patches/features/{0157-PaperPR-Fix-unnecessary-map-data-saves.patch => 0156-PaperPR-Fix-unnecessary-map-data-saves.patch} (100%) rename leaf-server/minecraft-patches/features/{0158-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch => 0157-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch} (100%) rename leaf-server/minecraft-patches/features/{0159-Sakura-copy-EntityList-implementation-to-BasicEntity.patch => 0158-Sakura-copy-EntityList-implementation-to-BasicEntity.patch} (100%) rename leaf-server/minecraft-patches/features/{0160-Protocol-Core.patch => 0159-Protocol-Core.patch} (100%) rename leaf-server/minecraft-patches/features/{0161-Reduce-PlayerChunk-Updates.patch => 0160-Reduce-PlayerChunk-Updates.patch} (100%) rename leaf-server/minecraft-patches/features/{0162-Async-switch-connection-state.patch => 0161-Async-switch-connection-state.patch} (100%) rename leaf-server/minecraft-patches/features/{0163-Optimize-BlockEntities-tickersInLevel.patch => 0162-Optimize-BlockEntities-tickersInLevel.patch} (100%) rename leaf-server/minecraft-patches/features/{0164-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch => 0163-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch} (100%) rename leaf-server/minecraft-patches/features/{0165-Flush-location-while-knockback.patch => 0164-Flush-location-while-knockback.patch} (100%) rename leaf-server/minecraft-patches/features/{0166-Only-tick-items-at-hand.patch => 0165-Only-tick-items-at-hand.patch} (100%) rename leaf-server/minecraft-patches/features/{0167-Smart-sort-items-in-NearestItemSensor.patch => 0166-Smart-sort-items-in-NearestItemSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0168-Optimise-player-movement-checks.patch => 0167-Optimise-player-movement-checks.patch} (100%) rename leaf-server/minecraft-patches/features/{0169-Remove-streams-in-MobSensor.patch => 0168-Remove-streams-in-MobSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0170-Remove-streams-in-TemptingSensor.patch => 0169-Remove-streams-in-TemptingSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0171-Use-HashedList-on-WeightedRandomList.patch => 0170-Use-HashedList-on-WeightedRandomList.patch} (100%) rename leaf-server/minecraft-patches/features/{0172-Add-configurable-death-item-drop-knockback-settings.patch => 0171-Add-configurable-death-item-drop-knockback-settings.patch} (100%) rename leaf-server/minecraft-patches/features/{0173-Optimize-getScaledTrackingDistance.patch => 0172-Optimize-getScaledTrackingDistance.patch} (100%) rename leaf-server/minecraft-patches/features/{0174-Optimize-SynchedEntityData-packDirty.patch => 0173-Optimize-SynchedEntityData-packDirty.patch} (100%) rename leaf-server/minecraft-patches/features/{0175-Optimize-isEyeInFluid.patch => 0174-Optimize-isEyeInFluid.patch} (100%) rename leaf-server/minecraft-patches/features/{0176-Cache-block-path-type.patch => 0175-Cache-block-path-type.patch} (100%) rename leaf-server/minecraft-patches/features/{0177-optimize-getEntityStatus.patch => 0176-optimize-getEntityStatus.patch} (100%) rename leaf-server/minecraft-patches/features/{0178-Rail-Optimization-optimized-PoweredRailBlock-logic.patch => 0177-Rail-Optimization-optimized-PoweredRailBlock-logic.patch} (100%) rename leaf-server/minecraft-patches/features/{0179-optimise-ChunkGenerator-getMobsAt.patch => 0178-optimise-ChunkGenerator-getMobsAt.patch} (100%) rename leaf-server/minecraft-patches/features/{0180-optimise-getBiome.patch => 0179-optimise-getBiome.patch} (100%) rename leaf-server/minecraft-patches/features/{0181-optimize-mob-spawning.patch => 0180-optimize-mob-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0182-optimize-structure-map.patch => 0181-optimize-structure-map.patch} (100%) rename leaf-server/minecraft-patches/features/{0183-throttle-mob-spawning.patch => 0182-throttle-mob-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0184-Add-BlockExplosionHitEvent.patch => 0183-Add-BlockExplosionHitEvent.patch} (100%) rename leaf-server/minecraft-patches/features/{0185-Old-Blast-Protection-explosion-knockback.patch => 0184-Old-Blast-Protection-explosion-knockback.patch} (100%) rename leaf-server/minecraft-patches/features/{0186-Paw-optimization.patch => 0185-Paw-optimization.patch} (100%) rename leaf-server/minecraft-patches/features/{0187-Use-UUID-for-cure-reputation.patch => 0186-Use-UUID-for-cure-reputation.patch} (100%) rename leaf-server/minecraft-patches/features/{0188-Cache-potential-behaviors-in-Brain.patch => 0187-Cache-potential-behaviors-in-Brain.patch} (97%) rename leaf-server/minecraft-patches/features/{0189-Use-ActivationList-on-runningBehaviors.patch => 0188-Use-ActivationList-on-runningBehaviors.patch} (98%) rename leaf-server/minecraft-patches/features/{0190-Paper-Fix-infinite-loop-in-RegionFile-IO.patch => 0189-Paper-Fix-infinite-loop-in-RegionFile-IO.patch} (100%) rename leaf-server/minecraft-patches/features/{0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch => 0190-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch} (100%) diff --git a/leaf-server/minecraft-patches/features/0101-Lithium-equipment-tracking.patch b/leaf-archived-patches/work/server/0101-Lithium-equipment-tracking.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0101-Lithium-equipment-tracking.patch rename to leaf-archived-patches/work/server/0101-Lithium-equipment-tracking.patch diff --git a/leaf-server/minecraft-patches/features/0102-C2ME-Optimize-world-gen-math.patch b/leaf-server/minecraft-patches/features/0101-C2ME-Optimize-world-gen-math.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0102-C2ME-Optimize-world-gen-math.patch rename to leaf-server/minecraft-patches/features/0101-C2ME-Optimize-world-gen-math.patch diff --git a/leaf-server/minecraft-patches/features/0103-Cache-chunk-key.patch b/leaf-server/minecraft-patches/features/0102-Cache-chunk-key.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0103-Cache-chunk-key.patch rename to leaf-server/minecraft-patches/features/0102-Cache-chunk-key.patch diff --git a/leaf-server/minecraft-patches/features/0104-Cache-random-tick-block-status.patch b/leaf-server/minecraft-patches/features/0103-Cache-random-tick-block-status.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0104-Cache-random-tick-block-status.patch rename to leaf-server/minecraft-patches/features/0103-Cache-random-tick-block-status.patch diff --git a/leaf-server/minecraft-patches/features/0105-Cache-part-of-canHoldFluid-result.patch b/leaf-server/minecraft-patches/features/0104-Cache-part-of-canHoldFluid-result.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0105-Cache-part-of-canHoldFluid-result.patch rename to leaf-server/minecraft-patches/features/0104-Cache-part-of-canHoldFluid-result.patch diff --git a/leaf-server/minecraft-patches/features/0106-Configurable-tripwire-dupe.patch b/leaf-server/minecraft-patches/features/0105-Configurable-tripwire-dupe.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0106-Configurable-tripwire-dupe.patch rename to leaf-server/minecraft-patches/features/0105-Configurable-tripwire-dupe.patch diff --git a/leaf-server/minecraft-patches/features/0107-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch b/leaf-server/minecraft-patches/features/0106-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0107-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch rename to leaf-server/minecraft-patches/features/0106-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch diff --git a/leaf-server/minecraft-patches/features/0108-Sepals-Rearrange-the-attackable-conditions.patch b/leaf-server/minecraft-patches/features/0107-Sepals-Rearrange-the-attackable-conditions.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0108-Sepals-Rearrange-the-attackable-conditions.patch rename to leaf-server/minecraft-patches/features/0107-Sepals-Rearrange-the-attackable-conditions.patch diff --git a/leaf-server/minecraft-patches/features/0109-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch b/leaf-server/minecraft-patches/features/0108-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0109-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch rename to leaf-server/minecraft-patches/features/0108-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch diff --git a/leaf-server/minecraft-patches/features/0110-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch b/leaf-server/minecraft-patches/features/0109-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0110-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch rename to leaf-server/minecraft-patches/features/0109-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch diff --git a/leaf-server/minecraft-patches/features/0111-Optimize-checking-nearby-players-for-spawning.patch b/leaf-server/minecraft-patches/features/0110-Optimize-checking-nearby-players-for-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0111-Optimize-checking-nearby-players-for-spawning.patch rename to leaf-server/minecraft-patches/features/0110-Optimize-checking-nearby-players-for-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0112-Cache-supporting-block-check.patch b/leaf-server/minecraft-patches/features/0111-Cache-supporting-block-check.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0112-Cache-supporting-block-check.patch rename to leaf-server/minecraft-patches/features/0111-Cache-supporting-block-check.patch diff --git a/leaf-server/minecraft-patches/features/0113-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch b/leaf-server/minecraft-patches/features/0112-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0113-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch rename to leaf-server/minecraft-patches/features/0112-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch diff --git a/leaf-server/minecraft-patches/features/0114-Replace-brain-activity-maps-with-optimized-collectio.patch b/leaf-server/minecraft-patches/features/0113-Replace-brain-activity-maps-with-optimized-collectio.patch similarity index 92% rename from leaf-server/minecraft-patches/features/0114-Replace-brain-activity-maps-with-optimized-collectio.patch rename to leaf-server/minecraft-patches/features/0113-Replace-brain-activity-maps-with-optimized-collectio.patch index 880b8ae0..855fae09 100644 --- a/leaf-server/minecraft-patches/features/0114-Replace-brain-activity-maps-with-optimized-collectio.patch +++ b/leaf-server/minecraft-patches/features/0113-Replace-brain-activity-maps-with-optimized-collectio.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Replace brain activity maps with optimized collection diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 778e3b99a7f941a53b87cbec510db8deed5d77c8..4dde1642a33349335f374f17123a700dde1079d7 100644 +index 0f50db187e04582e9b66a63201af987f6db74939..b143cd6d5636dc61458a864cd548c886d14cd30c 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -390,8 +390,8 @@ public class Brain { diff --git a/leaf-server/minecraft-patches/features/0115-Remove-stream-in-villagers.patch b/leaf-server/minecraft-patches/features/0114-Remove-stream-in-villagers.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0115-Remove-stream-in-villagers.patch rename to leaf-server/minecraft-patches/features/0114-Remove-stream-in-villagers.patch diff --git a/leaf-server/minecraft-patches/features/0116-Optimize-baby-villager-sensor.patch b/leaf-server/minecraft-patches/features/0115-Optimize-baby-villager-sensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0116-Optimize-baby-villager-sensor.patch rename to leaf-server/minecraft-patches/features/0115-Optimize-baby-villager-sensor.patch diff --git a/leaf-server/minecraft-patches/features/0117-Only-player-pushable.patch b/leaf-server/minecraft-patches/features/0116-Only-player-pushable.patch similarity index 89% rename from leaf-server/minecraft-patches/features/0117-Only-player-pushable.patch rename to leaf-server/minecraft-patches/features/0116-Only-player-pushable.patch index a7a9151f..bebcd468 100644 --- a/leaf-server/minecraft-patches/features/0117-Only-player-pushable.patch +++ b/leaf-server/minecraft-patches/features/0116-Only-player-pushable.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only player pushable Useful for extreme cases like massive entities collide together in a small area diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 668722c44bac3a9731d175a93aad8435e0c2c1c0..156d0c14eedf2f79e4276cc4065e19a43699b965 100644 +index cbd68d1d5b92e426062776658a6bf525553ecb1b..3aedae4c11bd33502e3ac2ba57d4f99c4c900a62 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3631,7 +3631,7 @@ public abstract class LivingEntity extends Entity implements Attackable, net.caf +@@ -3621,7 +3621,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.checkAutoSpinAttack(boundingBox, this.getBoundingBox()); } @@ -18,7 +18,7 @@ index 668722c44bac3a9731d175a93aad8435e0c2c1c0..156d0c14eedf2f79e4276cc4065e19a4 // Paper start - Add EntityMoveEvent // Purpur start - Ridables if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { -@@ -3769,7 +3769,14 @@ public abstract class LivingEntity extends Entity implements Attackable, net.caf +@@ -3759,7 +3759,14 @@ public abstract class LivingEntity extends Entity implements Attackable { return; } // Paper end - don't run getEntities if we're not going to use its result @@ -34,7 +34,7 @@ index 668722c44bac3a9731d175a93aad8435e0c2c1c0..156d0c14eedf2f79e4276cc4065e19a4 if (!entities.isEmpty()) { // Paper - don't run getEntities if we're not going to use its result; moved up if (_int > 0 && entities.size() > _int - 1 && this.random.nextInt(4) == 0) { -@@ -3802,6 +3809,44 @@ public abstract class LivingEntity extends Entity implements Attackable, net.caf +@@ -3792,6 +3799,44 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -80,10 +80,10 @@ index 668722c44bac3a9731d175a93aad8435e0c2c1c0..156d0c14eedf2f79e4276cc4065e19a4 AABB aabb = boundingBoxBeforeSpin.minmax(boundingBoxAfterSpin); List entities = this.level().getEntities(this, aabb); diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java -index 21153f37c169e987d7876d1b914105223ac10ee7..a8bd9f027b5ce360b9e720a7734451bcf9f701d4 100644 +index a31bbd8f3fff4fb4b1b33877d5835b93fc248f65..3b225c5c086b4a2d95d4260af4d1316743e3ed89 100644 --- a/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -326,7 +326,7 @@ public class ArmorStand extends LivingEntity implements net.caffeinemc.mods.lith +@@ -318,7 +318,7 @@ public class ArmorStand extends LivingEntity { @Override protected void pushEntities() { diff --git a/leaf-server/minecraft-patches/features/0118-Remove-iterators-from-Inventory-contains.patch b/leaf-server/minecraft-patches/features/0117-Remove-iterators-from-Inventory-contains.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0118-Remove-iterators-from-Inventory-contains.patch rename to leaf-server/minecraft-patches/features/0117-Remove-iterators-from-Inventory-contains.patch diff --git a/leaf-server/minecraft-patches/features/0119-Cache-eligible-players-for-despawn-checks.patch b/leaf-server/minecraft-patches/features/0118-Cache-eligible-players-for-despawn-checks.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0119-Cache-eligible-players-for-despawn-checks.patch rename to leaf-server/minecraft-patches/features/0118-Cache-eligible-players-for-despawn-checks.patch index d9fc4b67..56e31b52 100644 --- a/leaf-server/minecraft-patches/features/0119-Cache-eligible-players-for-despawn-checks.patch +++ b/leaf-server/minecraft-patches/features/0118-Cache-eligible-players-for-despawn-checks.patch @@ -56,10 +56,10 @@ index 4f01b53bf801f99253efd27df6216912705d18af..89df0f6893775df01e1470bb04f0059c private Either getBedResult(BlockPos at, Direction direction) { if (this.isSleeping() || !this.isAlive()) { diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java -index 54eeb0b112112bc5d3f4165c0ea43cf67931a739..05d5cde42b7011091ef4ee874c0d9d5586ae3f10 100644 +index faf05f0c8f273bc723bbe54c70aebdd26c479a6b..9bee3c8e13b1d5d66139ed793fcd9bb154987cd0 100644 --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -854,7 +854,24 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -840,7 +840,24 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { diff --git a/leaf-server/minecraft-patches/features/0120-Slightly-optimise-getNearestPlayer.patch b/leaf-server/minecraft-patches/features/0119-Slightly-optimise-getNearestPlayer.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0120-Slightly-optimise-getNearestPlayer.patch rename to leaf-server/minecraft-patches/features/0119-Slightly-optimise-getNearestPlayer.patch diff --git a/leaf-server/minecraft-patches/features/0121-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch b/leaf-server/minecraft-patches/features/0120-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0121-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch rename to leaf-server/minecraft-patches/features/0120-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch diff --git a/leaf-server/minecraft-patches/features/0122-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch b/leaf-server/minecraft-patches/features/0121-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0122-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch rename to leaf-server/minecraft-patches/features/0121-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch diff --git a/leaf-server/minecraft-patches/features/0123-Bulk-writes-to-writeLongArray-during-chunk-loading.patch b/leaf-server/minecraft-patches/features/0122-Bulk-writes-to-writeLongArray-during-chunk-loading.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0123-Bulk-writes-to-writeLongArray-during-chunk-loading.patch rename to leaf-server/minecraft-patches/features/0122-Bulk-writes-to-writeLongArray-during-chunk-loading.patch diff --git a/leaf-server/minecraft-patches/features/0124-Improve-sorting-in-SortedArraySet.patch b/leaf-server/minecraft-patches/features/0123-Improve-sorting-in-SortedArraySet.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0124-Improve-sorting-in-SortedArraySet.patch rename to leaf-server/minecraft-patches/features/0123-Improve-sorting-in-SortedArraySet.patch diff --git a/leaf-server/minecraft-patches/features/0125-Make-removeIf-slightly-faster.patch b/leaf-server/minecraft-patches/features/0124-Make-removeIf-slightly-faster.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0125-Make-removeIf-slightly-faster.patch rename to leaf-server/minecraft-patches/features/0124-Make-removeIf-slightly-faster.patch diff --git a/leaf-server/minecraft-patches/features/0126-Optimize-LinearPalette.patch b/leaf-server/minecraft-patches/features/0125-Optimize-LinearPalette.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0126-Optimize-LinearPalette.patch rename to leaf-server/minecraft-patches/features/0125-Optimize-LinearPalette.patch diff --git a/leaf-server/minecraft-patches/features/0127-Slightly-optimized-VarInt-write.patch b/leaf-server/minecraft-patches/features/0126-Slightly-optimized-VarInt-write.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0127-Slightly-optimized-VarInt-write.patch rename to leaf-server/minecraft-patches/features/0126-Slightly-optimized-VarInt-write.patch diff --git a/leaf-server/minecraft-patches/features/0128-Rewrite-ClientboundLightUpdatePacketData.patch b/leaf-server/minecraft-patches/features/0127-Rewrite-ClientboundLightUpdatePacketData.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0128-Rewrite-ClientboundLightUpdatePacketData.patch rename to leaf-server/minecraft-patches/features/0127-Rewrite-ClientboundLightUpdatePacketData.patch diff --git a/leaf-server/minecraft-patches/features/0129-Async-chunk-send.patch b/leaf-server/minecraft-patches/features/0128-Async-chunk-send.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0129-Async-chunk-send.patch rename to leaf-server/minecraft-patches/features/0128-Async-chunk-send.patch diff --git a/leaf-server/minecraft-patches/features/0130-Spawner-Configurations.patch b/leaf-server/minecraft-patches/features/0129-Spawner-Configurations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0130-Spawner-Configurations.patch rename to leaf-server/minecraft-patches/features/0129-Spawner-Configurations.patch diff --git a/leaf-server/minecraft-patches/features/0131-SparklyPaper-Parallel-world-ticking.patch b/leaf-server/minecraft-patches/features/0130-SparklyPaper-Parallel-world-ticking.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0131-SparklyPaper-Parallel-world-ticking.patch rename to leaf-server/minecraft-patches/features/0130-SparklyPaper-Parallel-world-ticking.patch index f38d95f9..682d4859 100644 --- a/leaf-server/minecraft-patches/features/0131-SparklyPaper-Parallel-world-ticking.patch +++ b/leaf-server/minecraft-patches/features/0130-SparklyPaper-Parallel-world-ticking.patch @@ -1187,10 +1187,10 @@ index cee7daa4908efde754442bf7ef0932b94cf5ebca..ff2ff95ec9d94e2e31e8174196b384c3 this.containerId = containerId; } diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java -index fd7c1e800cbd4919a1a47f6c468c8776535bd028..ba369d605ae50906d11d32e6f1b7132b061a9835 100644 +index aa2c00be86f42a6674694a20545399e441b75199..c098fe283e74ca77e7a47c898cd39a2d883b9524 100644 --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java -@@ -412,8 +412,8 @@ public final class ItemStack implements DataComponentHolder, net.caffeinemc.mods +@@ -407,8 +407,8 @@ public final class ItemStack implements DataComponentHolder { if (interactionResult.consumesAction() && serverLevel.captureTreeGeneration && !serverLevel.capturedBlockStates.isEmpty()) { serverLevel.captureTreeGeneration = false; org.bukkit.Location location = org.bukkit.craftbukkit.util.CraftLocation.toBukkit(clickedPos, serverLevel.getWorld()); diff --git a/leaf-server/minecraft-patches/features/0132-SparklyPaper-Track-each-world-MSPT.patch b/leaf-server/minecraft-patches/features/0131-SparklyPaper-Track-each-world-MSPT.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0132-SparklyPaper-Track-each-world-MSPT.patch rename to leaf-server/minecraft-patches/features/0131-SparklyPaper-Track-each-world-MSPT.patch diff --git a/leaf-server/minecraft-patches/features/0133-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch b/leaf-server/minecraft-patches/features/0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0133-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch rename to leaf-server/minecraft-patches/features/0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch diff --git a/leaf-server/minecraft-patches/features/0134-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch b/leaf-server/minecraft-patches/features/0133-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0134-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch rename to leaf-server/minecraft-patches/features/0133-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch diff --git a/leaf-server/minecraft-patches/features/0135-Remove-streams-on-InsideBrownianWalk.patch b/leaf-server/minecraft-patches/features/0134-Remove-streams-on-InsideBrownianWalk.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0135-Remove-streams-on-InsideBrownianWalk.patch rename to leaf-server/minecraft-patches/features/0134-Remove-streams-on-InsideBrownianWalk.patch diff --git a/leaf-server/minecraft-patches/features/0136-Use-BFS-on-getSlopeDistance.patch b/leaf-server/minecraft-patches/features/0135-Use-BFS-on-getSlopeDistance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0136-Use-BFS-on-getSlopeDistance.patch rename to leaf-server/minecraft-patches/features/0135-Use-BFS-on-getSlopeDistance.patch diff --git a/leaf-server/minecraft-patches/features/0137-Paper-PR-Throttle-failed-spawn-attempts.patch b/leaf-server/minecraft-patches/features/0136-Paper-PR-Throttle-failed-spawn-attempts.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0137-Paper-PR-Throttle-failed-spawn-attempts.patch rename to leaf-server/minecraft-patches/features/0136-Paper-PR-Throttle-failed-spawn-attempts.patch diff --git a/leaf-server/minecraft-patches/features/0138-Improve-BlockEntity-ticking-isRemoved-check.patch b/leaf-server/minecraft-patches/features/0137-Improve-BlockEntity-ticking-isRemoved-check.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0138-Improve-BlockEntity-ticking-isRemoved-check.patch rename to leaf-server/minecraft-patches/features/0137-Improve-BlockEntity-ticking-isRemoved-check.patch diff --git a/leaf-server/minecraft-patches/features/0139-Raytrace-AntiXray-SDK-integration.patch b/leaf-server/minecraft-patches/features/0138-Raytrace-AntiXray-SDK-integration.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0139-Raytrace-AntiXray-SDK-integration.patch rename to leaf-server/minecraft-patches/features/0138-Raytrace-AntiXray-SDK-integration.patch diff --git a/leaf-server/minecraft-patches/features/0140-Optimize-addOrUpdateTransientModifier.patch b/leaf-server/minecraft-patches/features/0139-Optimize-addOrUpdateTransientModifier.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0140-Optimize-addOrUpdateTransientModifier.patch rename to leaf-server/minecraft-patches/features/0139-Optimize-addOrUpdateTransientModifier.patch diff --git a/leaf-server/minecraft-patches/features/0141-Optimize-ContextMap.create.patch b/leaf-server/minecraft-patches/features/0140-Optimize-ContextMap.create.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0141-Optimize-ContextMap.create.patch rename to leaf-server/minecraft-patches/features/0140-Optimize-ContextMap.create.patch diff --git a/leaf-server/minecraft-patches/features/0142-Micro-optimizations-for-random-tick.patch b/leaf-server/minecraft-patches/features/0141-Micro-optimizations-for-random-tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0142-Micro-optimizations-for-random-tick.patch rename to leaf-server/minecraft-patches/features/0141-Micro-optimizations-for-random-tick.patch diff --git a/leaf-server/minecraft-patches/features/0143-Remove-streams-on-updateConnectedPlayersWithinRange.patch b/leaf-server/minecraft-patches/features/0142-Remove-streams-on-updateConnectedPlayersWithinRange.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0143-Remove-streams-on-updateConnectedPlayersWithinRange.patch rename to leaf-server/minecraft-patches/features/0142-Remove-streams-on-updateConnectedPlayersWithinRange.patch diff --git a/leaf-server/minecraft-patches/features/0144-Remove-streams-on-PlayerDetector.patch b/leaf-server/minecraft-patches/features/0143-Remove-streams-on-PlayerDetector.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0144-Remove-streams-on-PlayerDetector.patch rename to leaf-server/minecraft-patches/features/0143-Remove-streams-on-PlayerDetector.patch diff --git a/leaf-server/minecraft-patches/features/0145-Use-direct-iteration-on-Sensing.tick.patch b/leaf-server/minecraft-patches/features/0144-Use-direct-iteration-on-Sensing.tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0145-Use-direct-iteration-on-Sensing.tick.patch rename to leaf-server/minecraft-patches/features/0144-Use-direct-iteration-on-Sensing.tick.patch diff --git a/leaf-server/minecraft-patches/features/0146-Optimise-non-flush-packet-sending.patch b/leaf-server/minecraft-patches/features/0145-Optimise-non-flush-packet-sending.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0146-Optimise-non-flush-packet-sending.patch rename to leaf-server/minecraft-patches/features/0145-Optimise-non-flush-packet-sending.patch diff --git a/leaf-server/minecraft-patches/features/0147-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch b/leaf-server/minecraft-patches/features/0146-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0147-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch rename to leaf-server/minecraft-patches/features/0146-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch diff --git a/leaf-server/minecraft-patches/features/0148-Null-handling-on-MultifaceSpreader.patch b/leaf-server/minecraft-patches/features/0147-Null-handling-on-MultifaceSpreader.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0148-Null-handling-on-MultifaceSpreader.patch rename to leaf-server/minecraft-patches/features/0147-Null-handling-on-MultifaceSpreader.patch diff --git a/leaf-server/minecraft-patches/features/0149-More-virtual-threads.patch b/leaf-server/minecraft-patches/features/0148-More-virtual-threads.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0149-More-virtual-threads.patch rename to leaf-server/minecraft-patches/features/0148-More-virtual-threads.patch diff --git a/leaf-server/minecraft-patches/features/0150-Async-target-finding.patch b/leaf-server/minecraft-patches/features/0149-Async-target-finding.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0150-Async-target-finding.patch rename to leaf-server/minecraft-patches/features/0149-Async-target-finding.patch index 8ccb34ca..86cbd622 100644 --- a/leaf-server/minecraft-patches/features/0150-Async-target-finding.patch +++ b/leaf-server/minecraft-patches/features/0149-Async-target-finding.patch @@ -222,7 +222,7 @@ index fe81b2acfb51ed3335bde6f27ecfc53e339d2c7e..7955a8fa9c4de139b24c9d53018b055f // Paper start - log detailed entity tick information diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java -index 05d5cde42b7011091ef4ee874c0d9d5586ae3f10..88809afe30bb970a7de8bdfd269268800516c426 100644 +index 9bee3c8e13b1d5d66139ed793fcd9bb154987cd0..7c095fd1d117bc0eeb18799943f1c1442219fd73 100644 --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java @@ -144,6 +144,12 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @@ -261,7 +261,7 @@ index 05d5cde42b7011091ef4ee874c0d9d5586ae3f10..88809afe30bb970a7de8bdfd26926880 } // Paper end -@@ -914,17 +930,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -900,17 +916,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab // Paper end - Allow nerfed mobs to jump and float this.sensing.tick(); int i = this.tickCount + this.getId(); diff --git a/leaf-server/minecraft-patches/features/0151-Optimize-ThreadedTicketLevelPropagator.patch b/leaf-server/minecraft-patches/features/0150-Optimize-ThreadedTicketLevelPropagator.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0151-Optimize-ThreadedTicketLevelPropagator.patch rename to leaf-server/minecraft-patches/features/0150-Optimize-ThreadedTicketLevelPropagator.patch diff --git a/leaf-server/minecraft-patches/features/0152-Optimise-MobEffectUtil-getDigSpeedAmplification.patch b/leaf-server/minecraft-patches/features/0151-Optimise-MobEffectUtil-getDigSpeedAmplification.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0152-Optimise-MobEffectUtil-getDigSpeedAmplification.patch rename to leaf-server/minecraft-patches/features/0151-Optimise-MobEffectUtil-getDigSpeedAmplification.patch diff --git a/leaf-server/minecraft-patches/features/0153-Optimise-chunkUnloads.patch b/leaf-server/minecraft-patches/features/0152-Optimise-chunkUnloads.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0153-Optimise-chunkUnloads.patch rename to leaf-server/minecraft-patches/features/0152-Optimise-chunkUnloads.patch diff --git a/leaf-server/minecraft-patches/features/0154-Optimize-BlockEntityType-isValid.patch b/leaf-server/minecraft-patches/features/0153-Optimize-BlockEntityType-isValid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0154-Optimize-BlockEntityType-isValid.patch rename to leaf-server/minecraft-patches/features/0153-Optimize-BlockEntityType-isValid.patch diff --git a/leaf-server/minecraft-patches/features/0155-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch b/leaf-server/minecraft-patches/features/0154-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0155-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch rename to leaf-server/minecraft-patches/features/0154-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch diff --git a/leaf-server/minecraft-patches/features/0156-PaperPR-Fix-save-load-NaN-Entity-Motion.patch b/leaf-server/minecraft-patches/features/0155-PaperPR-Fix-save-load-NaN-Entity-Motion.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0156-PaperPR-Fix-save-load-NaN-Entity-Motion.patch rename to leaf-server/minecraft-patches/features/0155-PaperPR-Fix-save-load-NaN-Entity-Motion.patch diff --git a/leaf-server/minecraft-patches/features/0157-PaperPR-Fix-unnecessary-map-data-saves.patch b/leaf-server/minecraft-patches/features/0156-PaperPR-Fix-unnecessary-map-data-saves.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0157-PaperPR-Fix-unnecessary-map-data-saves.patch rename to leaf-server/minecraft-patches/features/0156-PaperPR-Fix-unnecessary-map-data-saves.patch diff --git a/leaf-server/minecraft-patches/features/0158-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch b/leaf-server/minecraft-patches/features/0157-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0158-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch rename to leaf-server/minecraft-patches/features/0157-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch diff --git a/leaf-server/minecraft-patches/features/0159-Sakura-copy-EntityList-implementation-to-BasicEntity.patch b/leaf-server/minecraft-patches/features/0158-Sakura-copy-EntityList-implementation-to-BasicEntity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0159-Sakura-copy-EntityList-implementation-to-BasicEntity.patch rename to leaf-server/minecraft-patches/features/0158-Sakura-copy-EntityList-implementation-to-BasicEntity.patch diff --git a/leaf-server/minecraft-patches/features/0160-Protocol-Core.patch b/leaf-server/minecraft-patches/features/0159-Protocol-Core.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0160-Protocol-Core.patch rename to leaf-server/minecraft-patches/features/0159-Protocol-Core.patch diff --git a/leaf-server/minecraft-patches/features/0161-Reduce-PlayerChunk-Updates.patch b/leaf-server/minecraft-patches/features/0160-Reduce-PlayerChunk-Updates.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0161-Reduce-PlayerChunk-Updates.patch rename to leaf-server/minecraft-patches/features/0160-Reduce-PlayerChunk-Updates.patch diff --git a/leaf-server/minecraft-patches/features/0162-Async-switch-connection-state.patch b/leaf-server/minecraft-patches/features/0161-Async-switch-connection-state.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0162-Async-switch-connection-state.patch rename to leaf-server/minecraft-patches/features/0161-Async-switch-connection-state.patch diff --git a/leaf-server/minecraft-patches/features/0163-Optimize-BlockEntities-tickersInLevel.patch b/leaf-server/minecraft-patches/features/0162-Optimize-BlockEntities-tickersInLevel.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0163-Optimize-BlockEntities-tickersInLevel.patch rename to leaf-server/minecraft-patches/features/0162-Optimize-BlockEntities-tickersInLevel.patch diff --git a/leaf-server/minecraft-patches/features/0164-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch b/leaf-server/minecraft-patches/features/0163-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0164-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch rename to leaf-server/minecraft-patches/features/0163-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch diff --git a/leaf-server/minecraft-patches/features/0165-Flush-location-while-knockback.patch b/leaf-server/minecraft-patches/features/0164-Flush-location-while-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0165-Flush-location-while-knockback.patch rename to leaf-server/minecraft-patches/features/0164-Flush-location-while-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0166-Only-tick-items-at-hand.patch b/leaf-server/minecraft-patches/features/0165-Only-tick-items-at-hand.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0166-Only-tick-items-at-hand.patch rename to leaf-server/minecraft-patches/features/0165-Only-tick-items-at-hand.patch diff --git a/leaf-server/minecraft-patches/features/0167-Smart-sort-items-in-NearestItemSensor.patch b/leaf-server/minecraft-patches/features/0166-Smart-sort-items-in-NearestItemSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0167-Smart-sort-items-in-NearestItemSensor.patch rename to leaf-server/minecraft-patches/features/0166-Smart-sort-items-in-NearestItemSensor.patch diff --git a/leaf-server/minecraft-patches/features/0168-Optimise-player-movement-checks.patch b/leaf-server/minecraft-patches/features/0167-Optimise-player-movement-checks.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0168-Optimise-player-movement-checks.patch rename to leaf-server/minecraft-patches/features/0167-Optimise-player-movement-checks.patch diff --git a/leaf-server/minecraft-patches/features/0169-Remove-streams-in-MobSensor.patch b/leaf-server/minecraft-patches/features/0168-Remove-streams-in-MobSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0169-Remove-streams-in-MobSensor.patch rename to leaf-server/minecraft-patches/features/0168-Remove-streams-in-MobSensor.patch diff --git a/leaf-server/minecraft-patches/features/0170-Remove-streams-in-TemptingSensor.patch b/leaf-server/minecraft-patches/features/0169-Remove-streams-in-TemptingSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0170-Remove-streams-in-TemptingSensor.patch rename to leaf-server/minecraft-patches/features/0169-Remove-streams-in-TemptingSensor.patch diff --git a/leaf-server/minecraft-patches/features/0171-Use-HashedList-on-WeightedRandomList.patch b/leaf-server/minecraft-patches/features/0170-Use-HashedList-on-WeightedRandomList.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0171-Use-HashedList-on-WeightedRandomList.patch rename to leaf-server/minecraft-patches/features/0170-Use-HashedList-on-WeightedRandomList.patch diff --git a/leaf-server/minecraft-patches/features/0172-Add-configurable-death-item-drop-knockback-settings.patch b/leaf-server/minecraft-patches/features/0171-Add-configurable-death-item-drop-knockback-settings.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0172-Add-configurable-death-item-drop-knockback-settings.patch rename to leaf-server/minecraft-patches/features/0171-Add-configurable-death-item-drop-knockback-settings.patch diff --git a/leaf-server/minecraft-patches/features/0173-Optimize-getScaledTrackingDistance.patch b/leaf-server/minecraft-patches/features/0172-Optimize-getScaledTrackingDistance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0173-Optimize-getScaledTrackingDistance.patch rename to leaf-server/minecraft-patches/features/0172-Optimize-getScaledTrackingDistance.patch diff --git a/leaf-server/minecraft-patches/features/0174-Optimize-SynchedEntityData-packDirty.patch b/leaf-server/minecraft-patches/features/0173-Optimize-SynchedEntityData-packDirty.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0174-Optimize-SynchedEntityData-packDirty.patch rename to leaf-server/minecraft-patches/features/0173-Optimize-SynchedEntityData-packDirty.patch diff --git a/leaf-server/minecraft-patches/features/0175-Optimize-isEyeInFluid.patch b/leaf-server/minecraft-patches/features/0174-Optimize-isEyeInFluid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0175-Optimize-isEyeInFluid.patch rename to leaf-server/minecraft-patches/features/0174-Optimize-isEyeInFluid.patch diff --git a/leaf-server/minecraft-patches/features/0176-Cache-block-path-type.patch b/leaf-server/minecraft-patches/features/0175-Cache-block-path-type.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0176-Cache-block-path-type.patch rename to leaf-server/minecraft-patches/features/0175-Cache-block-path-type.patch diff --git a/leaf-server/minecraft-patches/features/0177-optimize-getEntityStatus.patch b/leaf-server/minecraft-patches/features/0176-optimize-getEntityStatus.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0177-optimize-getEntityStatus.patch rename to leaf-server/minecraft-patches/features/0176-optimize-getEntityStatus.patch diff --git a/leaf-server/minecraft-patches/features/0178-Rail-Optimization-optimized-PoweredRailBlock-logic.patch b/leaf-server/minecraft-patches/features/0177-Rail-Optimization-optimized-PoweredRailBlock-logic.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0178-Rail-Optimization-optimized-PoweredRailBlock-logic.patch rename to leaf-server/minecraft-patches/features/0177-Rail-Optimization-optimized-PoweredRailBlock-logic.patch diff --git a/leaf-server/minecraft-patches/features/0179-optimise-ChunkGenerator-getMobsAt.patch b/leaf-server/minecraft-patches/features/0178-optimise-ChunkGenerator-getMobsAt.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0179-optimise-ChunkGenerator-getMobsAt.patch rename to leaf-server/minecraft-patches/features/0178-optimise-ChunkGenerator-getMobsAt.patch diff --git a/leaf-server/minecraft-patches/features/0180-optimise-getBiome.patch b/leaf-server/minecraft-patches/features/0179-optimise-getBiome.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0180-optimise-getBiome.patch rename to leaf-server/minecraft-patches/features/0179-optimise-getBiome.patch diff --git a/leaf-server/minecraft-patches/features/0181-optimize-mob-spawning.patch b/leaf-server/minecraft-patches/features/0180-optimize-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0181-optimize-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0180-optimize-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0182-optimize-structure-map.patch b/leaf-server/minecraft-patches/features/0181-optimize-structure-map.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0182-optimize-structure-map.patch rename to leaf-server/minecraft-patches/features/0181-optimize-structure-map.patch diff --git a/leaf-server/minecraft-patches/features/0183-throttle-mob-spawning.patch b/leaf-server/minecraft-patches/features/0182-throttle-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0183-throttle-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0182-throttle-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0184-Add-BlockExplosionHitEvent.patch b/leaf-server/minecraft-patches/features/0183-Add-BlockExplosionHitEvent.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0184-Add-BlockExplosionHitEvent.patch rename to leaf-server/minecraft-patches/features/0183-Add-BlockExplosionHitEvent.patch diff --git a/leaf-server/minecraft-patches/features/0185-Old-Blast-Protection-explosion-knockback.patch b/leaf-server/minecraft-patches/features/0184-Old-Blast-Protection-explosion-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0185-Old-Blast-Protection-explosion-knockback.patch rename to leaf-server/minecraft-patches/features/0184-Old-Blast-Protection-explosion-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0186-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0185-Paw-optimization.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0186-Paw-optimization.patch rename to leaf-server/minecraft-patches/features/0185-Paw-optimization.patch diff --git a/leaf-server/minecraft-patches/features/0187-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0186-Use-UUID-for-cure-reputation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0187-Use-UUID-for-cure-reputation.patch rename to leaf-server/minecraft-patches/features/0186-Use-UUID-for-cure-reputation.patch diff --git a/leaf-server/minecraft-patches/features/0188-Cache-potential-behaviors-in-Brain.patch b/leaf-server/minecraft-patches/features/0187-Cache-potential-behaviors-in-Brain.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0188-Cache-potential-behaviors-in-Brain.patch rename to leaf-server/minecraft-patches/features/0187-Cache-potential-behaviors-in-Brain.patch index 05706456..44de1e1b 100644 --- a/leaf-server/minecraft-patches/features/0188-Cache-potential-behaviors-in-Brain.patch +++ b/leaf-server/minecraft-patches/features/0187-Cache-potential-behaviors-in-Brain.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache potential behaviors in Brain diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 4dde1642a33349335f374f17123a700dde1079d7..5e86c8f6dffc7b4dd17acc43ec4c458368bf92a4 100644 +index b143cd6d5636dc61458a864cd548c886d14cd30c..954aa416877fd8838fd88d84096918455baa5641 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -60,6 +60,7 @@ public class Brain { diff --git a/leaf-server/minecraft-patches/features/0189-Use-ActivationList-on-runningBehaviors.patch b/leaf-server/minecraft-patches/features/0188-Use-ActivationList-on-runningBehaviors.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0189-Use-ActivationList-on-runningBehaviors.patch rename to leaf-server/minecraft-patches/features/0188-Use-ActivationList-on-runningBehaviors.patch index cc37bd53..fce3295c 100644 --- a/leaf-server/minecraft-patches/features/0189-Use-ActivationList-on-runningBehaviors.patch +++ b/leaf-server/minecraft-patches/features/0188-Use-ActivationList-on-runningBehaviors.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use ActivationList on runningBehaviors diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 5e86c8f6dffc7b4dd17acc43ec4c458368bf92a4..948731703d25eb3f86a83d45b7fd6ce4b4d3c4e8 100644 +index 954aa416877fd8838fd88d84096918455baa5641..3749808c5392f351b2383dd8d8cf8d884519804e 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -61,6 +61,7 @@ public class Brain { diff --git a/leaf-server/minecraft-patches/features/0190-Paper-Fix-infinite-loop-in-RegionFile-IO.patch b/leaf-server/minecraft-patches/features/0189-Paper-Fix-infinite-loop-in-RegionFile-IO.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0190-Paper-Fix-infinite-loop-in-RegionFile-IO.patch rename to leaf-server/minecraft-patches/features/0189-Paper-Fix-infinite-loop-in-RegionFile-IO.patch diff --git a/leaf-server/minecraft-patches/features/0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch b/leaf-server/minecraft-patches/features/0190-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0191-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch rename to leaf-server/minecraft-patches/features/0190-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch From bc4ca38c839b0efab2be655f323f33a2928a534b Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Fri, 13 Jun 2025 21:35:23 +0800 Subject: [PATCH 14/16] Pass exception as throwable instead of string --- .../org/dreeam/leaf/config/LeafConfig.java | 6 +- .../world/block/OptimizedPoweredRails.java | 224 +++++++++--------- 2 files changed, 115 insertions(+), 115 deletions(-) diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java b/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java index ad14e420..604140f4 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java @@ -71,7 +71,7 @@ public class LeafConfig { Command.broadcastCommandMessage(sender, Component.text(success, NamedTextColor.GREEN)); } catch (Exception e) { Command.broadcastCommandMessage(sender, Component.text("Failed to reload config. See error in console!", NamedTextColor.RED)); - LOGGER.error(e); + LOGGER.error("Failed to reload config!", e); } }, Util.ioPool()); } @@ -87,7 +87,7 @@ public class LeafConfig { LOGGER.info("Successfully loaded config in {}ms.", (System.nanoTime() - begin) / 1_000_000); } catch (Exception e) { - LeafConfig.LOGGER.error("Failed to load config modules!", e); + LOGGER.error("Failed to load config modules!", e); } } @@ -95,7 +95,7 @@ public class LeafConfig { private static void loadConfig(boolean init) throws Exception { // Create config folder - createDirectory(LeafConfig.I_CONFIG_FOLDER); + createDirectory(I_CONFIG_FOLDER); leafGlobalConfig = new LeafGlobalConfig(init); diff --git a/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java b/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java index 9580adc4..f4f3c7be 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/world/block/OptimizedPoweredRails.java @@ -62,14 +62,14 @@ public class OptimizedPoweredRails { } } - private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level world, BlockPos pos, - boolean bl, int distance, RailShape shape, + private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level level, BlockPos pos, + boolean searchForward, int distance, RailShape shape, Object2BooleanOpenHashMap checkedPos) { - BlockState blockState = world.getBlockState(pos); + BlockState blockState = level.getBlockState(pos); boolean speedCheck = checkedPos.containsKey(pos) && checkedPos.getBoolean(pos); if (speedCheck) { - return world.hasNeighborSignal(pos) || - findPoweredRailSignalFaster(self, world, pos, blockState, bl, distance + 1, checkedPos); + return level.hasNeighborSignal(pos) || + findPoweredRailSignalFaster(self, level, pos, blockState, searchForward, distance + 1, checkedPos); } else { if (blockState.is(self)) { RailShape railShape = blockState.getValue(SHAPE); @@ -84,8 +84,8 @@ public class OptimizedPoweredRails { )) { return false; } else if (blockState.getValue(POWERED)) { - return world.hasNeighborSignal(pos) || - findPoweredRailSignalFaster(self, world, pos, blockState, bl, distance + 1, checkedPos); + return level.hasNeighborSignal(pos) || + findPoweredRailSignalFaster(self, level, pos, blockState, searchForward, distance + 1, checkedPos); } else { return false; } @@ -95,200 +95,200 @@ public class OptimizedPoweredRails { } private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level level, - BlockPos pos, BlockState state, boolean bl, int distance, + BlockPos pos, BlockState state, boolean searchForward, int distance, Object2BooleanOpenHashMap checkedPos) { if (distance >= RAIL_POWER_LIMIT - 1) return false; - int i = pos.getX(); - int j = pos.getY(); - int k = pos.getZ(); - boolean bl2 = true; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + boolean flag = true; RailShape railShape = state.getValue(SHAPE); switch (railShape.ordinal()) { case 0 -> { - if (bl) ++k; - else --k; + if (searchForward) ++z; + else --z; } case 1 -> { - if (bl) --i; - else ++i; + if (searchForward) --x; + else ++x; } case 2 -> { - if (bl) { - --i; + if (searchForward) { + --x; } else { - ++i; - ++j; - bl2 = false; + ++x; + ++y; + flag = false; } railShape = RailShape.EAST_WEST; } case 3 -> { - if (bl) { - --i; - ++j; - bl2 = false; + if (searchForward) { + --x; + ++y; + flag = false; } else { - ++i; + ++x; } railShape = RailShape.EAST_WEST; } case 4 -> { - if (bl) { - ++k; + if (searchForward) { + ++z; } else { - --k; - ++j; - bl2 = false; + --z; + ++y; + flag = false; } railShape = RailShape.NORTH_SOUTH; } case 5 -> { - if (bl) { - ++k; - ++j; - bl2 = false; + if (searchForward) { + ++z; + ++y; + flag = false; } else { - --k; + --z; } railShape = RailShape.NORTH_SOUTH; } } return findPoweredRailSignalFaster( - self, level, new BlockPos(i, j, k), - bl, distance, railShape, checkedPos + self, level, new BlockPos(x, y, z), + searchForward, distance, railShape, checkedPos ) || - (bl2 && findPoweredRailSignalFaster( - self, level, new BlockPos(i, j - 1, k), - bl, distance, railShape, checkedPos + (flag && findPoweredRailSignalFaster( + self, level, new BlockPos(x, y - 1, z), + searchForward, distance, railShape, checkedPos )); } - private static void powerLane(PoweredRailBlock self, Level world, BlockPos pos, + private static void powerLane(PoweredRailBlock self, Level level, BlockPos pos, BlockState mainState, RailShape railShape) { - world.setBlock(pos, mainState.setValue(POWERED, true), UPDATE_FORCE_PLACE); + level.setBlock(pos, mainState.setValue(POWERED, true), UPDATE_FORCE_PLACE); Object2BooleanOpenHashMap checkedPos = CHECKED_POS_POOL; checkedPos.clear(); checkedPos.put(pos, true); int[] count = new int[2]; if (railShape == RailShape.NORTH_SOUTH) { // Order: +z, -z for (int i = 0; i < NORTH_SOUTH_DIR.length; ++i) { - setRailPositionsPower(self, world, pos, checkedPos, count, i, NORTH_SOUTH_DIR[i]); + setRailPositionsPower(self, level, pos, checkedPos, count, i, NORTH_SOUTH_DIR[i]); } - updateRails(self, false, world, pos, mainState, count); + updateRails(self, false, level, pos, mainState, count); } else if (railShape == RailShape.EAST_WEST) { // Order: -x, +x for (int i = 0; i < EAST_WEST_DIR.length; ++i) { - setRailPositionsPower(self, world, pos, checkedPos, count, i, EAST_WEST_DIR[i]); + setRailPositionsPower(self, level, pos, checkedPos, count, i, EAST_WEST_DIR[i]); } - updateRails(self, true, world, pos, mainState, count); + updateRails(self, true, level, pos, mainState, count); } checkedPos.clear(); } - private static void dePowerLane(PoweredRailBlock self, Level world, BlockPos pos, + private static void dePowerLane(PoweredRailBlock self, Level level, BlockPos pos, BlockState mainState, RailShape railShape) { - world.setBlock(pos, mainState.setValue(POWERED, false), UPDATE_FORCE_PLACE); + level.setBlock(pos, mainState.setValue(POWERED, false), UPDATE_FORCE_PLACE); int[] count = new int[2]; if (railShape == RailShape.NORTH_SOUTH) { // Order: +z, -z for (int i = 0; i < NORTH_SOUTH_DIR.length; ++i) { - setRailPositionsDePower(self, world, pos, count, i, NORTH_SOUTH_DIR[i]); + setRailPositionsDePower(self, level, pos, count, i, NORTH_SOUTH_DIR[i]); } - updateRails(self, false, world, pos, mainState, count); + updateRails(self, false, level, pos, mainState, count); } else if (railShape == RailShape.EAST_WEST) { // Order: -x, +x for (int i = 0; i < EAST_WEST_DIR.length; ++i) { - setRailPositionsDePower(self, world, pos, count, i, EAST_WEST_DIR[i]); + setRailPositionsDePower(self, level, pos, count, i, EAST_WEST_DIR[i]); } - updateRails(self, true, world, pos, mainState, count); + updateRails(self, true, level, pos, mainState, count); } } - private static void setRailPositionsPower(PoweredRailBlock self, Level world, BlockPos pos, + private static void setRailPositionsPower(PoweredRailBlock self, Level level, BlockPos pos, Object2BooleanOpenHashMap checkedPos, int[] count, int i, Direction dir) { for (int z = 1; z < RAIL_POWER_LIMIT; z++) { BlockPos newPos = pos.relative(dir, z); - BlockState state = world.getBlockState(newPos); + BlockState state = level.getBlockState(newPos); if (checkedPos.containsKey(newPos)) { if (!checkedPos.getBoolean(newPos)) break; count[i]++; - } else if (!state.is(self) || state.getValue(POWERED) || !(world.hasNeighborSignal(newPos) || - findPoweredRailSignalFaster(self, world, newPos, state, true, 0, checkedPos) || - findPoweredRailSignalFaster(self, world, newPos, state, false, 0, checkedPos))) { + } else if (!state.is(self) || state.getValue(POWERED) || !(level.hasNeighborSignal(newPos) || + findPoweredRailSignalFaster(self, level, newPos, state, true, 0, checkedPos) || + findPoweredRailSignalFaster(self, level, newPos, state, false, 0, checkedPos))) { checkedPos.put(newPos, false); break; } else { checkedPos.put(newPos, true); if (!state.getValue(POWERED)) { - world.setBlock(newPos, state.setValue(POWERED, true), UPDATE_FORCE_PLACE); + level.setBlock(newPos, state.setValue(POWERED, true), UPDATE_FORCE_PLACE); } count[i]++; } } } - private static void setRailPositionsDePower(PoweredRailBlock self, Level world, BlockPos pos, + private static void setRailPositionsDePower(PoweredRailBlock self, Level level, BlockPos pos, int[] count, int i, Direction dir) { Object2BooleanOpenHashMap checkedPos = CHECKED_POS_POOL; checkedPos.clear(); for (int z = 1; z < RAIL_POWER_LIMIT; z++) { BlockPos newPos = pos.relative(dir, z); - BlockState state = world.getBlockState(newPos); - if (!state.is(self) || !state.getValue(POWERED) || world.hasNeighborSignal(newPos) || - findPoweredRailSignalFaster(self, world, newPos, state, true, 0, checkedPos) || - findPoweredRailSignalFaster(self, world, newPos, state, false, 0, checkedPos)) + BlockState state = level.getBlockState(newPos); + if (!state.is(self) || !state.getValue(POWERED) || level.hasNeighborSignal(newPos) || + findPoweredRailSignalFaster(self, level, newPos, state, true, 0, checkedPos) || + findPoweredRailSignalFaster(self, level, newPos, state, false, 0, checkedPos)) break; if (state.getValue(POWERED)) { - world.setBlock(newPos, state.setValue(POWERED, false), UPDATE_FORCE_PLACE); + level.setBlock(newPos, state.setValue(POWERED, false), UPDATE_FORCE_PLACE); } count[i]++; } checkedPos.clear(); } - private static void shapeUpdateEnd(PoweredRailBlock self, Level world, BlockPos pos, BlockState mainState, + private static void shapeUpdateEnd(PoweredRailBlock self, Level level, BlockPos pos, BlockState mainState, int endPos, Direction direction, int currentPos, BlockPos blockPos) { if (currentPos == endPos) { BlockPos newPos = pos.relative(direction, currentPos + 1); - giveShapeUpdate(world, mainState, newPos, pos, direction); - BlockState state = world.getBlockState(blockPos); - if (state.is(self) && state.getValue(SHAPE).isSlope()) giveShapeUpdate(world, mainState, newPos.above(), pos, direction); + giveShapeUpdate(level, mainState, newPos, pos, direction); + BlockState state = level.getBlockState(blockPos); + if (state.is(self) && state.getValue(SHAPE).isSlope()) giveShapeUpdate(level, mainState, newPos.above(), pos, direction); } } - private static void neighborUpdateEnd(PoweredRailBlock self, Level world, BlockPos pos, int endPos, + private static void neighborUpdateEnd(PoweredRailBlock self, Level level, BlockPos pos, int endPos, Direction direction, Block block, int currentPos, BlockPos blockPos) { if (currentPos == endPos) { BlockPos newPos = pos.relative(direction, currentPos + 1); - world.neighborChanged(newPos, block, null); - BlockState state = world.getBlockState(blockPos); - if (state.is(self) && state.getValue(SHAPE).isSlope()) world.neighborChanged(newPos.above(), block, null); + level.neighborChanged(newPos, block, null); + BlockState state = level.getBlockState(blockPos); + if (state.is(self) && state.getValue(SHAPE).isSlope()) level.neighborChanged(newPos.above(), block, null); } } - private static void updateRailsSectionEastWestShape(PoweredRailBlock self, Level world, BlockPos pos, + private static void updateRailsSectionEastWestShape(PoweredRailBlock self, Level level, BlockPos pos, int c, BlockState mainState, Direction dir, int[] count, int countAmt) { BlockPos pos1 = pos.relative(dir, c); - if (c == 0 && count[1] == 0) giveShapeUpdate(world, mainState, pos1.relative(dir.getOpposite()), pos, dir.getOpposite()); - shapeUpdateEnd(self, world, pos, mainState, countAmt, dir, c, pos1); - giveShapeUpdate(world, mainState, pos1.below(), pos, Direction.DOWN); - giveShapeUpdate(world, mainState, pos1.above(), pos, Direction.UP); - giveShapeUpdate(world, mainState, pos1.north(), pos, Direction.NORTH); - giveShapeUpdate(world, mainState, pos1.south(), pos, Direction.SOUTH); + if (c == 0 && count[1] == 0) giveShapeUpdate(level, mainState, pos1.relative(dir.getOpposite()), pos, dir.getOpposite()); + shapeUpdateEnd(self, level, pos, mainState, countAmt, dir, c, pos1); + giveShapeUpdate(level, mainState, pos1.below(), pos, Direction.DOWN); + giveShapeUpdate(level, mainState, pos1.above(), pos, Direction.UP); + giveShapeUpdate(level, mainState, pos1.north(), pos, Direction.NORTH); + giveShapeUpdate(level, mainState, pos1.south(), pos, Direction.SOUTH); } - private static void updateRailsSectionNorthSouthShape(PoweredRailBlock self, Level world, BlockPos pos, + private static void updateRailsSectionNorthSouthShape(PoweredRailBlock self, Level level, BlockPos pos, int c, BlockState mainState, Direction dir, int[] count, int countAmt) { BlockPos pos1 = pos.relative(dir, c); - giveShapeUpdate(world, mainState, pos1.west(), pos, Direction.WEST); - giveShapeUpdate(world, mainState, pos1.east(), pos, Direction.EAST); - giveShapeUpdate(world, mainState, pos1.below(), pos, Direction.DOWN); - giveShapeUpdate(world, mainState, pos1.above(), pos, Direction.UP); - shapeUpdateEnd(self, world, pos, mainState, countAmt, dir, c, pos1); - if (c == 0 && count[1] == 0) giveShapeUpdate(world, mainState, pos1.relative(dir.getOpposite()), pos, dir.getOpposite()); + giveShapeUpdate(level, mainState, pos1.west(), pos, Direction.WEST); + giveShapeUpdate(level, mainState, pos1.east(), pos, Direction.EAST); + giveShapeUpdate(level, mainState, pos1.below(), pos, Direction.DOWN); + giveShapeUpdate(level, mainState, pos1.above(), pos, Direction.UP); + shapeUpdateEnd(self, level, pos, mainState, countAmt, dir, c, pos1); + if (c == 0 && count[1] == 0) giveShapeUpdate(level, mainState, pos1.relative(dir.getOpposite()), pos, dir.getOpposite()); } - private static void updateRails(PoweredRailBlock self, boolean eastWest, Level world, + private static void updateRails(PoweredRailBlock self, boolean eastWest, Level level, BlockPos pos, BlockState mainState, int[] count) { if (eastWest) { for (int i = 0; i < EAST_WEST_DIR.length; ++i) { @@ -298,21 +298,21 @@ public class OptimizedPoweredRails { Block block = mainState.getBlock(); for (int c = countAmt; c >= i; c--) { BlockPos p = pos.relative(dir, c); - if (c == 0 && count[1] == 0) world.neighborChanged(p.relative(dir.getOpposite()), block, null); - neighborUpdateEnd(self, world, pos, countAmt, dir, block, c, p); - world.neighborChanged(p.below(), block, null); - world.neighborChanged(p.above(), block, null); - world.neighborChanged(p.north(), block, null); - world.neighborChanged(p.south(), block, null); + if (c == 0 && count[1] == 0) level.neighborChanged(p.relative(dir.getOpposite()), block, null); + neighborUpdateEnd(self, level, pos, countAmt, dir, block, c, p); + level.neighborChanged(p.below(), block, null); + level.neighborChanged(p.above(), block, null); + level.neighborChanged(p.north(), block, null); + level.neighborChanged(p.south(), block, null); BlockPos pos2 = pos.relative(dir, c).below(); - world.neighborChanged(pos2.below(), block, null); - world.neighborChanged(pos2.north(), block, null); - world.neighborChanged(pos2.south(), block, null); - if (c == countAmt) world.neighborChanged(pos.relative(dir, c + 1).below(), block, null); - if (c == 0 && count[1] == 0) world.neighborChanged(p.relative(dir.getOpposite()).below(), block, null); + level.neighborChanged(pos2.below(), block, null); + level.neighborChanged(pos2.north(), block, null); + level.neighborChanged(pos2.south(), block, null); + if (c == countAmt) level.neighborChanged(pos.relative(dir, c + 1).below(), block, null); + if (c == 0 && count[1] == 0) level.neighborChanged(p.relative(dir.getOpposite()).below(), block, null); } for (int c = countAmt; c >= i; c--) - updateRailsSectionEastWestShape(self, world, pos, c, mainState, dir, count, countAmt); + updateRailsSectionEastWestShape(self, level, pos, c, mainState, dir, count, countAmt); } } else { for (int i = 0; i < NORTH_SOUTH_DIR.length; ++i) { @@ -322,21 +322,21 @@ public class OptimizedPoweredRails { Block block = mainState.getBlock(); for (int c = countAmt; c >= i; c--) { BlockPos p = pos.relative(dir, c); - world.neighborChanged(p.west(), block, null); - world.neighborChanged(p.east(), block, null); - world.neighborChanged(p.below(), block, null); - world.neighborChanged(p.above(), block, null); - neighborUpdateEnd(self, world, pos, countAmt, dir, block, c, p); - if (c == 0 && count[1] == 0) world.neighborChanged(p.relative(dir.getOpposite()), block, null); + level.neighborChanged(p.west(), block, null); + level.neighborChanged(p.east(), block, null); + level.neighborChanged(p.below(), block, null); + level.neighborChanged(p.above(), block, null); + neighborUpdateEnd(self, level, pos, countAmt, dir, block, c, p); + if (c == 0 && count[1] == 0) level.neighborChanged(p.relative(dir.getOpposite()), block, null); BlockPos pos2 = pos.relative(dir, c).below(); - world.neighborChanged(pos2.west(), block, null); - world.neighborChanged(pos2.east(), block, null); - world.neighborChanged(pos2.below(), block, null); - if (c == countAmt) world.neighborChanged(pos.relative(dir, c + 1).below(), block, null); - if (c == 0 && count[1] == 0) world.neighborChanged(p.relative(dir.getOpposite()).below(), block, null); + level.neighborChanged(pos2.west(), block, null); + level.neighborChanged(pos2.east(), block, null); + level.neighborChanged(pos2.below(), block, null); + if (c == countAmt) level.neighborChanged(pos.relative(dir, c + 1).below(), block, null); + if (c == 0 && count[1] == 0) level.neighborChanged(p.relative(dir.getOpposite()).below(), block, null); } for (int c = countAmt; c >= i; c--) - updateRailsSectionNorthSouthShape(self, world, pos, c, mainState, dir, count, countAmt); + updateRailsSectionNorthSouthShape(self, level, pos, c, mainState, dir, count, countAmt); } } } From 9c0d0a828ce9beb16cbc8ece6d1905b7e8b0ad5e Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:03:34 +0800 Subject: [PATCH 15/16] Temp disable hot reload for async features --- .../hardfork/server/0184-preload-mob-spawning-position.patch | 2 +- .../work/server/0101-Lithium-equipment-tracking.patch | 3 +++ .../main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java | 3 ++- .../java/org/dreeam/leaf/async/path/AsyncPathProcessor.java | 3 ++- .../org/dreeam/leaf/async/tracker/MultithreadedTracker.java | 3 ++- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch b/leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch index 19db2558..911a1dbf 100644 --- a/leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch +++ b/leaf-archived-patches/removed/hardfork/server/0184-preload-mob-spawning-position.patch @@ -3,7 +3,7 @@ From: hayanesuru Date: Wed, 4 Jun 2025 20:54:32 +0900 Subject: [PATCH] preload mob spawning position -No need +Removed since Leaf 1.21.4, No need diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java index 458b17dca84c87591b030679c5aac6259c0f8308..c69922ac2b831d8af35c9e98a34825e6b8a268da 100644 diff --git a/leaf-archived-patches/work/server/0101-Lithium-equipment-tracking.patch b/leaf-archived-patches/work/server/0101-Lithium-equipment-tracking.patch index 492f73c1..de73b8e1 100644 --- a/leaf-archived-patches/work/server/0101-Lithium-equipment-tracking.patch +++ b/leaf-archived-patches/work/server/0101-Lithium-equipment-tracking.patch @@ -3,6 +3,9 @@ From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com> Date: Tue, 9 Nov 2077 00:00:00 +0800 Subject: [PATCH] Lithium: equipment tracking +TODO: needs to fix issues related to Piglins lose the crossbow animation +original report is in discord. + Should have special treatment to ArmorStand, since Paper introduced the configurable ArmorStand no-tick, and still gives it ability to update equipment changes. Thus added a bypass condition in LivingEntity#collectEquipmentChanges, always send diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java b/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java index b67eda75..0c88f00d 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/AsyncPlayerDataSaving.java @@ -32,7 +32,8 @@ public class AsyncPlayerDataSaving { new ThreadPoolExecutor.DiscardPolicy() ); } else { - throw new IllegalStateException(); + // Temp no-op + //throw new IllegalStateException(); } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java b/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java index a1f2fb95..a3ab0bac 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/path/AsyncPathProcessor.java @@ -43,7 +43,8 @@ public class AsyncPathProcessor { getRejectedPolicy() ); } else { - throw new IllegalStateException(); + // Temp no-op + //throw new IllegalStateException(); } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/async/tracker/MultithreadedTracker.java b/leaf-server/src/main/java/org/dreeam/leaf/async/tracker/MultithreadedTracker.java index 7cdea68b..7f542a29 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/async/tracker/MultithreadedTracker.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/async/tracker/MultithreadedTracker.java @@ -46,7 +46,8 @@ public class MultithreadedTracker { getRejectedPolicy() ); } else { - throw new IllegalStateException(); + // Temp no-op + //throw new IllegalStateException(); } } From 03de21f0f4c0aa696d052113990ca9ee6884be0e Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:25:37 +0800 Subject: [PATCH 16/16] [ci skip] Rebuild patches --- ...reputation.patch => 0185-Use-UUID-for-cure-reputation.patch} | 1 + ...rain.patch => 0186-Cache-potential-behaviors-in-Brain.patch} | 2 +- ....patch => 0187-Use-ActivationList-on-runningBehaviors.patch} | 2 +- ...atch => 0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch} | 0 ...-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch} | 0 ...{0185-Paw-optimization.patch => 0190-Paw-optimization.patch} | 0 ...se-ReferenceList.patch => 0038-optimise-ReferenceList.patch} | 0 .../{0040-cache-getBiome.patch => 0039-cache-getBiome.patch} | 0 ...tch => 0040-Paper-Optimise-CraftWorld-getLoadedChunks.patch} | 0 ...-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch} | 0 .../{0043-dump-pwt-thread.patch => 0042-dump-pwt-thread.patch} | 0 ...{0038-Paw-optimization.patch => 0043-Paw-optimization.patch} | 0 12 files changed, 3 insertions(+), 2 deletions(-) rename leaf-server/minecraft-patches/features/{0186-Use-UUID-for-cure-reputation.patch => 0185-Use-UUID-for-cure-reputation.patch} (97%) rename leaf-server/minecraft-patches/features/{0187-Cache-potential-behaviors-in-Brain.patch => 0186-Cache-potential-behaviors-in-Brain.patch} (97%) rename leaf-server/minecraft-patches/features/{0188-Use-ActivationList-on-runningBehaviors.patch => 0187-Use-ActivationList-on-runningBehaviors.patch} (98%) rename leaf-server/minecraft-patches/features/{0189-Paper-Fix-infinite-loop-in-RegionFile-IO.patch => 0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch} (100%) rename leaf-server/minecraft-patches/features/{0190-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch => 0189-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch} (100%) rename leaf-server/minecraft-patches/features/{0185-Paw-optimization.patch => 0190-Paw-optimization.patch} (100%) rename leaf-server/paper-patches/features/{0039-optimise-ReferenceList.patch => 0038-optimise-ReferenceList.patch} (100%) rename leaf-server/paper-patches/features/{0040-cache-getBiome.patch => 0039-cache-getBiome.patch} (100%) rename leaf-server/paper-patches/features/{0041-Paper-Optimise-CraftWorld-getLoadedChunks.patch => 0040-Paper-Optimise-CraftWorld-getLoadedChunks.patch} (100%) rename leaf-server/paper-patches/features/{0042-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch => 0041-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch} (100%) rename leaf-server/paper-patches/features/{0043-dump-pwt-thread.patch => 0042-dump-pwt-thread.patch} (100%) rename leaf-server/paper-patches/features/{0038-Paw-optimization.patch => 0043-Paw-optimization.patch} (100%) diff --git a/leaf-server/minecraft-patches/features/0186-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0185-Use-UUID-for-cure-reputation.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0186-Use-UUID-for-cure-reputation.patch rename to leaf-server/minecraft-patches/features/0185-Use-UUID-for-cure-reputation.patch index 243d8878..dc41e695 100644 --- a/leaf-server/minecraft-patches/features/0186-Use-UUID-for-cure-reputation.patch +++ b/leaf-server/minecraft-patches/features/0185-Use-UUID-for-cure-reputation.patch @@ -3,6 +3,7 @@ From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com> Date: Tue, 9 Nov 2077 00:00:00 +0800 Subject: [PATCH] Use UUID for cure reputation +Related MC issue: https://bugs.mojang.com/browse/MC/issues/MC-247647 diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java index d4b6c93f9f0e109be300164c4fd9167aba2d951c..138e62965a4e532972e51c16b429e050bb147788 100644 diff --git a/leaf-server/minecraft-patches/features/0187-Cache-potential-behaviors-in-Brain.patch b/leaf-server/minecraft-patches/features/0186-Cache-potential-behaviors-in-Brain.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0187-Cache-potential-behaviors-in-Brain.patch rename to leaf-server/minecraft-patches/features/0186-Cache-potential-behaviors-in-Brain.patch index 44de1e1b..4efc9f80 100644 --- a/leaf-server/minecraft-patches/features/0187-Cache-potential-behaviors-in-Brain.patch +++ b/leaf-server/minecraft-patches/features/0186-Cache-potential-behaviors-in-Brain.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache potential behaviors in Brain diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index b143cd6d5636dc61458a864cd548c886d14cd30c..954aa416877fd8838fd88d84096918455baa5641 100644 +index 636a945ce2a91b8bf73b790e0e9e412368b3fe71..27fc18000987d6f962df8a9e441eb2e3d28bf213 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -60,6 +60,7 @@ public class Brain { diff --git a/leaf-server/minecraft-patches/features/0188-Use-ActivationList-on-runningBehaviors.patch b/leaf-server/minecraft-patches/features/0187-Use-ActivationList-on-runningBehaviors.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0188-Use-ActivationList-on-runningBehaviors.patch rename to leaf-server/minecraft-patches/features/0187-Use-ActivationList-on-runningBehaviors.patch index fce3295c..d36fa3cd 100644 --- a/leaf-server/minecraft-patches/features/0188-Use-ActivationList-on-runningBehaviors.patch +++ b/leaf-server/minecraft-patches/features/0187-Use-ActivationList-on-runningBehaviors.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use ActivationList on runningBehaviors diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 954aa416877fd8838fd88d84096918455baa5641..3749808c5392f351b2383dd8d8cf8d884519804e 100644 +index 27fc18000987d6f962df8a9e441eb2e3d28bf213..205d7f583ad9415bd2411c3b13726c6e7d90ff83 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -61,6 +61,7 @@ public class Brain { diff --git a/leaf-server/minecraft-patches/features/0189-Paper-Fix-infinite-loop-in-RegionFile-IO.patch b/leaf-server/minecraft-patches/features/0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0189-Paper-Fix-infinite-loop-in-RegionFile-IO.patch rename to leaf-server/minecraft-patches/features/0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch diff --git a/leaf-server/minecraft-patches/features/0190-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch b/leaf-server/minecraft-patches/features/0189-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0190-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch rename to leaf-server/minecraft-patches/features/0189-Paper-Fix-excess-slot-updates-inventory-state-id-des.patch diff --git a/leaf-server/minecraft-patches/features/0185-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0190-Paw-optimization.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0185-Paw-optimization.patch rename to leaf-server/minecraft-patches/features/0190-Paw-optimization.patch diff --git a/leaf-server/paper-patches/features/0039-optimise-ReferenceList.patch b/leaf-server/paper-patches/features/0038-optimise-ReferenceList.patch similarity index 100% rename from leaf-server/paper-patches/features/0039-optimise-ReferenceList.patch rename to leaf-server/paper-patches/features/0038-optimise-ReferenceList.patch diff --git a/leaf-server/paper-patches/features/0040-cache-getBiome.patch b/leaf-server/paper-patches/features/0039-cache-getBiome.patch similarity index 100% rename from leaf-server/paper-patches/features/0040-cache-getBiome.patch rename to leaf-server/paper-patches/features/0039-cache-getBiome.patch diff --git a/leaf-server/paper-patches/features/0041-Paper-Optimise-CraftWorld-getLoadedChunks.patch b/leaf-server/paper-patches/features/0040-Paper-Optimise-CraftWorld-getLoadedChunks.patch similarity index 100% rename from leaf-server/paper-patches/features/0041-Paper-Optimise-CraftWorld-getLoadedChunks.patch rename to leaf-server/paper-patches/features/0040-Paper-Optimise-CraftWorld-getLoadedChunks.patch diff --git a/leaf-server/paper-patches/features/0042-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch b/leaf-server/paper-patches/features/0041-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch similarity index 100% rename from leaf-server/paper-patches/features/0042-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch rename to leaf-server/paper-patches/features/0041-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch diff --git a/leaf-server/paper-patches/features/0043-dump-pwt-thread.patch b/leaf-server/paper-patches/features/0042-dump-pwt-thread.patch similarity index 100% rename from leaf-server/paper-patches/features/0043-dump-pwt-thread.patch rename to leaf-server/paper-patches/features/0042-dump-pwt-thread.patch diff --git a/leaf-server/paper-patches/features/0038-Paw-optimization.patch b/leaf-server/paper-patches/features/0043-Paw-optimization.patch similarity index 100% rename from leaf-server/paper-patches/features/0038-Paw-optimization.patch rename to leaf-server/paper-patches/features/0043-Paw-optimization.patch