Examples of CustomItem


Examples of org.getspout.spoutapi.material.CustomItem

    }
  }

  @Override
  public ItemStack b(ItemStack itemstack, World world, EntityHuman entityhuman) {
    CustomItem item = MaterialData.getCustomItem(itemstack.getData());
    if (item instanceof Food) {
      --itemstack.count;
      entityhuman.getFoodData().eat(((Food) item).getHungerRestored(), 0.6F);
    }
    return itemstack;
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomItem

    return itemstack;
  }

  @Override
  public EnumAnimation c_(ItemStack itemstack) {
    CustomItem item = MaterialData.getCustomItem(itemstack.getData());
    if (item instanceof Food) {
      return EnumAnimation.EAT;
    }
    return super.c_(itemstack);
  }
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomItem

    return super.c_(itemstack);
  }

  @Override
  public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
    CustomItem item = MaterialData.getCustomItem(itemstack.getData());
    if (item instanceof Food) {
      Bukkit.getScheduler().scheduleSyncDelayedTask(Spout.getInstance(), new FoodUpdate(entityhuman, itemstack), 2);
    }

    return itemstack;
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomItem

  @EventHandler(priority = EventPriority.LOWEST)
  public void onPlayerDrop(PlayerDropItemEvent e) {
    SpoutItemStack sis = new SpoutItemStack(e.getItemDrop().getItemStack());
    if (!sis.containsEnchantment(SpoutEnchantment.UNSTACKABLE) && sis.isCustomItem()) {
      CustomItem ci = (CustomItem)sis.getMaterial();
      if (!ci.isStackable()) {
        sis.addEnchantment(SpoutEnchantment.UNSTACKABLE, 1000);
      }
    }
    e.getItemDrop().setItemStack(sis);
  }
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomItem

  @EventHandler(priority = EventPriority.LOWEST)
  public void onPlayerPickupItem(PlayerPickupItemEvent e) {
    SpoutItemStack sis = new SpoutItemStack(e.getItem().getItemStack());
    if (!sis.containsEnchantment(SpoutEnchantment.UNSTACKABLE) && sis.isCustomItem()) {
      CustomItem ci = (CustomItem)sis.getMaterial();
      if (!ci.isStackable()) {
        sis.addEnchantment(SpoutEnchantment.UNSTACKABLE, 1000);
      }
    }
    e.getItem().setItemStack(sis);
  }
View Full Code Here

Examples of org.getspout.spoutapi.material.CustomItem

    if (inHand == null) {
      return;
    }
    Material mat = MaterialData.getMaterial(inHand.getTypeId(), inHand.getDurability());
    if (mat instanceof CustomItem) {
      CustomItem item = (CustomItem)mat;
      event.setCancelled(!item.onItemInteract((SpoutPlayer)event.getPlayer(), (SpoutBlock)event.getClickedBlock(), event.getBlockFace()) || event.isCancelled());
    }
  }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomItem

    this.setHasSubtypes(true);
  }

  @Override
  public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
    CustomItem customItem = MaterialData.getCustomItem(item.getItemDamage());
    if (customItem instanceof Food) {
      if (player.canEat(false)) {
        player.setItemInUse(item, 32);
      } else {
        player.setEating(true);
View Full Code Here

Examples of org.spoutcraft.api.material.CustomItem

    return item;
  }

  @Override
  public EnumAction getItemUseAction(ItemStack item) {
    CustomItem customItem = MaterialData.getCustomItem(item.getItemDamage());
    if (customItem instanceof Food) {
      return EnumAction.eat;
    }
    return EnumAction.none;
  }
View Full Code Here

Examples of org.spoutcraft.api.material.CustomItem

    // Bypass stupidity
    ItemStack var10;
    if (MaterialData.getCustomItems().length == 0) {
      var10 = new ItemStack(Item.flint);
    } else {
      CustomItem cItem = MaterialData.getCustomItems()[0];
      var10 = new ItemStack(cItem.getRawId(), 1, cItem.getRawData());
    }
    // End of stupidity
    itemRenderer.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8);
    itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8);
    GL11.glDisable(GL11.GL_LIGHTING);
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.