aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0726-Don-t-lookup-fluid-state-when-raytracing.patch
blob: e16e510297cbcd7401bf2684877918f37914d54c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 28 Aug 2020 12:33:47 -0700
Subject: [PATCH] Don't lookup fluid state when raytracing

Just use the iblockdata already retrieved, removes a getType call.

diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
index bca0838e40bc91d78e9b93df5318642d1c9f341e..9cf2f046d50a8a0e08189c9b4b5d2f323d1f790d 100644
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
@@ -84,7 +84,7 @@ public interface BlockGetter extends LevelHeightAccessor {
                 return BlockHitResult.miss(raytrace1.getTo(), Direction.getNearest(vec3d.x, vec3d.y, vec3d.z), new BlockPos(raytrace1.getTo()));
             }
             // Paper end
-            FluidState fluid = this.getFluidState(blockposition);
+            FluidState fluid = iblockdata.getFluidState(); // Paper - don't need to go to world state again
             Vec3 vec3d = raytrace1.getFrom();
             Vec3 vec3d1 = raytrace1.getTo();
             VoxelShape voxelshape = raytrace1.getBlockShape(iblockdata, this, blockposition);