Skip to content

Commit

Permalink
Merge pull request #11 from GTNewHorizons/render-fix
Browse files Browse the repository at this point in the history
fix render npe from certain liquids
  • Loading branch information
Dream-Master authored Aug 22, 2022
2 parents 72c2673 + de3715c commit bba4eb1
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,15 @@ public int getColour(Fluid fluid) {
}
int colour = fluid.getColor();
if (colour == 0xFFFFFF) {
TextureAtlasSprite sprite = Minecraft.getMinecraft().getTextureMapBlocks()
.getTextureExtry(fluid.getStillIcon().getIconName());
TextureAtlasSprite sprite;
try {
sprite = Minecraft.getMinecraft().getTextureMapBlocks()
.getTextureExtry(fluid.getStillIcon().getIconName());
} catch (NullPointerException e) {
colourCache.put(fluid.getName(), colour);
return colour;
}

if (sprite != null && sprite.getFrameCount() > 0) {
int[][] image = sprite.getFrameTextureData(0);
int r = 0, g = 0, b = 0, count = 0;
Expand Down

0 comments on commit bba4eb1

Please sign in to comment.