Esempio n. 1
0
 public FireJet(Player player) {
   if (instances.containsKey(player)) {
     // player.setAllowFlight(canfly);
     instances.remove(player);
     return;
   }
   if (timers.containsKey(player)) {
     if (System.currentTimeMillis()
         < timers.get(player)
             + (long) ((double) cooldown / Tools.getFirebendingDayAugment(player.getWorld()))) {
       return;
     }
   }
   factor = Tools.firebendingDayAugment(defaultfactor, player.getWorld());
   Block block = player.getLocation().getBlock();
   if (FireStream.isIgnitable(player, block)
       || block.getType() == Material.AIR
       || AvatarState.isAvatarState(player)) {
     player.setVelocity(
         player.getEyeLocation().getDirection().clone().normalize().multiply(factor));
     block.setType(Material.FIRE);
     this.player = player;
     // canfly = player.getAllowFlight();
     player.setAllowFlight(true);
     time = System.currentTimeMillis();
     timers.put(player, time);
     instances.put(player, this);
   }
 }
Esempio n. 2
0
 public void progress() {
   if (player.isDead() || !player.isOnline()) {
     // player.setAllowFlight(canfly);
     instances.remove(player);
     return;
   }
   if ((Tools.isWater(player.getLocation().getBlock())
           || System.currentTimeMillis() > time + duration)
       && !AvatarState.isAvatarState(player)) {
     // player.setAllowFlight(canfly);
     instances.remove(player);
   } else {
     player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 1);
     player.setVelocity(
         player.getEyeLocation().getDirection().clone().normalize().multiply(factor));
     player.setFallDistance(0);
   }
 }