From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf 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 5ff66dd2ff2e3027ee7f7b62d5398c965195d8ed..347cd0b7e1abbb03ee884261953da7e44ead0028 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java @@ -487,7 +487,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { return BlockPathTypes.DANGER_FIRE; } - if (world.getFluidState(pos).is(FluidTags.WATER)) { + if (blockState.getFluidState().is(FluidTags.WATER)) { // Paper - Perf: Reduce blockpos allocation from pathfinding return BlockPathTypes.WATER_BORDER; } @@ -520,7 +520,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 - Perf: Reduce blockpos allocation from pathfinding if (fluidState.is(FluidTags.LAVA)) { return BlockPathTypes.LAVA; } else if (isBurningBlock(blockState)) {