Fix red string renderer freaking because alpha is less than 0

This commit is contained in:
Vincent Lee committed 2020-01-21 21:48:14 -06:00
1 parent 1954b69e16
commit a6ad70f0bc
1 file changed
+5 -1
@@ -40,7 +40,7 @@ public class RenderTileRedString extends TileEntityRenderer<TileRedString> {
boolean hasWand = player != null && PlayerHelper.hasHeldItem(player, ModItems.twigWand);
if(sizeAlpha > 0F && !hasWand)
sizeAlpha -= 0.1F;
else if(sizeAlpha < 1F &&hasWand)
else if(sizeAlpha < 1F && hasWand)
sizeAlpha += 0.1F;
}
@@ -50,6 +50,10 @@ public class RenderTileRedString extends TileEntityRenderer<TileRedString> {
@Override
public void render(TileRedString tile, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int light, int overlay) {
if (sizeAlpha < 0) {
return;
}
int color = 0xFF0000 | ((int) (sizeAlpha * 255) << 24);
Direction dir = tile.getOrientation();