Skip to content

Commit

Permalink
avoid unnecessary coordinate fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
douira committed Dec 13, 2024
1 parent 4c635e9 commit 75edd07
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 75edd07

Please sign in to comment.