Examples of VanillaMaterial


Examples of org.spout.vanilla.material.VanillaMaterial

      for (Field field : VanillaMaterials.class.getFields()) {
        try {
          if (field == null || ((field.getModifiers() & (Modifier.STATIC | Modifier.PUBLIC)) != (Modifier.STATIC | Modifier.PUBLIC)) || !VanillaMaterial.class.isAssignableFrom(field.getType())) {
            continue;
          }
          VanillaMaterial material = (VanillaMaterial) field.get(null);
          if (material == null) {
            fail("invalid material: VanillaMaterials field '" + field.getName() + "' is null");
          }
        } catch (NoClassDefFoundError ex) {
          staticInitFail(ex);
View Full Code Here

Examples of org.spout.vanilla.material.VanillaMaterial

   * @param force Whether the enchantment should be forced on the item
   * @return Whether the enchantment was able to be added to the item
   */
  @SuppressWarnings ("unchecked")
  public static boolean addEnchantment(ItemStack item, Enchantment enchantment, int powerLevel, boolean force) {
    VanillaMaterial material = (VanillaMaterial) item.getMaterial();
    if (hasEnchantment(item, enchantment)) {
      return false;
    }

    if (!force) {
View Full Code Here

Examples of org.spout.vanilla.material.VanillaMaterial

   * @param itemStack The item stack to enchant
   * @param level The level of enchantment
   * @return Whether enchantments were successfully added
   */
  public static boolean addRandomEnchantments(ItemStack itemStack, int level) {
    VanillaMaterial material = (VanillaMaterial) itemStack.getMaterial();
    Random random = GenericMath.getRandom();
    if (!(material instanceof VanillaItemMaterial)) {
      return false;
    }
    int enchantibility = ((VanillaItemMaterial) material).getEnchantability();
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.