Alex's Changes and prevent /game start working with no map

This commit is contained in:
Sam 2018-08-16 13:56:49 +01:00 committed by Alexander Meech
parent bc916412b2
commit 5c8b550d6f
3 changed files with 20 additions and 4 deletions

View File

@ -27,7 +27,9 @@ public class ChampionsServerSelectionPage extends ServerModeSelectionPage
.setTitle(C.cYellowB + "Champions " + C.cGoldB + "Dominate")
.addLore(
"",
"TODO",
"Select your champion and battle in a 5v5",
"custom non-vanilla PvP game!",
"Capture points & pick up gems to win.",
"",
CLICK_TO_PLAY
)
@ -37,7 +39,10 @@ public class ChampionsServerSelectionPage extends ServerModeSelectionPage
.setTitle(C.cYellowB + "Champions " + C.cGoldB + "CTF")
.addLore(
"",
"TODO",
"Select your champion and battle in an 8v8",
"custom non-vanilla PvP game!",
"Steal the enemys flag and bring it to your base",
"5 times to win.",
"",
CLICK_TO_PLAY
)

View File

@ -24,7 +24,7 @@ public class MapCommand extends CommandBase<ArcadeManager>
if (game == null || game.WorldData == null || game.WorldData.MapName == null)
{
caller.sendMessage(F.main(Plugin.getName(), "Is this the work of an enemy stand? There's no map?"));
caller.sendMessage(F.main(Plugin.getName(), "There is currently no map running."));
return;
}

View File

@ -7,6 +7,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
public class StartCommand extends CommandBase<ArcadeManager>
@ -24,7 +25,17 @@ public class StartCommand extends CommandBase<ArcadeManager>
return;
}
if (Plugin.GetGame() == null || Plugin.GetGame().GetState() == GameState.Loading)
Game game = Plugin.GetGame();
if (game == null)
{
caller.sendMessage(F.main("Game", "There is currently no game running!"));
return;
}
GameState state = game.GetState();
if (state == GameState.PreLoad || state == GameState.Loading)
{
UtilPlayer.message(caller, F.main("Game", "The game is currently loading, it cannot be started!"));
return;