Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onRClick(PlayerInteractEvent e) {
- Player p = e.getPlayer();
- Block b = e.getClickedBlock();
- if(e.getHand().equals(EquipmentSlot.HAND) ) {
- if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
- if(!main.getConfig().contains(p.getUniqueId() + ".Blocks")) {
- List<String> lista = new ArrayList<String>();
- lista.add(b.toString());
- List<String> liczba = main.getConfig().getStringList(p.getUniqueId() + ".Blocks");
- int ilosc = liczba.size();
- ilosc++;
- main.getConfig().set(p.getUniqueId() + ".Blocks." + ilosc, lista);
- main.saveConfig();
- p.sendMessage("Lista: " + main.getConfig().getString(p.getUniqueId() + ".Blocks."));
- p.sendMessage("Nie Istnieje");
- return;
- } else {
- if (main.getConfig().getStringList(p.getUniqueId() + ".Blocks.").contains(b.toString())) {
- p.sendMessage("§cIstnieje taki blok");
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement