Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void OnPlayerRocket(PlayerInteractEvent event){
- final Player player = event.getPlayer();
- if (!plugin.RocketCooldown.contains(player.getName())){
- if (!plugin.RocketCooldown2.contains(player.getName())){
- if((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() ==Action.RIGHT_CLICK_BLOCK) && player.getItemInHand().getType() == Material.FIREWORK){
- player.setVelocity(player.getLocation().getDirection()
- .multiply(1.05).setY(1.15));
- player.setExp(0.50F);
- plugin.RocketCooldown2.add(player.getName());
- }
- }
- if (plugin.RocketCooldown2.contains(player.getName())){
- if((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() ==Action.RIGHT_CLICK_BLOCK) && player.getItemInHand().getType() == Material.FIREWORK){
- player.setVelocity(player.getLocation().getDirection()
- .multiply(1.05).setY(1.15));
- plugin.RocketCooldown.add(player.getName());
- player.setExp(0);
- }
- }
- }
- }
- @EventHandler
- public void OnGround(PlayerMoveEvent e){
- Player p = e.getPlayer();
- if(p.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() != Material.AIR) {
- plugin.RocketCooldown.remove(p.getName());
- plugin.RocketCooldown2.remove(p.getName());
- p.setExp(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement