Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public class ImpossibleInventory implements Listener {
  2. static ArrayList<Player> inv = new ArrayList<>();
  3.  
  4. @EventHandler
  5. public void invOpen(InventoryOpenEvent e) {
  6. Player p = (Player) e.getPlayer();
  7. if (inv.contains(p)) {
  8. inv.add(p);
  9. }
  10. }
  11.  
  12. @EventHandler
  13. public void invClose(InventoryCloseEvent e) {
  14. Player p = (Player) e.getPlayer();
  15. if (inv.contains(p)) {
  16. inv.remove(p);
  17. }
  18. }
  19.  
  20. @EventHandler
  21. public void onTeleport(PlayerTeleportEvent e) {
  22. Player p = e.getPlayer();
  23. if (inv.contains(p)) {
  24. inv.remove(p);
  25. }
  26. }
  27.  
  28. @EventHandler
  29. public void invClick(InventoryClickEvent e) {
  30. Player p = (Player) e.getWhoClicked();
  31. if (inv.contains(p)) {
  32. e.setCancelled(true);
  33. NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
  34. 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."));
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement