Skip to content

Instantly share code, notes, and snippets.

@justisr
Last active December 26, 2015 23:32
Show Gist options
  • Save justisr/bd0acbc6eabc43709ce7 to your computer and use it in GitHub Desktop.
Save justisr/bd0acbc6eabc43709ce7 to your computer and use it in GitHub Desktop.
Simple stained glass pain enum for all the available colors.
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
public enum Pane {
WHITE(0),
ORANGE(1),
LIGHT_PURPLE(2),
LIGHT_BLUE(3),
YELLOW(4),
LIGHT_GREEN(5),
PINK(6),
DARK_GRAY(7),
LIGHT_GRAY(8),
AQUA(9),
PURPLE(10),
BLUE(11),
BROWN(12),
GREEN(13),
RED(14),
BLACK(15);
private short index;
private Pane(int damage) {
this.index = ((short) damage);
}
public int damage() {
return this.index;
}
public ItemStack getItem() {
return new ItemStack(Material.STAINED_GLASS_PANE, 1, this.index);
}
public static int id() {
return 160;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment