9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-24 01:19:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0190-count-all-chunks-for-ticking.patch
Taiyou cc98f4982e backport 1.21.8 async mob spawn (#479)
* backport: 1.21.8 async mob spawn

* Move into patch

* fix

* fix build

---------

Co-authored-by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Co-authored-by: hayanesuru <hayanesuru@outlook.jp>
2025-08-27 20:00:46 +02:00

26 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Sun, 16 Feb 2025 01:13:04 +0100
Subject: [PATCH] count all chunks for ticking
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
index 7531e684e16bc038811fbf133caced9c7f5efe07..10fb9cc994ddc8820bed23d722b49b9f33e5fc09 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
@@ -593,6 +593,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
final int size = tickingChunks.size();
final ChunkMap chunkMap = this.chunkMap;
+ // Leaf start - count all chunks for ticking
+ if (org.dreeam.leaf.config.modules.opt.CountAllChunksForTicking.enabled) {
+ for (int i = 0; i < size; ++i) {
+ output.add(raw[i].chunk());
+ }
+ return;
+ }
+ // Leaf end - count all chunks for ticking
for (int i = 0; i < size; ++i) {
final ServerChunkCache.ChunkAndHolder chunkAndHolder = raw[i];