Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public boolean canHop(Inventory i, ItemStack item, int hop) {
  2. if (i.firstEmpty() != -1) {
  3. return true;
  4. }
  5. boolean can = false;
  6. for (ItemStack it : i.getContents()) {
  7. if (it == null) {
  8. can = true;
  9. break;
  10. } else {
  11. if (it.isSimilar(item)) {
  12. if ((it.getAmount() + hop) <= it.getMaxStackSize()) {
  13. can = true;
  14. break;
  15. }
  16. }
  17. }
  18. }
  19. return can;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement