Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package punish.ban;
- import java.util.ArrayList;
- import java.util.List;
- import org.bukkit.Bukkit;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.inventory.InventoryClickEvent;
- import org.bukkit.inventory.Inventory;
- import api.Inventories.Items;
- import api.colour.ChatColour;
- import punish.PunishManager;
- import punish.ban.BanManager;
- public class HackedClient implements Listener {
- private static String MENUNAME = "&8Ban";
- private static int[] blankSlots = {0,1,2,6,7,8,
- 9,10,11,12,13,14,15,16,17,
- 18,20,22,24,26,
- 27,28,29,30,31,32,33,34,35};
- public static Inventory menu = Bukkit.createInventory(null, 36, ChatColour.Colour(MENUNAME));
- public static void openInventory(Player player) {
- for (int i : blankSlots)
- Items.InventoryItem(Material.STAINED_GLASS_PANE, 1, 0, " ", menu, i);
- List<String> firstOffence = new ArrayList<String>();
- firstOffence.add("&790 Day ban");
- List<String> secondOffence = new ArrayList<String>();
- secondOffence.add("&7180 Day ban");
- List<String> thirdOffence = new ArrayList<String>();
- thirdOffence.add("&7Permanent ban");
- List<String> custom = new ArrayList<String>();
- custom.add("&7Custom ban length");
- Items.InventoryItem(Material.STAINED_CLAY, 1, 5, "&a1st Offence", menu, 19, firstOffence);
- Items.InventoryItem(Material.STAINED_CLAY, 1, 1, "&62nd Offence", menu, 21, secondOffence);
- Items.InventoryItem(Material.STAINED_CLAY, 1, 14, "&c3rd Offence", menu, 23, thirdOffence);
- Items.InventoryItem(Material.SIGN, 1, 0, "&9Custom Length", menu, 25, custom);
- player.openInventory(menu);
- }
- @EventHandler
- public void onInventoryClick(InventoryClickEvent event) {
- Player player = (Player) event.getWhoClicked();
- if (event.getInventory().getName().equalsIgnoreCase(ChatColour.Colour(MENUNAME))) {
- event.setCancelled(true);
- }
- if (event.getInventory().getName().equalsIgnoreCase(ChatColour.Colour(MENUNAME))) {
- if (event.getRawSlot() == 19) {
- BanManager.ban(102910210L, "HC-1", PunishManager.getPlayer(player));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement