Redo the logic of SG's anti deathmatch camping

This commit is contained in:
Sam 2018-03-30 20:30:22 +01:00 committed by Alexander Meech
parent 155fabb9e9
commit 046fc30e0e

View File

@ -11,6 +11,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
@ -131,7 +132,14 @@ public class BorderModule extends Module
return;
}
double maxY = getGame().GetSpectatorLocation().getY() - 6;
Location center = UtilAlg.getAverageLocation(getGame().GetTeamList().get(0).GetSpawns());
if (center == null)
{
return;
}
double maxY = center.getY() + 6;
for (Player player : getGame().GetPlayers(true))
{