mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-23 00:49:23 +00:00
36 lines
2.1 KiB
Diff
36 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
Date: Sun, 14 Aug 2022 11:18:44 +0800
|
|
Subject: [PATCH] Skip POI finding if stuck in vehicle
|
|
|
|
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
|
index 43243537b765a2d270be6de3f053fea77ff67d18..7d8a137068ab2b33690c369f4da46e90b5f98e2e 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
|
@@ -72,6 +72,7 @@ public class AcquirePoi extends Behavior<PathfinderMob> {
|
|
@Override
|
|
protected void start(ServerLevel world, PathfinderMob entity, long time) {
|
|
this.nextScheduledStart = time + 20L + (long)world.getRandom().nextInt(20);
|
|
+ if (top.leavesmc.leaves.LeavesConfig.skipPOIFindingInVehicle && entity.getNavigation().isStuck()) this.nextScheduledStart += 200L; // Leaves - wait an additional 10s to check again if they're stuck
|
|
PoiManager poiManager = world.getPoiManager();
|
|
this.batchCache.long2ObjectEntrySet().removeIf((entry) -> {
|
|
return !entry.getValue().isStillValid(time);
|
|
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
|
index f01a5349f59a98cb80b06d6b48d23bcd6cc59eb3..4112467e6e72b31ec0963d69800da758c089a0a0 100644
|
|
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
|
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
|
@@ -268,6 +268,11 @@ public final class LeavesConfig {
|
|
optimizeChunkTicking = getBoolean("settings.performance.optimize-chunk-ticking", optimizeChunkTicking);
|
|
}
|
|
|
|
+ public static boolean skipPOIFindingInVehicle = true;
|
|
+ private static void skipPOIFindingInVehicle() {
|
|
+ skipPOIFindingInVehicle = getBoolean("settings.performance.skip-poi-find-in-vehicle", skipPOIFindingInVehicle);
|
|
+ }
|
|
+
|
|
public static final class WorldConfig {
|
|
|
|
public final String worldName;
|