package common.block.artificial;

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 BlockWool extends Block {
	public static final BlockWool[] WOOLS = new BlockWool[DyeColor.values().length];
	
	private final DyeColor color;
    
    public static BlockWool getByColor(DyeColor color) {
    	return WOOLS[color.getMetadata()];
    }

	public BlockWool(DyeColor color) {
		super(Material.BURNABLE);
		this.color = color;
		this.setTab(CheatTab.BLOCKS);
        this.setFlammable(30, 60);
		WOOLS[color.ordinal()] = this;
	}
	
	public DyeColor getColor() {
		return this.color;
	}

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