Add renderutil safety in unusual case an icon is missing

This commit is contained in:
Justin Aquadro committed 2016-02-07 01:34:45 -05:00
1 parent edec7874f1
commit 6852be7300
1 file changed
+18
@@ -137,6 +137,9 @@ public final class RenderUtil
}
public static void renderFaceYNegColorMult (RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, float r, float g, float b) {
if (icon == null)
return;
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(.5f * r, .5f * g, .5f * b);
if (renderer.blockAccess == null) {
@@ -154,6 +157,9 @@ public final class RenderUtil
}
public static void renderFaceYPosColorMult (RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, float r, float g, float b) {
if (icon == null)
return;
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(1f * r, 1f * g, 1f * b);
if (renderer.blockAccess == null) {
@@ -171,6 +177,9 @@ public final class RenderUtil
}
public static void renderFaceZNegColorMult (RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, float r, float g, float b) {
if (icon == null)
return;
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(.8f * r, .8f * g, .8f * b);
if (renderer.blockAccess == null) {
@@ -188,6 +197,9 @@ public final class RenderUtil
}
public static void renderFaceZPosColorMult (RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, float r, float g, float b) {
if (icon == null)
return;
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(.8f * r, .8f * g, .8f * b);
if (renderer.blockAccess == null) {
@@ -205,6 +217,9 @@ public final class RenderUtil
}
public static void renderFaceXNegColorMult (RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, float r, float g, float b) {
if (icon == null)
return;
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(.6f * r, .6f * g, .6f * b);
if (renderer.blockAccess == null) {
@@ -222,6 +237,9 @@ public final class RenderUtil
}
public static void renderFaceXPosColorMult (RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, float r, float g, float b) {
if (icon == null)
return;
Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_F(.6f * r, .6f * g, .6f * b);
if (renderer.blockAccess == null) {