Skip to content

Commit

Permalink
Preparation for new optimisation features
Browse files Browse the repository at this point in the history
  • Loading branch information
semenishchev committed Dec 9, 2024
1 parent f4e0301 commit 262d7b2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions patches/server/0010-Ticking-optimisations.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: SashaSemenishchev <sashasemenishchev@gmail.com>
Date: Mon, 9 Dec 2024 22:15:55 +0100
Subject: [PATCH] Ticking optimisations


diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
index 8671a90e969d16c7a57ddc38fedb7cf01815f64c..cbe22ee6e9f1cbca53867c3027ba25343d6ff45f 100644
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/ChunkTaskScheduler.java
@@ -548,6 +548,11 @@ public final class ChunkTaskScheduler {
if (status == null || status.isOrAfter(ChunkStatus.FULL)) {
throw new IllegalArgumentException("Status: " + status);
}
+ // PurpurLeaf start - support for async chunks
+ if(!TickThread.isTickThread()) {
+ return this.world.getChunkSource().getChunk(chunkX, chunkZ, status, true);
+ }
+ // PurpurLeaf end
ChunkAccess loaded = ((ChunkSystemServerLevel)this.world).moonrise$getSpecificChunkIfLoaded(chunkX, chunkZ, status);
if (loaded != null) {
return loaded;

0 comments on commit 262d7b2

Please sign in to comment.