Fix /game and hub clock

This commit is contained in:
Sam 2018-07-23 18:31:29 +01:00 committed by Alexander Meech
parent 34eeb208e2
commit 1cd7e45c0c
2 changed files with 2 additions and 11 deletions

View File

@ -1796,7 +1796,7 @@ public abstract class Game extends ListenerComponent implements Lifetimed
Manager.GetGameCreationManager().setNextGameType(gameType); Manager.GetGameCreationManager().setNextGameType(gameType);
// End Current // End Current
if (InProgress()) if (inLobby())
{ {
SetState(GameState.Dead); SetState(GameState.Dead);

View File

@ -21,9 +21,7 @@ import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerStateChangeEvent; import nautilus.game.arcade.events.PlayerStateChangeEvent;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.managers.voting.event.VoteStartEvent;
public class HubClockManager implements Listener public class HubClockManager implements Listener
{ {
@ -40,7 +38,6 @@ public class HubClockManager implements Listener
{ {
_manager = manager; _manager = manager;
UtilServer.getPlayersCollection().forEach(this::giveClock);
manager.registerEvents(this); manager.registerEvents(this);
} }
@ -76,12 +73,6 @@ public class HubClockManager implements Listener
giveClockToAll(); giveClockToAll();
} }
@EventHandler
public void giveOnVote(VoteStartEvent event)
{
giveClockToAll();
}
@EventHandler @EventHandler
public void giveOnDeath(PlayerStateChangeEvent event) public void giveOnDeath(PlayerStateChangeEvent event)
{ {
@ -141,6 +132,6 @@ public class HubClockManager implements Listener
private boolean canGiveClock() private boolean canGiveClock()
{ {
return _manager.GetGame() == null || _manager.GetGame().inLobby() || _manager.GetGame().GiveClock; return _manager.GetGame() == null || _manager.GetGame().inLobby() && _manager.GetGame().GiveClock;
} }
} }