Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. }
  2. if (e.getInventory().getName().equalsIgnoreCase(ChatUtil.fixColor("&6DEPOZYT"))) {
  3. e.setCancelled(true);
  4. e.setResult(Event.Result.DENY);
  5. final User u = UserManager.getUser(p);
  6. int koxw = 0;
  7. int refw = 0;
  8. int perlaw = 0;
  9. final int i = ItemStackUtil.getAmountOfItem(Material.GOLDEN_APPLE, p, (short)1);
  10. final int ii = ItemStackUtil.getAmountOfItem(Material.GOLDEN_APPLE, p, (short)0);
  11. final int iii = ItemStackUtil.getAmountOfItem(Material.ENDER_PEARL, p, (short)0);
  12. final int slot2 = e.getSlot();
  13. if (slot2 == 11) {
  14. if (u.getKox() <= 0) {
  15. ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cNie posiadasz koxow do wyplacenia!");
  16. return;
  17. }
  18. if (i >= Config.LIMIT_KOX) {
  19. ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cOsiagnales juz limit koxow w eq!");
  20. return;
  21. }
  22. if (u.getKox() <= Config.LIMIT_KOX) {
  23. refw = u.getKox();
  24. u.removeKox(refw);
  25. u.save();
  26. ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)1).build());
  27. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7koxow z depozytu!");
  28. SchowekGui.show(p);
  29. return;
  30. }
  31. if (i < Config.LIMIT_KOX) {
  32. final int ref = i - Config.LIMIT_KOX;
  33. koxw = ref * -1;
  34. u.removeKox(koxw);
  35. u.save();
  36. ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, koxw, (short)1).build());
  37. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + koxw + " &7koxow z depozytu!");
  38. SchowekGui.show(p);
  39. return;
  40. }
  41. }
  42. if (slot2 == 15) {
  43. if (u.getRefil() <= 0) {
  44. ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cNie posiadasz refili do wyplacenia!");
  45. return;
  46. }
  47. if (ii >= Config.LIMIT_REFILE) {
  48. ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cOsiagneles juz limit refili w eq!");
  49. return;
  50. }
  51. if (u.getRefil() <= Config.LIMIT_REFILE) {
  52. refw = u.getRefil();
  53. u.removeRefil(refw);
  54. u.save();
  55. ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)0).build());
  56. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7refili z depozytu!");
  57. SchowekGui.show(p);
  58. return;
  59. }
  60. if (ii < Config.LIMIT_REFILE) {
  61. final int ref = ii - Config.LIMIT_REFILE;
  62. refw = ref * -1;
  63. u.removeRefil(refw);
  64. u.save();
  65. ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)0).build());
  66. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7refili z depozytu!");
  67. SchowekGui.show(p);
  68. return;
  69. }
  70. }
  71. if (slot2 == 13) {
  72. if (u.getPerly() <= 0) {
  73. ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cNie posiadasz perel do wyplacenia!");
  74. return;
  75. }
  76. if (iii >= Config.LIMIT_PEARL) {
  77. ChatUtil.sendMessage((CommandSender)p, "&4Blad: &cOsiagneles juz limit perel w eq!");
  78. return;
  79. }
  80. if (u.getPerly() <= Config.LIMIT_PEARL) {
  81. refw = u.getPerly();
  82. u.removePerly(refw);
  83. u.save();
  84. ChatUtil.giveItems(p, new ItemBuilder(Material.ENDER_PEARL, refw, (short)0).build());
  85. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + refw + " &7perel z depozytu!");
  86. SchowekGui.show(p);
  87. return;
  88. }
  89. if (iii < Config.LIMIT_PEARL) {
  90. final int ref = iii - Config.LIMIT_PEARL;
  91. perlaw = ref * -1;
  92. u.removePerly(perlaw);
  93. u.save();
  94. ChatUtil.giveItems(p, new ItemBuilder(Material.ENDER_PEARL, perlaw, (short)0).build());
  95. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &e" + perlaw + " &7perel z depozytu!");
  96. SchowekGui.show(p);
  97. return;
  98. }
  99. }
  100. if (slot2 == 5) {
  101. if (u.getKox() <= Config.LIMIT_KOX) {
  102. koxw = u.getKox();
  103. u.removeKox(refw);
  104. u.save();
  105. ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, koxw, (short)1).build());
  106. }
  107. if (u.getRefil() <= Config.LIMIT_REFILE) {
  108. refw = u.getRefil();
  109. u.removeRefil(refw);
  110. u.save();
  111. ChatUtil.giveItems(p, new ItemBuilder(Material.GOLDEN_APPLE, refw, (short)0).build());
  112. }
  113. if (u.getPerly() <= Config.LIMIT_PEARL) {
  114. perlaw = u.getPerly();
  115. u.removePerly(perlaw);
  116. u.save();
  117. ChatUtil.giveItems(p, new ItemBuilder(Material.ENDER_PEARL, perlaw, (short)0).build());
  118. }
  119. ChatUtil.sendMessage((CommandSender)p, "&8» &7Wyplaciles: &epelen limit &7z depozytu!");
  120. SchowekGui.show(p);
  121. return;
  122. }
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement