Examples of InventoryCanSetEvent


Examples of org.spout.vanilla.event.inventory.InventoryCanSetEvent

   * @param item to set to
   * @return True if the slot can be set to the item, False if not
   */
  protected boolean canSet(Inventory inventory, int index, ItemStack item) {
    final boolean canSet = inventory.canSet(index, item);
    InventoryCanSetEvent event = owner.getEngine().getEventManager().callEvent(new InventoryCanSetEvent(inventory, new PlayerCause(getPlayer()), index, item, !canSet));
    return !event.isCancelled();
  }
View Full Code Here

Examples of org.spout.vanilla.event.inventory.InventoryCanSetEvent

          int armorSlot = ((Armor) item.getMaterial()).getEquipableSlot();
          if (inv.getArmor().get(armorSlot) != null) {
            return false;
          }
          boolean canSet = inv.getArmor().canSet(armorSlot, item);
          InventoryCanSetEvent event = player.getEngine().getEventManager().callEvent(new InventoryCanSetEvent(inv.getArmor(), new BlockCause(block), armorSlot, item, !canSet));
          if (event.isCancelled()) {
            return false;
          }
          inv.getArmor().set(armorSlot, item, true);
          slot.addAmount(-1);
          return true;
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.