Skip to content

Commit

Permalink
fix POI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei authored Jul 23, 2024
1 parent 309ea50 commit d7fa2a0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Try fixing folia off region POI accessing issue


diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GoToPotentialJobSite.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GoToPotentialJobSite.java
index aac1df9e2c0652bc6348af0404deba7465f82d42..b2feeeb944cb469851fd84814dedb7c6f253c416 100644
index aac1df9e2c0652bc6348af0404deba7465f82d42..f93c9a1b15ca973f5e200c4c806256c5c9a9b11a 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GoToPotentialJobSite.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GoToPotentialJobSite.java
@@ -49,10 +49,17 @@ public class GoToPotentialJobSite extends Behavior<Villager> {
Expand All @@ -20,15 +20,15 @@ index aac1df9e2c0652bc6348af0404deba7465f82d42..b2feeeb944cb469851fd84814dedb7c6
-
+ };
+ if (!io.papermc.paper.util.TickThread.isTickThreadFor(serverLevel2, blockPos) && org.leavesmc.lumina.config.LuminaConfig.configModule.fix.fixFoliaPoiAccessOffRegion)
+ io.papermc.paper.threadedregions.RegionizedServer.getInstance().taskQueue.queueTickTaskQueue(serverLevel, blockPos.getX() >> 4, blockPos.getZ() >> 4, scheduledRelease);
+ io.papermc.paper.threadedregions.RegionizedServer.getInstance().taskQueue.queueTickTaskQueue(serverLevel2, blockPos.getX() >> 4, blockPos.getZ() >> 4, scheduledRelease);
+ else
+ scheduledRelease.run();
+ // Luminol end
DebugPackets.sendPoiTicketCountPacket(serverLevel, blockPos);
}
});
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/YieldJobSite.java b/src/main/java/net/minecraft/world/entity/ai/behavior/YieldJobSite.java
index d1a9b62d3304916275dd6b4c4e783cf1563b5e21..a6373e6e6efad8e4c7ce8ccc55e549e51a93daaf 100644
index d1a9b62d3304916275dd6b4c4e783cf1563b5e21..b6b68097a7fa01bec30c308af8b18c3cd128d5e9 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/YieldJobSite.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/YieldJobSite.java
@@ -6,6 +6,7 @@ import net.minecraft.core.BlockPos;
Expand All @@ -44,9 +44,9 @@ index d1a9b62d3304916275dd6b4c4e783cf1563b5e21..a6373e6e6efad8e4c7ce8ccc55e549e5
return false;
} else {
- BlockPos blockPos = context.<GlobalPos>get(potentialJobSite).pos();
+ final GlobalPos globalPos = context.<GlobalPos>get(potentialJobSite); // Luminol - Try fixing off main POI accessing
+ final GlobalPos globalPos = context.<GlobalPos>get(potentialJobSite); // Luminol start - Try fixing off main POI accessing
+ final ServerLevel targetLevel = net.minecraft.server.MinecraftServer.getServer().getLevel(globalPos.dimension()); //Luminol - Try fixing off main POI accessing
+ BlockPos blockPos = globalPos.pos(); // Luminol - Try fixing off main POI accessing
+ BlockPos blockPos = globalPos.pos(); // Luminol end - Try fixing off main POI accessing
+ if (!io.papermc.paper.util.TickThread.isTickThreadFor(targetLevel, blockPos) && org.leavesmc.lumina.config.LuminaConfig.configModule.fix.fixFoliaPoiAccessOffRegion) return true; // Luminol - Try fixing off main POI accessing
Optional<Holder<PoiType>> optional = world.getPoiManager().getType(blockPos);
if (optional.isEmpty()) {
Expand Down

0 comments on commit d7fa2a0

Please sign in to comment.