diff options
Diffstat (limited to 'patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch')
-rw-r--r-- | patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch b/patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch new file mode 100644 index 0000000000..a3846cba0b --- /dev/null +++ b/patches/server/0470-Reduce-blockpos-allocation-from-pathfinding.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf <[email protected]> +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 8e90b284fb576738b834626bb52c9962ccbc5ad2..2aca9b193db5dadc4fb90b8d7548277b698924aa 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +@@ -479,7 +479,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; + } + +@@ -510,7 +510,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { + } else if (blockState.is(Blocks.COCOA)) { + return BlockPathTypes.COCOA; + } else if (!blockState.is(Blocks.WITHER_ROSE) && !blockState.is(Blocks.POINTED_DRIPSTONE)) { +- FluidState fluidState = world.getFluidState(pos); ++ FluidState fluidState = blockState.getFluidState(); // Paper - remove another getFluidState call + if (fluidState.is(FluidTags.LAVA)) { + return BlockPathTypes.LAVA; + } else if (isBurningBlock(blockState)) { |