Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onPlayerInteract(PlayerInteractEvent event) {
- if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
- if (plugin.getToggleOn().containsKey(event.getPlayer()) || (plugin.getValues()).containsKey(event.getPlayer())) {
- if (plugin.getToggleOn().get(event.getPlayer()).equals(true)) {
- Player p = event.getPlayer();
- World w = p.getWorld();
- List<Block> blocks = p.getLineOfSight(null, 300);
- int length = blocks.size() - 1;
- Block b = blocks.get(length);
- int x = b.getX();
- int y = b.getY();
- int z = b.getZ();
- Location location = new Location(w, x, y, z);
- w.createExplosion(location, plugin.getValues().get(p));
- p.sendMessage(ChatColor.GREEN
- + "Explosion created where you were looking.");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment