Package org.bukkit

Examples of org.bukkit.DyeColor


          if (mat == null)
            return def;
          tdat.setMaterial(mat);
        } else if (dat instanceof Wool) {
          Wool wdat = (Wool) dat;
          DyeColor color = parseEnum(DyeColor.class, text, null);
          if (color == null)
            return def;
          wdat.setColor(color);
        } else if (dat instanceof Tree) {
          Tree tdat = (Tree) dat;
View Full Code Here


      else css.write(String.format("{ background-position: -%dpx -%dpx; }\n",
        terrain_png_size * (x % 16), terrain_png_size * (x / 16)));

      if ((bd.getMaterial().getNewData((byte) 0) instanceof Colorable))
      {
        DyeColor color = DyeColor.getByWoolData(bd.getData());
        String hex = ColorConverter.dyeToHex(color);
        css.write(String.format("%s { color: %s; }\n", selector, hex));
      }
    }

View Full Code Here

  public String getDisplayName()
  {
    String bname = getMaterial().name().replaceAll("_+", " ");
    if ((getMaterial().getNewData((byte) 0) instanceof Colorable))
    {
      DyeColor color = DyeColor.getByWoolData(getData());
      ChatColor chatColor = ColorConverter.dyeToChat(color);

      String colorName = color.name().replaceAll("_+", " ");
      bname = chatColor + colorName + " " + bname + ChatColor.RESET;

    }
    return bname;
  }
View Full Code Here

                    if (mat.name().startsWith(type) && !mat.equals(material)) {
                        return (byte) texturedMaterial.getTextures().indexOf(mat);
                    }
                }
            } else if (materialData instanceof Colorable) {
                DyeColor color;

                try {
                    color = DyeColor.valueOf(type);
                } catch (IllegalArgumentException exception) {
                    return 0;
                }

                if (material == Material.INK_SACK) {
                    return color.getDyeData();
                }

                return color.getWoolData();
            } else if (materialData instanceof Tree) {
                try {
                    return TreeSpecies.valueOf(type).getData();
                } catch (IllegalArgumentException ex) {
                    return 0;
View Full Code Here

            }

            if (data instanceof TexturedMaterial) {
                return ((TexturedMaterial) data).getMaterial().name();
            } else if (data instanceof Colorable) {
                DyeColor color = ((Colorable) data).getColor();

                return (color != null ? color.name() : null);
            } else if (data instanceof Tree) {
                //TreeSpecies specie = TreeSpecies.getByData((byte) (data.getData() & 3)); //This works, but not as intended
                TreeSpecies specie = ((Tree) data).getSpecies();
                return (specie != null && specie != TreeSpecies.GENERIC ? specie.name() : null);
            } else if (data instanceof SpawnEgg) {
View Full Code Here

TOP

Related Classes of org.bukkit.DyeColor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.