Paper/patches/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch
Spottedleaf 41647af74c Do not use worldgen executor for api profile completions
We cannot put blocking network I/O onto the worldgen threads,
this will crash the server if it stalls
2022-07-03 14:55:56 -07:00

29 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Sat, 25 Apr 2020 17:10:55 -0700
Subject: [PATCH] Reduce blockpos allocation from 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 c48e097464977dbec22d1370c3393ba1fe105137..ede91a2fbe67480d2b6bcdeb776f87da0b69bdae 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
@@ -495,7 +495,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
return BlockPathTypes.DANGER_FIRE;
}
- if (world.getFluidState(pos).is(FluidTags.WATER)) {
+ if (blockState.getFluidState().is(FluidTags.WATER)) {
return BlockPathTypes.WATER_BORDER;
}
} // Paper
@@ -526,7 +526,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
} else if (blockState.is(Blocks.COCOA)) {
return BlockPathTypes.COCOA;
} else {
- FluidState fluidState = world.getFluidState(pos);
+ FluidState fluidState = blockState.getFluidState(); // Paper - remove another get type call
if (fluidState.is(FluidTags.LAVA)) {
return BlockPathTypes.LAVA;
} else if (isBurningBlock(blockState)) {