diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index d77a2b868..b79839c7f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -207,6 +207,8 @@ public abstract class Game implements Listener public boolean EloRanking = false; public int EloStart = 1000; + public boolean CanAddStats = true; + public ArrayList GemBoosters = new ArrayList(); private final Set> _statTrackers = new HashSet<>(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 14de468dd..77035d669 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -271,6 +271,20 @@ public class GameManager implements Listener event.GetGame().DeregisterKits(); } + @EventHandler + public void StatEnableDisable(GameStateChangeEvent event) + { + if (event.GetState() != GameState.Live) + return; + + int requirement = (int)((double)event.GetGame().Manager.GetPlayerFull() * 0.75d); + + event.GetGame().CanAddStats = (double)event.GetGame().GetPlayers(true).size() >= requirement; + + if (!event.GetGame().CanAddStats) + event.GetGame().Announce(C.Bold + "Stats/Achievements Disabled. Requires " + requirement + " Players."); + } + @EventHandler public void StatRegister(GameStateChangeEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java index 704e355ad..1c7630a6c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/StatTracker.java @@ -21,7 +21,7 @@ public class StatTracker implements Listener public boolean canAddStats() { - return getGame().GetPlayers(false).size() * 4 >= 3 * getGame().Manager.GetPlayerFull(); + return getGame().CanAddStats; } public void addStat(Player player, String stat, int value, boolean limitTo1, boolean global)