[ci skip] Add more patch identifying comments

This commit is contained in:
Nassim Jahnke 2024-01-23 14:34:17 +01:00
parent 484d6bfb4e
commit 52619e7a21
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
99 changed files with 360 additions and 393 deletions

View file

@ -5,7 +5,7 @@ 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 cd6778fa1d4261caf846ae71702621d2ec6b98c1..8e90b284fb576738b834626bb52c9962ccbc5ad2 100644
index cd6778fa1d4261caf846ae71702621d2ec6b98c1..dbb6a7d950b1a6f58a845b4d399ead6eb6d4fe14 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
@@ -465,7 +465,12 @@ public class WalkNodeEvaluator extends NodeEvaluator {
@ -13,12 +13,12 @@ index cd6778fa1d4261caf846ae71702621d2ec6b98c1..8e90b284fb576738b834626bb52c9962
if (l != 0 || n != 0) {
pos.set(i + l, j + m, k + n);
- BlockState blockState = world.getBlockState(pos);
+ // Paper start
+ // Paper start - Do not load chunks during pathfinding
+ BlockState blockState = world.getBlockStateIfLoaded(pos);
+ if (blockState == null) {
+ return BlockPathTypes.BLOCKED;
+ } else {
+ // Paper end
+ // Paper end - Do not load chunks during pathfinding
if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) {
return BlockPathTypes.DANGER_OTHER;
}
@ -35,8 +35,8 @@ index cd6778fa1d4261caf846ae71702621d2ec6b98c1..8e90b284fb576738b834626bb52c9962
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
+ BlockState blockState = world.getBlockStateIfLoaded(pos); // Paper - Do not load chunks during pathfinding
+ if (blockState == null) return BlockPathTypes.BLOCKED; // Paper - Do not load chunks during pathfinding
Block block = blockState.getBlock();
if (blockState.isAir()) {
return BlockPathTypes.OPEN;