-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
319347e
commit 7bbd742
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
patches/server/0028-Allow-user-to-enable-moving-into-unloaded-chunks.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: "Sofiane H. Djerbi" <[email protected]> | ||
Date: Sun, 18 Jun 2023 18:10:19 +0300 | ||
Subject: [PATCH] Allow user to enable moving into unloaded chunks | ||
|
||
|
||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java | ||
index a00201eca053ef69b8d903fdb9538444baf85465..bb9f088e3b7b90ab38d794433fc5d30d39e12c76 100644 | ||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java | ||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java | ||
@@ -415,14 +415,14 @@ public class WorldConfiguration extends ConfigurationPart { | ||
public class Chunks extends Post { | ||
@Override | ||
public void postProcess() { | ||
- this.preventMovingIntoUnloadedChunks = true; | ||
+ //this.preventMovingIntoUnloadedChunks = true; // Kaiiju - Don't | ||
} | ||
// Folia end - region threading - force prevent moving into unloaded chunks | ||
|
||
public AutosavePeriod autoSaveInterval = AutosavePeriod.def(); | ||
public int maxAutoSaveChunksPerTick = 24; | ||
public int fixedChunkInhabitedTime = -1; | ||
- public boolean preventMovingIntoUnloadedChunks = false; | ||
+ public boolean preventMovingIntoUnloadedChunks = true; // Kaiiju - True not False | ||
public Duration delayChunkUnloadsBy = Duration.of("10s"); | ||
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> { | ||
map.defaultReturnValue(-1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: "Sofiane H. Djerbi" <[email protected]> | ||
Date: Mon, 19 Jun 2023 01:49:00 +0300 | ||
Subject: [PATCH] Don't pathfind outside region | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java b/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java | ||
index 1ab77f3518d1df30f66ae44d7d4fa69e5b32d93a..98bf17441da3169d49de55fe89d79ebe250a2b7e 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java | ||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java | ||
@@ -107,7 +107,9 @@ public class MoveToTargetSink extends Behavior<Mob> { | ||
|
||
private boolean tryComputePath(Mob entity, WalkTarget walkTarget, long time) { | ||
BlockPos blockPos = walkTarget.getTarget().currentBlockPosition(); | ||
+ if (io.papermc.paper.util.TickThread.isTickThreadFor((ServerLevel) entity.level(), blockPos)) // Kaiiju - Don't pathfind outside region | ||
this.path = entity.getNavigation().createPath(blockPos, 0); | ||
+ else this.path = null; // Kaiiju - Don't pathfind outside region | ||
this.speedModifier = walkTarget.getSpeedModifier(); | ||
Brain<?> brain = entity.getBrain(); | ||
if (this.reachedTarget(entity, walkTarget)) { |