Esempio n. 1
0
 @Override
 public void onSlotSet(InventoryBase inventory, int slot, ItemStack item) {
   super.onSlotSet(inventory, slot, item);
   int size = 0;
   for (InventoryBase i : getInventory().getInventories()) {
     if (i != craftingGrid.getGridInventory() && slot > i.getSize() + size) {
       size += i.getSize();
     }
   }
   for (int i : craftingGrid.getGridArray()) {
     if (i + size == slot) {
       updateOutput();
       break;
     }
   }
 }
Esempio n. 2
0
 @Override
 public boolean onClick(int clickedSlot, boolean rightClick, boolean shift) {
   int size = 0;
   for (InventoryBase i : getInventory().getInventories()) {
     if (i != craftingGrid.getGridInventory()) {
       size += i.getSize();
     }
   }
   if (itemOnCursor != null && clickedSlot == craftingGrid.getOutputSlot() + size && !shift) {
     return false;
   }
   return super.onClick(clickedSlot, rightClick, shift);
 }