Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. @EventHandler
  2. public void onRClick(PlayerInteractEvent e) {
  3. Player p = e.getPlayer();
  4. Block b = e.getClickedBlock();
  5. if(e.getHand().equals(EquipmentSlot.HAND) ) {
  6. if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
  7. if(!main.getConfig().contains(p.getUniqueId() + ".Blocks")) {
  8. List<String> lista = new ArrayList<String>();
  9. lista.add(b.toString());
  10. List<String> liczba = main.getConfig().getStringList(p.getUniqueId() + ".Blocks");
  11. int ilosc = liczba.size();
  12. ilosc++;
  13. main.getConfig().set(p.getUniqueId() + ".Blocks." + ilosc, lista);
  14. main.saveConfig();
  15. p.sendMessage("Lista: " + main.getConfig().getString(p.getUniqueId() + ".Blocks."));
  16. p.sendMessage("Nie Istnieje");
  17. return;
  18. } else {
  19. if (main.getConfig().getStringList(p.getUniqueId() + ".Blocks.").contains(b.toString())) {
  20. p.sendMessage("§cIstnieje taki blok");
  21. return;
  22. }
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement