コード例 #1
0
ファイル: RankMenu.java プロジェクト: uvbeenzaned/SnowBrawl
 public static ItemStack getCloseButton() {
   Dye red = new Dye();
   red.setColor(DyeColor.RED);
   ItemStack close = red.toItemStack(1);
   ItemMeta closemeta = close.getItemMeta();
   closemeta.setDisplayName(ChatColor.RED + "Close Ranks Menu");
   close.setItemMeta(closemeta);
   return close;
 }
コード例 #2
0
  @SuppressWarnings("javadoc")
  @Deprecated
  public short parseDurability(final String string, final Material material) {
    try {
      return Short.parseShort(string);
    } catch (final NumberFormatException e) {
    }

    final String s = string.replace(' ', '_').toUpperCase();
    MaterialData data = null;

    try {
      switch (material) {
        case COAL:
          data = new Coal(CoalType.valueOf(s));
          break;
        case WOOD:
        case LOG:
          data = new Tree(TreeSpecies.valueOf(s));
          break;
        case LEAVES:
          data = new Leaves(TreeSpecies.valueOf(s));
          break;
        case STEP:
        case DOUBLE_STEP:
          data = new Step(Material.valueOf(s));
          break;
        case INK_SACK:
          data = new Dye();
          ((Dye) data).setColor(DyeColor.valueOf(s));
          break;
        case WOOL:
          data = new Wool(DyeColor.valueOf(s));
          break;
        case MONSTER_EGGS:
          data = new MonsterEggs(Material.valueOf(s));
          break;
        case SMOOTH_BRICK:
          data = new SmoothBrick(Material.valueOf(s));
          break;
        case SANDSTONE:
          data = new Sandstone(Material.valueOf(s));
      }
    } catch (final IllegalArgumentException e) {
    }

    return data == null ? 0 : (short) data.getData();
  } // */
コード例 #3
0
 private Dye getDye(String data) {
   Dye dye = new Dye();
   dye.setColor(getDyeColor(data));
   return dye;
 }