Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- if (e.getInventory().getName().equalsIgnoreCase(ChatUtil.fixColor("&6DEPOZYT"))) {
- e.setCancelled(true);
- e.setResult(Event.Result.DENY);
- final User u = UserManager.getUser(p);
- int koxw = 0;
- int refw = 0;
- int perlaw = 0;
- final int i = ItemStackUtil.getAmountOfItem(Material.GOLDEN_APPLE, p, (short)1);
- final int ii = ItemStackUtil.getAmountOfItem(Material.GOLDEN_APPLE, p, (short)0);
- final int iii = ItemStackUtil.getAmountOfItem(Material.ENDER_PEARL, p, (short)0);
- final int slot2 = e.getSlot();
- if (slot2 == 11) {
- if (u.getKox() <= 0) {
- ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cNie posiadasz koxow do wyplacenia!");
- return;
- }
- if (i >= Config.LIMIT_KOX) {
- ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cOsiagnales juz limit koxow w eq!");
- return;
- }
- if (u.getKox() <= Config.LIMIT_KOX) {
- refw = u.getKox();
- u.removeKox(refw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)1).build());
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7koxow z depozytu!");
- SchowekGui.show(p);
- return;
- }
- if (i < Config.LIMIT_KOX) {
- final int ref = i - Config.LIMIT_KOX;
- koxw = ref * -1;
- u.removeKox(koxw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, koxw, (short)1).build());
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + koxw + " &7koxow z depozytu!");
- SchowekGui.show(p);
- return;
- }
- }
- if (slot2 == 15) {
- if (u.getRefil() <= 0) {
- ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cNie posiadasz refili do wyplacenia!");
- return;
- }
- if (ii >= Config.LIMIT_REFILE) {
- ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cOsiagneles juz limit refili w eq!");
- return;
- }
- if (u.getRefil() <= Config.LIMIT_REFILE) {
- refw = u.getRefil();
- u.removeRefil(refw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)0).build());
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7refili z depozytu!");
- SchowekGui.show(p);
- return;
- }
- if (ii < Config.LIMIT_REFILE) {
- final int ref = ii - Config.LIMIT_REFILE;
- refw = ref * -1;
- u.removeRefil(refw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)0).build());
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7refili z depozytu!");
- SchowekGui.show(p);
- return;
- }
- }
- if (slot2 == 13) {
- if (u.getPerly() <= 0) {
- ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cNie posiadasz perel do wyplacenia!");
- return;
- }
- if (iii >= Config.LIMIT_PEARL) {
- ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cOsiagneles juz limit perel w eq!");
- return;
- }
- if (u.getPerly() <= Config.LIMIT_PEARL) {
- refw = u.getPerly();
- u.removePerly(refw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.ENDER_PEARL, refw, (short)0).build());
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7perel z depozytu!");
- SchowekGui.show(p);
- return;
- }
- if (iii < Config.LIMIT_PEARL) {
- final int ref = iii - Config.LIMIT_PEARL;
- perlaw = ref * -1;
- u.removePerly(perlaw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.ENDER_PEARL, perlaw, (short)0).build());
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + perlaw + " &7perel z depozytu!");
- SchowekGui.show(p);
- return;
- }
- }
- if (slot2 == 5) {
- if (u.getKox() <= Config.LIMIT_KOX) {
- koxw = u.getKox();
- u.removeKox(refw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, koxw, (short)1).build());
- }
- if (u.getRefil() <= Config.LIMIT_REFILE) {
- refw = u.getRefil();
- u.removeRefil(refw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)0).build());
- }
- if (u.getPerly() <= Config.LIMIT_PEARL) {
- perlaw = u.getPerly();
- u.removePerly(perlaw);
- u.save();
- ChatUtil.giveItems(p, new ItemBuilder(Material.ENDER_PEARL, perlaw, (short)0).build());
- }
- ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &epelen limit &7z depozytu!");
- SchowekGui.show(p);
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement