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)) {
- List<String> lista = main.getConfig().getStringList(p.getUniqueId() + ".Blocks");
- int liczba = lista.size();
- if(!main.getConfig().contains(p.getUniqueId() + ".Blocks")) {
- liczba++;
- main.getConfig().set(p.getUniqueId() + ".Blocks" + "." + liczba, b.toString());
- main.saveConfig();
- p.sendMessage("Lista: " + main.getConfig().getString(p.getUniqueId() + ".Blocks"));
- p.sendMessage("Nie Istnieje");
- return;
- } else {
- if (main.getConfig().getString(p.getUniqueId() + ".Blocks").contains(b.toString())) {
- p.sendMessage("§cIstnieje taki blok");
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement