Basalt side textures
@ -8,16 +8,22 @@ import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockOreBasalt extends BlockEnumMulti {
|
||||
|
||||
protected IIcon[] topIcons;
|
||||
|
||||
public BlockOreBasalt() {
|
||||
super(Material.rock, EnumBasaltOreType.class, true, true);
|
||||
@ -79,4 +85,25 @@ public class BlockOreBasalt extends BlockEnumMulti {
|
||||
return ModBlocks.getDropsWithoutDamage(world, this, metadata, fortune);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
this.topIcons = new IIcon[enums.length];
|
||||
|
||||
for(int i = 0; i < topIcons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.topIcons[i] = reg.registerIcon(this.getTextureMultiName(num) + "_top");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(side <= 1) return this.topIcons[meta % this.topIcons.length];
|
||||
return super.getIcon(side, meta);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
src/main/resources/assets/hbm/textures/blocks/basalt_top.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 976 B |
|
After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 908 B |
|
After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1017 B |
|
After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 947 B |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 4.6 KiB |