From 1608f895a88e4ab7977bb42cb283e0126075b4d5 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 16 May 2020 16:59:35 +0200 Subject: [PATCH] Improving size of spectator space Signed-off-by: Lixfel --- .../fightsystem/listener/PlayerMoveListener.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java index 5abe77f..61aa744 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/listener/PlayerMoveListener.java @@ -40,13 +40,18 @@ public class PlayerMoveListener extends BasicListener { boolean inBlueArea = inArenaY && Region.isIn2DRange(to, Config.TeamBlueCornerX, Config.TeamBlueCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic); boolean inRedArea = inArenaY && Region.isIn2DRange(to, Config.TeamRedCornerX, Config.TeamRedCornerZ, Config.SchemsizeX, Config.SchemsizeZ, Config.BorderFromSchematic); - if(inBlueArea || inRedArea) { + if(inBlueArea){ if(fightTeam == null) reset(event, DENY_TEAM); - }else if(fightTeam != null && ( - FightSystem.getFightState() != FightState.ENTERN || player.getGameMode() == GameMode.SPECTATOR)){ + else if(fightTeam == Fight.getRedTeam() && player.getGameMode() == GameMode.SPECTATOR) + reset(event, DENY_ENTERN); + }else if(inRedArea){ + if(fightTeam == null) + reset(event, DENY_TEAM); + else if(fightTeam == Fight.getBlueTeam() && player.getGameMode() == GameMode.SPECTATOR) + reset(event, DENY_ENTERN); + }else if(fightTeam != null && FightSystem.getFightState() != FightState.ENTERN && player.getGameMode() != GameMode.SPECTATOR) reset(event, DENY_ENTERN); - } } @EventHandler