mirror of
https://github.com/PaperMC/Folia.git
synced 2024-11-24 12:25:23 +01:00
Use chunk coords for thread check for CraftWorld#getHighestBlockYAt
Not block coords
This commit is contained in:
parent
1c5e9be7fd
commit
108dc2358b
@ -23223,7 +23223,7 @@ index e0b6c737f9de2b6e692d6813d8dea4c35f038573..851937baff90177e648d970cf1c462b8
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..eb8206eaeb83ed8cfb86b1889166cfefddbdd70d 100644
|
||||
index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..2ead9af36c4d41c61b68a960ff17e25894efeb2a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -180,7 +180,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@ -23324,7 +23324,7 @@ index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..eb8206eaeb83ed8cfb86b1889166cfef
|
||||
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
|
||||
- world.captureTreeGeneration = true;
|
||||
- world.captureBlockStates = true;
|
||||
+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, loc.getBlockX() >> 4, loc.getBlockZ() >> 4, "Cannot generate tree asynchronously"); // Folia - region threading
|
||||
+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, loc.getX(), loc.getZ(), "Cannot generate tree asynchronously"); // Folia - region threading
|
||||
+ io.papermc.paper.threadedregions.RegionizedWorldData worldData = world.getCurrentWorldData(); // Folia - region threading
|
||||
+ worldData.captureTreeGeneration = true; // Folia - region threading
|
||||
+ worldData.captureBlockStates = true; // Folia - region threading
|
||||
@ -23395,7 +23395,7 @@ index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..eb8206eaeb83ed8cfb86b1889166cfef
|
||||
|
||||
@Override
|
||||
public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) {
|
||||
+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, x, z, "Cannot retrieve chunk asynchronously"); // Folia - region threading
|
||||
+ io.papermc.paper.util.TickThread.ensureTickThread(this.world, x >> 4, z >> 4, "Cannot retrieve chunk asynchronously"); // Folia - region threading
|
||||
warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper
|
||||
// Transient load for this tick
|
||||
return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z);
|
||||
|
Loading…
Reference in New Issue
Block a user