Package ch.njol.skript.util

Examples of ch.njol.skript.util.InventorySlot


      public Slot get(final LivingEntity p) {
        if (!delayed) {
          if (e instanceof PlayerItemHeldEvent && ((PlayerItemHeldEvent) e).getPlayer() == p) {
            final PlayerInventory i = ((PlayerItemHeldEvent) e).getPlayer().getInventory();
            assert i != null;
            return new InventorySlot(i, getTime() >= 0 ? ((PlayerItemHeldEvent) e).getNewSlot() : ((PlayerItemHeldEvent) e).getPreviousSlot());
          } else if (e instanceof PlayerBucketEvent && ((PlayerBucketEvent) e).getPlayer() == p) {
            final PlayerInventory i = ((PlayerBucketEvent) e).getPlayer().getInventory();
            assert i != null;
            return new InventorySlot(i, ((PlayerBucketEvent) e).getPlayer().getInventory().getHeldItemSlot()) {
              @Override
              @Nullable
              public ItemStack getItem() {
                return getTime() <= 0 ? super.getItem() : ((PlayerBucketEvent) e).getItemStack();
              }
View Full Code Here


  protected Slot[] get(final Event e) {
    final ArrayList<Slot> r = new ArrayList<Slot>();
    for (final Inventory invi : invis.getArray(e)) {
      for (int i = 0; i < invi.getSize(); i++) {
        if (invi.getItem(i) != null)
          r.add(new InventorySlot(invi, i));
      }
    }
    return r.toArray(new Slot[r.size()]);
  }
View Full Code Here

     
      @Override
      public Slot next() {
        if (!hasNext())
          throw new NoSuchElementException();
        return new InventorySlot(current, next++);
      }
     
      @Override
      public void remove() {
        throw new UnsupportedOperationException();
View Full Code Here

        if (b.getType() != Material.FURNACE && b.getType() != Material.BURNING_FURNACE)
          return null;
        if (getTime() >= 0 && (e instanceof FurnaceSmeltEvent && b.equals(((FurnaceSmeltEvent) e).getBlock()) || e instanceof FurnaceBurnEvent && b.equals(((FurnaceBurnEvent) e).getBlock())) && !Delay.isDelayed(e)) {
          return new FurnaceEventSlot(e, ((Furnace) b.getState()).getInventory());
        } else {
          return new InventorySlot(((Furnace) b.getState()).getInventory(), slot);
        }
      }
    });
  }
View Full Code Here

TOP

Related Classes of ch.njol.skript.util.InventorySlot

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.