From 75edd07da6b6247880a07eab784d013fe121d39a Mon Sep 17 00:00:00 2001 From: douira Date: Fri, 13 Dec 2024 19:57:55 +0100 Subject: [PATCH] avoid unnecessary coordinate fetch --- .../chunk/compile/pipeline/DefaultFluidRenderer.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/render/chunk/compile/pipeline/DefaultFluidRenderer.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/render/chunk/compile/pipeline/DefaultFluidRenderer.java index 826f9112bf..80bf9e1d48 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/render/chunk/compile/pipeline/DefaultFluidRenderer.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/render/chunk/compile/pipeline/DefaultFluidRenderer.java @@ -550,19 +550,14 @@ && isAlignedEquals(southEastHeight, southWestHeight) this.scratchPos.setWithOffset(blockPos, dir); if (this.isFluidSideExposed(level, this.scratchPos, dir, sideFluidHeight)) { - int adjX = this.scratchPos.getX(); - int adjY = this.scratchPos.getY(); - int adjZ = this.scratchPos.getZ(); - TextureAtlasSprite sprite = sprites[1]; boolean isOverlay = false; if (sprites.length > 2 && sprites[2] != null) { - BlockPos adjPos = this.scratchPos.set(adjX, adjY, adjZ); - BlockState adjBlock = level.getBlockState(adjPos); + BlockState adjBlock = level.getBlockState(this.scratchPos); - if (PlatformBlockAccess.getInstance().shouldShowFluidOverlay(adjBlock, level, adjPos, fluidState)) { + if (PlatformBlockAccess.getInstance().shouldShowFluidOverlay(adjBlock, level, this.scratchPos, fluidState)) { sprite = sprites[2]; isOverlay = true; }