Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<String> blocos = Main.cf.getStringList("blocos-permitidos");
- @EventHandler
- public void a(BlockPlaceEvent e) {
- for (String s : blocos) {
- int id,data;
- if (s.contains(":")) {
- id = Integer.parseInt(s.split(":")[0]);
- data = Integer.parseInt(s.split(":")[1]);
- } else {
- id = Integer.parseInt(s);
- data = 0;
- }
- int bid = e.getBlock().getTypeId();
- int bdata = e.getBlock().getData();
- if (id == bid && data == bdata) {
- e.getPlayer().sendMessage("Permitido");
- continue;
- } else {
- e.getPlayer().sendMessage("Cancelado");
- e.setCancelled(true);
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment