From 5081d1f9a54663b75d7c8acc1c89fc201ec6af98 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 4 Jul 2020 08:43:53 +0200 Subject: [PATCH] Fix walking to enemy --- src/de/steamwar/misslewars/listener/ArenaListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/misslewars/listener/ArenaListener.java b/src/de/steamwar/misslewars/listener/ArenaListener.java index 92aacd9..d29db7f 100644 --- a/src/de/steamwar/misslewars/listener/ArenaListener.java +++ b/src/de/steamwar/misslewars/listener/ArenaListener.java @@ -13,6 +13,7 @@ import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerPickupArrowEvent; import java.util.EnumSet; +import java.util.Objects; public class ArenaListener extends BasicListener { @@ -27,8 +28,10 @@ public class ArenaListener extends BasicListener { assert location != null; if(location.getY() < Config.ArenaMinY){ - if(p.getGameMode() == GameMode.SPECTATOR || MissileWars.getFightState() == FightState.WAITING) + if(p.getGameMode() == GameMode.SPECTATOR) p.teleport(e.getFrom()); + else if(MissileWars.getFightState() == FightState.WAITING) + p.teleport(Objects.requireNonNull(MissileWars.getTeam(p)).getSpawn()); else p.damage(20.0f); }else if(