9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-27 10:59:16 +00:00
Files
Leaf/leaf-server/paper-patches/features/0053-cache-getBiome.patch
hayanesuru 23b7b02eee optimize chunk map (#438)
* rebase

* optimize LivingEntity#travel

* cleanup

* Replace fluid height map

* reuse array list in Entity#collide

* cleanup

* fix fire and liquid collision shape

* fix checkInside

* inline betweenClosed

* cleanup

* optimize getOnPos

* optimize equals in getOnPos

* update mainSupportingBlockPos on dirty

* cleanup

* rename

* merge same patch

* rebase and remove properly

* [ci skip] cleanup

* rebase and rebuild

* fix async locator

* remove async locator

* cleanup

* rebase

---------

Co-authored-by: Taiyou06 <kaandindar21@gmail.com>
2025-08-19 20:48:26 +02:00

25 lines
1.1 KiB
Diff

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 0e14f962b26823e49b192a4f97ec6c1f477ef0ff..757dd75474b134be8e432d64e1c11d52ecbb0587 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DelegatedGeneratorAccess.java
@@ -285,6 +285,13 @@ public abstract class DelegatedGeneratorAccess implements WorldGenLevel {
return this.delegate.getBiome(pos);
}
+ // Leaf start - cache getBiome
+ @Override
+ public Holder<Biome> getBiomeCached(@Nullable net.minecraft.world.level.chunk.LevelChunk chunk, BlockPos pos) {
+ return this.delegate.getBiomeCached(chunk, pos);
+ }
+ // Leaf end - cache getBiome
+
@Override
public Stream<BlockState> getBlockStatesIfLoaded(AABB box) {
return this.delegate.getBlockStatesIfLoaded(box);