Guest User

Untitled

a guest
Oct 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public void onPlayerInteract(PlayerInteractEvent event) {
  2. if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
  3. if (plugin.getToggleOn().containsKey(event.getPlayer()) || (plugin.getValues()).containsKey(event.getPlayer())) {
  4. if (plugin.getToggleOn().get(event.getPlayer()).equals(true)) {
  5. Player p = event.getPlayer();
  6. World w = p.getWorld();
  7. List<Block> blocks = p.getLineOfSight(null, 300);
  8. int length = blocks.size() - 1;
  9. Block b = blocks.get(length);
  10. int x = b.getX();
  11. int y = b.getY();
  12. int z = b.getZ();
  13. Location location = new Location(w, x, y, z);
  14. w.createExplosion(location, plugin.getValues().get(p));
  15. p.sendMessage(ChatColor.GREEN
  16. + "Explosion created where you were looking.");
  17. }
  18. }
  19. }
  20. }
Add Comment
Please, Sign In to add comment