Fix fabulous pool item render, move TE render color calc from awt

This commit is contained in:
Hubry committed 2020-02-25 00:17:12 +01:00
1 parent c65062dd53
commit d365273ead
2 files changed
+4 -3

No files matched your search

@@ -62,8 +62,8 @@ public final class ColorHandler {
}
}
if (((BlockPool) state.getBlock()).variant == BlockPool.Variant.FABULOUS){
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
int fabulousColor = MathHelper.hsvToRGB(time * 0.005F, 0.6F, 1F);
float time = (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.005F;
int fabulousColor = MathHelper.hsvToRGB(time - (int) time, 0.6F, 1F);
return MathHelper.multiplyColor(fabulousColor, color);
}
return color;
@@ -64,7 +64,8 @@ public class RenderTilePool extends TileEntityRenderer<TilePool> {
if (fab) {
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
time += new Random(pool.getPos().getX() ^ pool.getPos().getY() ^ pool.getPos().getZ()).nextInt(100000);
int color = MathHelper.multiplyColor(Color.HSBtoRGB(time * 0.005F, 0.6F, 1F), pool.color.colorValue);
time *= 0.005F;
int color = MathHelper.multiplyColor(MathHelper.hsvToRGB(time - (int) time, 0.6F, 1F), pool.color.colorValue);
int red = (color & 0xFF0000) >> 16;
int green = (color & 0xFF00) >> 8;