Examples of Enchantment


Examples of org.bukkit.enchantments.Enchantment

//    }
   
    @Deprecated
    public static Enchantment getEnchantmentFromString(String e){
       
        Enchantment ench = null;
       
        String args[] = new String[2];
        if (e.contains(":"))
                args = e.split(":");
        else {
View Full Code Here

Examples of org.bukkit.enchantments.Enchantment

  public static void addParsedEnchantment(ItemStack item, Element element)
  {
    assert "enchant".equalsIgnoreCase(element.getName());
    String etype = element.getAttributeValue("type");
    Enchantment enchantment = Enchantment.getByName(etype);

    if (enchantment == null)
      try { enchantment = Enchantment.getById(Integer.parseInt(etype)); }
      catch (NumberFormatException e) {  }
View Full Code Here

Examples of org.bukkit.enchantments.Enchantment

        if (i != enchs.size() - 1)
          b.append(", ");
        else
          b.append(" " + GeneralWords.and + " ");
      }
      final Enchantment ench = e.getKey();
      if (ench == null)
        continue;
      b.append(EnchantmentType.toString(ench));
      b.append(" ");
      b.append(e.getValue());
View Full Code Here

Examples of org.bukkit.enchantments.Enchantment

 
  @SuppressWarnings("null")
  @Nullable
  public static EnchantmentType parse(final String s) {
    if (pattern.matcher(s).matches()) {
      final Enchantment ench = parseEnchantment(s.substring(0, s.lastIndexOf(' ')));
      if (ench == null)
        return null;
      return new EnchantmentType(ench, Utils.parseInt(s.substring(s.lastIndexOf(' ') + 1)));
    }
    final Enchantment ench = parseEnchantment(s);
    if (ench == null)
      return null;
    return new EnchantmentType(ench, -1);
  }
View Full Code Here

Examples of org.bukkit.enchantments.Enchantment

  }
 
  @Override
  @Nullable
  protected Integer[] get(final Event e, final ItemType[] source) {
    final Enchantment ench = enchantment.getSingle(e);
    if (ench == null)
      return new Integer[0];
    return get(source, new Converter<ItemType, Integer>() {
      @Override
      @Nullable
View Full Code Here

Examples of simpleserver.nbt.Inventory.Enchantment

            } else {
              player.addTMessage(Color.RED, "No enchantment with id %s exists.", id);
            }

          } else {
            item.addEnchantment(new Enchantment(id, level));
            changed = true;
          }
        } catch (NumberFormatException e) {
          player.addTMessage(Color.RED, "%s is not a valid enchantment", parts[i]);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.