aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches-Unmapped/0586-Reduce-blockpos-allocation-from-pathfinding.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches-Unmapped/0586-Reduce-blockpos-allocation-from-pathfinding.patch')
-rw-r--r--Spigot-Server-Patches-Unmapped/0586-Reduce-blockpos-allocation-from-pathfinding.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/Spigot-Server-Patches-Unmapped/0586-Reduce-blockpos-allocation-from-pathfinding.patch b/Spigot-Server-Patches-Unmapped/0586-Reduce-blockpos-allocation-from-pathfinding.patch
new file mode 100644
index 0000000000..2640189324
--- /dev/null
+++ b/Spigot-Server-Patches-Unmapped/0586-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/PathfinderNormal.java b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java
+index d14f2800237c2a80912bf6f2d418a9ba9031070d..a0c7d3ab747ba1a3cf07e716f3591663a8a9e14b 100644
+--- a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java
++++ b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java
+@@ -498,7 +498,7 @@ public class PathfinderNormal extends PathfinderAbstract {
+ return PathType.DANGER_FIRE;
+ }
+
+- if (iblockaccess.getFluid(blockposition_mutableblockposition).a((Tag) TagsFluid.WATER)) {
++ if (iblockdata.getFluid().a((Tag) TagsFluid.WATER)) { // Paper - remove another getType call
+ return PathType.WATER_BORDER;
+ }
+ } // Paper
+@@ -528,7 +528,7 @@ public class PathfinderNormal extends PathfinderAbstract {
+ } else if (iblockdata.a(Blocks.COCOA)) {
+ return PathType.COCOA;
+ } else {
+- Fluid fluid = iblockaccess.getFluid(blockposition);
++ Fluid fluid = iblockdata.getFluid(); // Paper - remove another get type call
+
+ return fluid.a((Tag) TagsFluid.WATER) ? PathType.WATER : (fluid.a((Tag) TagsFluid.LAVA) ? PathType.LAVA : (a(iblockdata) ? PathType.DAMAGE_FIRE : (BlockDoor.l(iblockdata) && !(Boolean) iblockdata.get(BlockDoor.OPEN) ? PathType.DOOR_WOOD_CLOSED : (block instanceof BlockDoor && material == Material.ORE && !(Boolean) iblockdata.get(BlockDoor.OPEN) ? PathType.DOOR_IRON_CLOSED : (block instanceof BlockDoor && (Boolean) iblockdata.get(BlockDoor.OPEN) ? PathType.DOOR_OPEN : (block instanceof BlockMinecartTrackAbstract ? PathType.RAIL : (block instanceof BlockLeaves ? PathType.LEAVES : (!block.a((Tag) TagsBlock.FENCES) && !block.a((Tag) TagsBlock.WALLS) && (!(block instanceof BlockFenceGate) || (Boolean) iblockdata.get(BlockFenceGate.OPEN)) ? (!iblockdata.a(iblockaccess, blockposition, PathMode.LAND) ? PathType.BLOCKED : PathType.OPEN) : PathType.FENCE))))))));
+ }