Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. package punish.ban;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.Material;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.event.EventHandler;
  10. import org.bukkit.event.Listener;
  11. import org.bukkit.event.inventory.InventoryClickEvent;
  12. import org.bukkit.inventory.Inventory;
  13.  
  14. import api.Inventories.Items;
  15. import api.colour.ChatColour;
  16. import punish.PunishManager;
  17. import punish.ban.BanManager;
  18.  
  19. public class HackedClient implements Listener {
  20.  
  21. private static String MENUNAME = "&8Ban";
  22.  
  23. private static int[] blankSlots = {0,1,2,6,7,8,
  24. 9,10,11,12,13,14,15,16,17,
  25. 18,20,22,24,26,
  26. 27,28,29,30,31,32,33,34,35};
  27.  
  28. public static Inventory menu = Bukkit.createInventory(null, 36, ChatColour.Colour(MENUNAME));
  29.  
  30. public static void openInventory(Player player) {
  31.  
  32. for (int i : blankSlots)
  33. Items.InventoryItem(Material.STAINED_GLASS_PANE, 1, 0, " ", menu, i);
  34.  
  35. List<String> firstOffence = new ArrayList<String>();
  36. firstOffence.add("&790 Day ban");
  37.  
  38. List<String> secondOffence = new ArrayList<String>();
  39. secondOffence.add("&7180 Day ban");
  40.  
  41. List<String> thirdOffence = new ArrayList<String>();
  42. thirdOffence.add("&7Permanent ban");
  43.  
  44. List<String> custom = new ArrayList<String>();
  45. custom.add("&7Custom ban length");
  46.  
  47. Items.InventoryItem(Material.STAINED_CLAY, 1, 5, "&a1st Offence", menu, 19, firstOffence);
  48. Items.InventoryItem(Material.STAINED_CLAY, 1, 1, "&62nd Offence", menu, 21, secondOffence);
  49. Items.InventoryItem(Material.STAINED_CLAY, 1, 14, "&c3rd Offence", menu, 23, thirdOffence);
  50. Items.InventoryItem(Material.SIGN, 1, 0, "&9Custom Length", menu, 25, custom);
  51.  
  52. player.openInventory(menu);
  53.  
  54. }
  55.  
  56. @EventHandler
  57. public void onInventoryClick(InventoryClickEvent event) {
  58. Player player = (Player) event.getWhoClicked();
  59. if (event.getInventory().getName().equalsIgnoreCase(ChatColour.Colour(MENUNAME))) {
  60. event.setCancelled(true);
  61. }
  62.  
  63. if (event.getInventory().getName().equalsIgnoreCase(ChatColour.Colour(MENUNAME))) {
  64. if (event.getRawSlot() == 19) {
  65. BanManager.ban(102910210L, "HC-1", PunishManager.getPlayer(player));
  66. }
  67. }
  68. }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement