50 lines
1.4 KiB
Java
Executable file
50 lines
1.4 KiB
Java
Executable file
package common.block.artificial;
|
|
|
|
import common.block.Material;
|
|
import common.color.DyeColor;
|
|
import common.item.CheatTab;
|
|
import common.item.Item;
|
|
import common.model.BlockLayer;
|
|
import common.properties.Property;
|
|
|
|
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.ordinal()];
|
|
}
|
|
|
|
public BlockStainedGlassPane(DyeColor color)
|
|
{
|
|
super(Material.TRANSLUCENT);
|
|
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() {
|
|
return this.color.getName() + "_glass";
|
|
}
|
|
|
|
protected String getPaneEdge() {
|
|
return this.color.getName() + "_glass_pane";
|
|
}
|
|
}
|