diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java index c7af09704..9a1480b8a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java @@ -41,8 +41,10 @@ import org.bukkit.event.player.PlayerBucketFillEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.material.Bed; import org.bukkit.potion.PotionEffect; @@ -147,7 +149,7 @@ public class SpeedBuilders extends SoloGame private RecreationData _lastRecreationTarget; private double _standMoveProgress; private Location _standStart; - + private BuildData _nextBuild; public SpeedBuilders(ArcadeManager manager) @@ -1652,6 +1654,37 @@ public class SpeedBuilders extends SoloGame } } + @EventHandler + public void moveSetFlight(PlayerMoveEvent event) + { + if (!IsLive()) + return; + + if (_state != SpeedBuildersState.BUILDING) + return; + + if (!GetTeamList().get(0).HasPlayer(event.getPlayer())) + return; + + if (UtilEnt.isGrounded(event.getPlayer()) && !event.getPlayer().isFlying()) + event.getPlayer().setAllowFlight(true); + } + + @EventHandler + public void flightToggleJump(PlayerToggleFlightEvent event) + { + if (!GetTeamList().get(0).HasPlayer(event.getPlayer())) + return; + + event.setCancelled(true); + + event.getPlayer().setAllowFlight(false); + + event.getPlayer().playSound(event.getPlayer().getEyeLocation(), Sound.GHAST_FIREBALL, 1f, 1f); + + UtilAction.velocity(event.getPlayer(), new Vector(0, 1, 0)); + } + @Override public void EndCheck() {