mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-17 18:47:40 +01:00
Do not load chunks for Pathfinding
This commit is contained in:
parent
db2502d732
commit
f9ef3612f7
1 changed files with 16 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
--- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
+++ b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
@@ -478,7 +478,12 @@
|
||||
}
|
||||
|
||||
protected static PathType getPathTypeFromState(BlockGetter world, BlockPos pos) {
|
||||
- BlockState blockState = world.getBlockState(pos);
|
||||
+ // Paper start - Do not load chunks during pathfinding
|
||||
+ BlockState blockState = world.getBlockStateIfLoaded(pos);
|
||||
+ if (blockState == null) {
|
||||
+ return PathType.BLOCKED;
|
||||
+ }
|
||||
+ // Paper end
|
||||
Block block = blockState.getBlock();
|
||||
if (blockState.isAir()) {
|
||||
return PathType.OPEN;
|
Loading…
Add table
Reference in a new issue