9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-24 01:19:25 +00:00

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>
This commit is contained in:
Taiyou
2025-08-27 20:00:46 +02:00
committed by GitHub
parent 3ae338d9b4
commit cc98f4982e
47 changed files with 256 additions and 210 deletions

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: hayanesuru <hayanesuru@outlook.jp>
Date: Tue, 3 Jun 2025 18:51:44 +0900
Subject: [PATCH] cache getBiome
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
index 09e87552159e24603aa9a4f658ab4449d7eaeb0a..cfe6d74fa06e19c33e6342c76ca99e473840a65b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
@@ -302,6 +302,13 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
return this.handle.getBiome(pos);
}
+ // Leaf start - cache getBiome
+ @Override
+ public Holder<Biome> getBiomeCached(BlockPos pos) {
+ return this.handle.getBiomeCached(pos);
+ }
+ // Leaf end - cache getBiome
+
@Override
public Stream<BlockState> getBlockStatesIfLoaded(AABB box) {
return this.handle.getBlockStatesIfLoaded(box);