1
0
Fork 0
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:
Aikar 2016-03-31 19:17:58 -04:00
parent db2502d732
commit f9ef3612f7

View file

@ -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;