Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 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. List<String> lista = main.getConfig().getStringList(p.getUniqueId() + ".Blocks");
  8. int liczba = lista.size();
  9. if(!main.getConfig().contains(p.getUniqueId() + ".Blocks")) {
  10. liczba++;
  11. main.getConfig().set(p.getUniqueId() + ".Blocks" + "." + liczba, b.toString());
  12. main.saveConfig();
  13. p.sendMessage("Lista: " + main.getConfig().getString(p.getUniqueId() + ".Blocks"));
  14. p.sendMessage("Nie Istnieje");
  15. return;
  16. } else {
  17. if (main.getConfig().getString(p.getUniqueId() + ".Blocks").contains(b.toString())) {
  18. p.sendMessage("§cIstnieje taki blok");
  19. return;
  20. }
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement