Package org.bukkit

Examples of org.bukkit.Material


        return 0;
    }
   
    private boolean restoreLast(Repairable r)
    {
        Material t = r.getType();
        MaterialData m = r.getState().getData();
       
        return (m instanceof Attachable || m instanceof Redstone || m instanceof Door || m instanceof Bed || t == Material.STATIONARY_LAVA || t == Material.STATIONARY_WATER || t == Material.FIRE);
    }
View Full Code Here


                case 5:  variant = Horse.Variant.UNDEAD_HORSE;   break;
                default: break;
            }

            // Barding
            Material barding = null;
            switch ((amount >> 3) % 4) {
                case 1: barding = Material.IRON_BARDING;    break;
                case 2: barding = Material.GOLD_BARDING;    break;
                case 3: barding = Material.DIAMOND_BARDING; break;
                default: break;
View Full Code Here

      int lvl = cs.getInt(name + ".Enchantments.Levels");
      double chance = cs.getDouble(name + ".Chance");
      String color = cs.getString(name + ".Color");
      List<Material> l = new ArrayList<Material>();
      for (String s : cs.getStringList(name + ".Materials")) {
        Material mat = Material.getMaterial(s.toUpperCase());
        if (mat != null)
          l.add(mat);
      }
      for (String s : cs.getStringList(name + ".Material")) {
        Material mat = Material.getMaterial(s.toUpperCase());
        if (mat != null)
          l.add(mat);
      }
      List<String> lore = new ArrayList<String>();
      for (String s : cs.getStringList(name + ".Lore"))
View Full Code Here

          plugin.log.warning(e.getMessage());
      }
    }
    for (String name : fc.getKeys(false)) {
      ConfigurationSection cs = fc.getConfigurationSection(name);
      Material mat = Material.matchMaterial(cs.getString("Material"));
      ChatColor color = ChatColor.valueOf(cs.getString("Color")
          .toUpperCase());
      List<String> lore = cs.getStringList("Lore");
      ItemStack tool = new ItemStack(mat);
      List<String> list = new ArrayList<String>();
View Full Code Here

    }
  }

  public void loadMaterialFile(final HashMap<Material, List<String>> hm,
      final File f) {
    Material m = Material.getMaterial(f.getName().replace(".txt", "")
        .toUpperCase());
    List<String> l = new ArrayList<String>();
    try {
      BufferedReader list = new BufferedReader(new FileReader(f));
      String p;
View Full Code Here

  public SockettedItem(final Material mat) {
    super(mat);
    this.tier = DiabloDrops.getInstance().getDropAPI().getTier();
    while (tier == null)
      tier = DiabloDrops.getInstance().getDropAPI().getTier();
    Material material = mat;
    if ((tier.getMaterials().size() > 0)
        && !tier.getMaterials().contains(mat)) {
      material = tier.getMaterials().get(
          DiabloDrops.getInstance().getSingleRandom()
              .nextInt(tier.getMaterials().size()));
View Full Code Here

   */
  public ItemStack getIdItem(Material mat, final String name) {
    while (mat == null) {
      mat = dropPicker();
    }
    Material material = mat;
    ItemStack ci = null;
    Tier tier = getTier();
    while (tier == null) {
      tier = getTier();
    }
View Full Code Here

   * @param passTier
   *            Tier of ItemStack
   * @return ItemStack with a Material of passMat and a Tier of passTier
   */
  public ItemStack getItem(Material passMat, Tier passTier) {
    Material mat = passMat;
    Tier tier = passTier;
    while (mat == null) {
      mat = dropPicker();
    }
    ItemStack ci = null;
View Full Code Here

   * @param tier
   *            Tier of ItemStack
   * @return Randomly generated ItemStack of Tier tier
   */
  public ItemStack getItem(Tier tier) {
    Material mat = dropPicker();
    while (mat == null) {
      mat = dropPicker();
    }
    while (tier == null) {
      tier = getTier();
View Full Code Here

        && !plugin.getItemAPI().isTool(event.getResult().getType()))
      return;
    ItemStack is = plugin.furnanceMap.remove(event.getBlock());
    if (is == null)
      return;
    Material fuel = is.getType();
    if (!is.hasItemMeta() || !is.getItemMeta().hasDisplayName())
      return;
    ChatColor fuelColor = findColor(is.getItemMeta().getDisplayName());

    ItemStack tool = event.getResult();
    ItemStack oldtool = event.getSource();
    ItemMeta metaold;
    if (oldtool.hasItemMeta())
      metaold = oldtool.getItemMeta();
    else
      metaold = Bukkit.getItemFactory().getItemMeta(oldtool.getType());

    if (!metaold.hasLore()) {
      event.setCancelled(true);
      event.setResult(oldtool);
      return;
    }

    boolean namTest = false;
    for (String n : metaold.getLore())
      if (ChatColor.stripColor(n).equalsIgnoreCase("(Socket)")) {
        namTest = true;
      }
    if (!namTest) {
      event.setResult(event.getSource());
      return;
    }

    tool.addUnsafeEnchantments(oldtool.getEnchantments());

    ItemMeta meta = tool.getItemMeta();
    if (fuel.equals(Material.SKULL_ITEM)) {
      ChatColor color = ChatColor.WHITE;
      if (metaold.hasDisplayName())
        color = findColor(metaold.getDisplayName());
      SkullMeta skull = (SkullMeta) is.getItemMeta();
      String skullName = skull.getOwner();
View Full Code Here

TOP

Related Classes of org.bukkit.Material

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.