package common.block.artificial;

import common.block.Material;
import common.color.DyeColor;
import common.item.CheatTab;
import common.item.Item;
import common.item.block.ItemBlock;
import common.model.BlockLayer;
import common.properties.Property;
import common.world.State;

public class BlockStainedGlassPane extends BlockPane
{
	public static final BlockStainedGlassPane[] PANES = new BlockStainedGlassPane[DyeColor.values().length];
	
    private final DyeColor color;
    
    public static BlockStainedGlassPane getByColor(DyeColor color) {
    	return PANES[color.getMetadata()];
    }

    public BlockStainedGlassPane(DyeColor color)
    {
        super(Material.TRANSLUCENT, false);
        this.color = color;
        this.setDefaultState(this.getBaseState().withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
        this.setTab(CheatTab.BLOCKS);
        PANES[color.ordinal()] = this;
    }
    
    public DyeColor getColor() {
    	return this.color;
    }

    public BlockLayer getBlockLayer()
    {
        return BlockLayer.TRANSLUCENT;
    }

    protected Property[] getProperties()
    {
        return new Property[] {NORTH, EAST, WEST, SOUTH};
    }
    
    protected String getPaneBase(State state) {
    	return this.color.getName() + "_glass";
    }
    
    protected String getPaneEdge(State state) {
    	return this.color.getName() + "_glass_pane";
    }
	
	protected Item getItemToRegister() {
		return new ItemBlock(this, "");
	}
}
