2021-06-14 16:58:00 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2022-09-26 08:02:51 +00:00
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
2021-06-14 16:58:00 +00:00
|
|
|
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
|
2024-04-12 19:14:06 +00:00
|
|
|
index b125b9903454891e22a15a0a794d67be67fdb083..1cd7f0f1c7d62552e6609997c83f3df8dae13316 100644
|
2021-06-14 16:58:00 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
2024-04-12 19:14:06 +00:00
|
|
|
@@ -483,7 +483,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
|
2021-06-14 16:58:00 +00:00
|
|
|
return BlockPathTypes.DANGER_FIRE;
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (world.getFluidState(pos).is(FluidTags.WATER)) {
|
2024-01-20 11:50:16 +00:00
|
|
|
+ if (blockState.getFluidState().is(FluidTags.WATER)) { // Paper - Perf: Reduce blockpos allocation from pathfinding
|
2021-06-14 16:58:00 +00:00
|
|
|
return BlockPathTypes.WATER_BORDER;
|
|
|
|
}
|
2023-06-07 23:44:11 +00:00
|
|
|
|
2024-04-12 19:14:06 +00:00
|
|
|
@@ -516,7 +516,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)) {
|