aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2023-06-08 11:18:51 +0200
committerBjarne Koll <[email protected]>2023-06-08 11:18:51 +0200
commit1c1270169172e85588980eeb93dab9633b4e9af4 (patch)
treedd9c16f2a832d833af54a1450bae14fbb9c2ed26 /patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch
parentd5682d77c3651e1543a9c978e896dc90bdb77996 (diff)
downloadPaper-1c1270169172e85588980eeb93dab9633b4e9af4.tar.gz
Paper-1c1270169172e85588980eeb93dab9633b4e9af4.zip
Update fluid chunk loading patch
Diffstat (limited to 'patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch')
-rw-r--r--patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch b/patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch
new file mode 100644
index 0000000000..5adba4580e
--- /dev/null
+++ b/patches/server/0082-Do-not-load-chunks-for-Pathfinding.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Thu, 31 Mar 2016 19:17:58 -0400
+Subject: [PATCH] Do not load chunks for Pathfinding
+
+
+diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+index b7995e6159c865f8e2e7865f7eb51936a9720311..10503d6d8b6daf645cf4360ee289d5e25144c976 100644
+--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
++++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+@@ -459,7 +459,12 @@ public class WalkNodeEvaluator extends NodeEvaluator {
+ for(int n = -1; n <= 1; ++n) {
+ if (l != 0 || n != 0) {
+ pos.set(i + l, j + m, k + n);
+- BlockState blockState = world.getBlockState(pos);
++ // Paper start
++ BlockState blockState = world.getBlockStateIfLoaded(pos);
++ if (blockState == null) {
++ return BlockPathTypes.BLOCKED;
++ } else {
++ // Paper end
+ if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) {
+ return BlockPathTypes.DANGER_OTHER;
+ }
+@@ -475,6 +480,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
+ if (blockState.is(Blocks.WITHER_ROSE) || blockState.is(Blocks.POINTED_DRIPSTONE)) {
+ return BlockPathTypes.DAMAGE_CAUTIOUS;
+ }
++ } // Paper
+ }
+ }
+ }
+@@ -484,7 +490,8 @@ public class WalkNodeEvaluator extends NodeEvaluator {
+ }
+
+ protected static BlockPathTypes getBlockPathTypeRaw(BlockGetter world, BlockPos pos) {
+- BlockState blockState = world.getBlockState(pos);
++ BlockState blockState = world.getBlockStateIfLoaded(pos); // Paper
++ if (blockState == null) return BlockPathTypes.BLOCKED; // Paper
+ Block block = blockState.getBlock();
+ if (blockState.isAir()) {
+ return BlockPathTypes.OPEN;