private static void stopGliding(final Player player) { player.setGliding(false); }
@Override public void remove() { super.remove(); this.bPlayer.addCooldown(this); MultiAbilityManager.unbindMultiAbility(this.player); flying.remove(this.player.getUniqueId()); if (this.player.isOnline() && !this.player.isDead()) { this.player.eject(); } ProjectKorra.flightHandler.removeInstance(this.player, ID); this.player.setGliding(this.hadGlide); }
this.player.setGliding(true); this.player.setAllowFlight(false); this.player.setFlying(false); this.player.setAllowFlight(false); this.player.setFlying(false); this.player.setGliding(true); this.particles(); } else if (this.mode == FlightMode.LEVITATE) { this.player.setGliding(false); this.player.setAllowFlight(true); this.player.setFlying(true); } else if (this.mode == FlightMode.ENDING) { this.player.setGliding(false); this.player.setAllowFlight(false); this.player.setFlying(false);
player.setGliding(false);
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onPlayerMove(PlayerMoveEvent e) { // Ignore only vertical movement if (e.getFrom().getBlockX() - e.getTo().getBlockX() == 0 && e.getFrom().getBlockZ() - e.getTo().getBlockZ() == 0) { return; } if (!checkAndNotify(e.getPlayer(), e.getTo()).equals(CheckResult.OPEN)) { e.setCancelled(true); e.getFrom().getWorld().playSound(e.getFrom(), Sound.BLOCK_ANVIL_HIT, 1F, 1F); e.getPlayer().setVelocity(new Vector(0,0,0)); e.getPlayer().setGliding(false); } // Check from - just in case the player is inside the island if (!check(e.getPlayer(), e.getFrom()).equals(CheckResult.OPEN)) { // Has to be done 1 tick later otherwise it doesn't happen for some reason... Bukkit.getScheduler().runTask(BentoBox.getInstance(), () -> eject(e.getPlayer())); } }
Location home = getSafeHomeLocation(world, user, number); player.setGliding(false);