mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-23 21:49:50 +00:00
Bifrost blocks now color beacons
This commit is contained in:
1 parent
2c72183f77
commit
18c83d6505
1 file changed
+12
@@ -11,6 +11,8 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.AbstractGlassBlock;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -32,4 +34,14 @@ public class BlockBifrostPerm extends AbstractGlassBlock {
|
||||
world.addParticle(data, pos.getX() + Math.random(), pos.getY() + Math.random(), pos.getZ() + Math.random(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float[] getBeaconColorMultiplier(BlockState state, IWorldReader world, BlockPos pos, BlockPos beaconPos) {
|
||||
int rgb = MathHelper.hsvToRGB(world.getDimension().getWorld().getGameTime() * 5 % 360 / 360F, 0.4F, 0.9F);
|
||||
float[] ret = new float[3];
|
||||
ret[0] = ((rgb >> 16) & 0xFF) / 255.0F;
|
||||
ret[1] = ((rgb >> 8) & 0xFF) / 255.0F;
|
||||
ret[2] = (rgb & 0xFF) / 255.0F;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user