Advertisement
MrJonton01

method

Sep 3rd, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. private boolean checkInvSpace(Player p, int amount) {
  2.         int minusa = amount - 1;
  3.         //PointsAPI points = (PointsAPI) Bukkit.getPluginManager().getPlugin("PointsAPI");
  4.         for (int i = 0; i <= p.getInventory().getSize() - 1; i++) {
  5.             if (p.getInventory().firstEmpty() < 0) {
  6.                 if (p.getInventory().getItem(i).getType() == Material.EMERALD) {
  7.                     if (!p.getInventory().containsAtLeast(new ItemStack(Material.EMERALD), 64 - minusa)) {
  8.                         return true;
  9.                         /*ItemStack it = new ItemStack(Material.EMERALD, 1);
  10.                         points.removePoints(p, 25);
  11.                         p.getInventory().addItem(it);
  12.                         p.playSound(p.getLocation(), Sound.ORB_PICKUP, 1, 1);
  13.                         p.sendMessage(prefix + "§aDu hast §21 §aEmerald für §225 §aPunkte gekauft!");
  14.                         break;*/
  15.                     } else {
  16.                         continue;
  17.                     }
  18.                 } else {
  19.                     p.sendMessage("stome");
  20.                     continue;
  21.                 }
  22.             } else {
  23.                 break;
  24.             }
  25.         }
  26.         return false; //<<-------------------- DAS DA WEG >.<
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement