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
|
2022-12-07 20:16:54 +00:00
|
|
|
index 04406fdb2961a85d8e6bffbb8e233e8c4dcf4390..894881018c659d874f28f5744f0b8247cfecb1c1 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
|
2022-12-07 20:16:54 +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)) {
|
|
|
|
+ if (blockState.getFluidState().is(FluidTags.WATER)) {
|
|
|
|
return BlockPathTypes.WATER_BORDER;
|
|
|
|
}
|
|
|
|
} // Paper
|
2022-12-07 20:16:54 +00:00
|
|
|
@@ -514,7 +514,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
|
2021-06-14 16:58:00 +00:00
|
|
|
} 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)) {
|