mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
package com.hbm.blocks.generic;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
import net.minecraft.util.IIcon;
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
public class BlockTrinitite extends BlockOre {
|
|
|
|
public IIcon[] icons;
|
|
|
|
public BlockTrinitite(Material mat) {
|
|
super(mat);
|
|
}
|
|
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public IIcon getIcon(int side, int meta) {
|
|
return icons[0];
|
|
}
|
|
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public void registerBlockIcons(IIconRegister reg) {
|
|
icons = new IIcon[4];
|
|
|
|
for(int i = 0; i < 4; i++) icons[i] = reg.registerIcon(this.getTextureName() + "." + i);
|
|
this.blockIcon = icons[0];
|
|
}
|
|
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
|
long l = (long) (x * 3129871) ^ (long)y * 116129781L ^ (long)z;
|
|
l = l * l * 42317861L + l * 11L;
|
|
int i = (int)(l >> 16 & 3L);
|
|
return icons[(int)(Math.abs(i) % icons.length)];
|
|
}
|
|
}
|