Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int getFirstNotEmptySlot(ItemStackHandler inventory)
- {
- int slot = 0;
- int counter;
- for (counter = inventory.getSlots(); counter > 0; counter -= 1);
- {
- if (!inventory.getStackInSlot(counter).isEmpty())
- {
- return counter;
- }
- }
- return slot;
- }
- public int getFirstEmptySlot(ItemStackHandler inventory)
- {
- int slot = 0;
- int counter;
- for (counter = 0; counter < inventory.getSlots() - 1; counter += 1);
- {
- if (inventory.getStackInSlot(counter).isEmpty())
- {
- return counter;
- }
- }
- return slot;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement