Skip to content

Commit

Permalink
do null check
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoriusT committed Nov 1, 2023
1 parent 2e7af67 commit 2667116
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/gregapi/render/RendererBlockFluid.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2021 GregTech-6 Team
* Copyright (c) 2023 GregTech-6 Team
*
* This file is part of GregTech.
*
Expand All @@ -19,21 +19,23 @@

package gregapi.render;

import static gregapi.data.CS.*;

import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import gregapi.data.FL;
import gregapi.util.UT;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.IFluidBlock;

import static gregapi.data.CS.F;
import static gregapi.data.CS.T;

public class RendererBlockFluid implements ISimpleBlockRenderingHandler {
public static int RENDER_ID = FluidRegistry.renderIdFluid;
public static RendererBlockFluid INSTANCE;
Expand Down Expand Up @@ -126,8 +128,8 @@ public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Blo
rRendered = T;
IIcon iconStill = aFluid.getIcon(1, bMeta);
float flowDir = (float)BlockFluidBase.getFlowDirection(aWorld, aX, aY, aZ);

if (flowDir > -999.0F) iconStill = aFluid.getIcon(2, bMeta);
if (iconStill == null) iconStill = Blocks.water.getIcon(0, 0);

heightNW -= RENDER_OFFSET;
heightSW -= RENDER_OFFSET;
Expand Down

0 comments on commit 2667116

Please sign in to comment.