Advertisement
Guest User

Untitled

a guest
Nov 26th, 2013
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. @EventHandler
  2.     public void OnPlayerRocket(PlayerInteractEvent event){
  3.         final Player player = event.getPlayer();
  4.         if (!plugin.RocketCooldown.contains(player.getName())){
  5.              if (!plugin.RocketCooldown2.contains(player.getName())){
  6.                 if((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() ==Action.RIGHT_CLICK_BLOCK) && player.getItemInHand().getType() == Material.FIREWORK){
  7.                 player.setVelocity(player.getLocation().getDirection()
  8.                         .multiply(1.05).setY(1.15));
  9.                 player.setExp(0.50F);
  10.                 plugin.RocketCooldown2.add(player.getName());
  11.             }
  12.              }
  13.              if (plugin.RocketCooldown2.contains(player.getName())){
  14.                     if((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() ==Action.RIGHT_CLICK_BLOCK) && player.getItemInHand().getType() == Material.FIREWORK){
  15.                         player.setVelocity(player.getLocation().getDirection()
  16.                                 .multiply(1.05).setY(1.15));
  17.                         plugin.RocketCooldown.add(player.getName());
  18.                         player.setExp(0);
  19.                        
  20.              }
  21.      
  22.              }
  23.         }
  24.     }
  25.     @EventHandler
  26.     public void OnGround(PlayerMoveEvent e){
  27.         Player p = e.getPlayer();    
  28.         if(p.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() != Material.AIR) {
  29.             plugin.RocketCooldown.remove(p.getName());
  30.             plugin.RocketCooldown2.remove(p.getName());
  31.             p.setExp(1);   
  32.         }
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement