mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-11 07:47:47 +00:00
Wrapped fluid rendering with safeIcon method.
This commit is contained in:
1 parent
3b762d300f
commit
112c0abc08
2 files changed
+9
-1
No files matched your search
@@ -236,7 +236,7 @@ public class RenderUtils
|
||||
Fluid fluid = stack.getFluid();
|
||||
CCRenderState.setColour(fluid.getColor(stack)<<8|alpha);
|
||||
TextureUtils.bindAtlas(fluid.getSpriteNumber());
|
||||
return fluid.getIcon(stack);
|
||||
return TextureUtils.safeIcon(fluid.getIcon(stack));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -176,4 +176,12 @@ public class TextureUtils
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Icon safeIcon(Icon icon)
|
||||
{
|
||||
if(icon == null)
|
||||
icon = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
||||
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user