mirror of
https://github.com/PaperMC/Folia.git
synced 2025-04-22 20:29:19 +08:00
Schedule POTENTIAL_JOB_SITE to correct region
The position may not be owned by the current region so we must schedule the release to the correct region. Fixes https://github.com/PaperMC/Folia/issues/319
This commit is contained in:
parent
4e7607dce4
commit
75f1605833
@ -0,0 +1,17 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/GoToPotentialJobSite.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/GoToPotentialJobSite.java
|
||||
@@ -46,12 +_,14 @@
|
||||
BlockPos blockPos = globalPos.pos();
|
||||
ServerLevel level1 = level.getServer().getLevel(globalPos.dimension());
|
||||
if (level1 != null) {
|
||||
+ io.papermc.paper.threadedregions.RegionizedServer.getInstance().taskQueue.queueTickTaskQueue(level1, blockPos.getX() >> 4, blockPos.getZ(), () -> { // Folia - region threading
|
||||
PoiManager poiManager = level1.getPoiManager();
|
||||
if (poiManager.exists(blockPos, holder -> true)) {
|
||||
poiManager.release(blockPos);
|
||||
}
|
||||
|
||||
DebugPackets.sendPoiTicketCountPacket(level, blockPos);
|
||||
+ }); // Folia - region threading
|
||||
}
|
||||
});
|
||||
entity.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
Loading…
x
Reference in New Issue
Block a user