package common.block.natural;

import common.block.Block;
import common.block.Material;
import common.color.DyeColor;
import common.item.CheatTab;
import common.model.Model;
import common.model.ModelProvider;
import common.world.State;

public class BlockColoredClay extends Block {
	public static final BlockColoredClay[] CLAY = new BlockColoredClay[DyeColor.values().length];
	
	private final DyeColor color;
    
    public static BlockColoredClay getByColor(DyeColor color) {
    	return CLAY[color.getMetadata()];
    }

	public BlockColoredClay(DyeColor color) {
		super(Material.SOLID);
		this.color = color;
		this.setTab(CheatTab.NATURE);
		CLAY[color.ordinal()] = this;
	}
	
	public DyeColor getColor() {
		return this.color;
	}

	public Model getModel(ModelProvider provider, String name, State state) {
		return provider.getModel(this.color.getName() + "_clay").add().all();
	}
}
