-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparation for new optimisation features
- Loading branch information
1 parent
f4e0301
commit 262d7b2
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |