mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-16 18:44:44 +00:00
Dyeing fabulous pools now multiplies the color instead of ignoring dye
This commit is contained in:
1 parent
a9496b98ae
commit
cc73e72fbc
2 files changed
+16
-13
No files matched your search
@@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.FoliageColors;
|
||||
import net.minecraft.world.biome.BiomeColors;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -36,7 +37,7 @@ import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import vazkii.botania.common.item.material.ItemPetal;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
public final class ColorHandler {
|
||||
|
||||
@@ -52,19 +53,20 @@ public final class ColorHandler {
|
||||
(state, world, pos, tintIndex) -> {
|
||||
if(tintIndex != 0)
|
||||
return -1;
|
||||
|
||||
if (((BlockPool) state.getBlock()).variant == BlockPool.Variant.FABULOUS) {
|
||||
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
|
||||
return Color.HSBtoRGB(time * 0.005F, 0.6F, 1F);
|
||||
} else {
|
||||
if(world != null && pos != null) {
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if(te instanceof TilePool) {
|
||||
return ((TilePool) te).color.colorValue;
|
||||
}
|
||||
|
||||
int color = DyeColor.WHITE.colorValue;
|
||||
if(world != null && pos != null) {
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if(te instanceof TilePool) {
|
||||
color = ((TilePool) te).color.colorValue;
|
||||
}
|
||||
return DyeColor.WHITE.colorValue;
|
||||
}
|
||||
if (((BlockPool) state.getBlock()).variant == BlockPool.Variant.FABULOUS){
|
||||
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
|
||||
int fabulousColor = MathHelper.hsvToRGB(time * 0.005F, 0.6F, 1F);
|
||||
return MathHelper.multiplyColor(fabulousColor, color);
|
||||
}
|
||||
return color;
|
||||
},
|
||||
ModBlocks.manaPool, ModBlocks.creativePool, ModBlocks.dilutedPool, ModBlocks.fabulousPool
|
||||
);
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.mana.IPoolOverlayProvider;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
@@ -63,7 +64,7 @@ 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 = Color.HSBtoRGB(time * 0.005F, 0.6F, 1F);
|
||||
int color = MathHelper.multiplyColor(Color.HSBtoRGB(time * 0.005F, 0.6F, 1F), pool.color.colorValue);
|
||||
|
||||
int red = (color & 0xFF0000) >> 16;
|
||||
int green = (color & 0xFF00) >> 8;
|
||||
|
||||
Reference in new issue
Block a user