Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ImpossibleInventory implements Listener {
- static ArrayList<Player> inv = new ArrayList<>();
- @EventHandler
- public void invOpen(InventoryOpenEvent e) {
- Player p = (Player) e.getPlayer();
- if (inv.contains(p)) {
- inv.add(p);
- }
- }
- @EventHandler
- public void invClose(InventoryCloseEvent e) {
- Player p = (Player) e.getPlayer();
- if (inv.contains(p)) {
- inv.remove(p);
- }
- }
- @EventHandler
- public void onTeleport(PlayerTeleportEvent e) {
- Player p = e.getPlayer();
- if (inv.contains(p)) {
- inv.remove(p);
- }
- }
- @EventHandler
- public void invClick(InventoryClickEvent e) {
- Player p = (Player) e.getWhoClicked();
- if (inv.contains(p)) {
- e.setCancelled(true);
- NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
- api.sendAdminNotifyMessage(StringUtil.colorize("&8&l[&6Trovical&8&l] &7&l>&6 &cPlease check &6&l" + p.getDisplayName() + " &cfor hacks as they could be using ImpossibleInventory/AutoArmor."));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement