geforkt von Mirrors/Paper
29 Zeilen
1.6 KiB
Diff
29 Zeilen
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
|
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
|
@@ -0,0 +0,0 @@ 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
|
|
@@ -0,0 +0,0 @@ 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)) {
|