Explain why the gamemode setting is problematic #73

We should output what is problematic about it and then give them the
options available to them, since spectator was added more recently.
This commit is contained in:
graywolf336 2015-05-26 11:39:19 -05:00
parent a5b1591dcb
commit 9255141631

View File

@ -199,7 +199,17 @@ public class PrisonerManager {
try { try {
player.setGameMode(GameMode.valueOf(pl.getConfig().getString(Settings.JAILEDGAMEMODE.getPath(), "ADVENTURE").toUpperCase())); player.setGameMode(GameMode.valueOf(pl.getConfig().getString(Settings.JAILEDGAMEMODE.getPath(), "ADVENTURE").toUpperCase()));
}catch(Exception e) { }catch(Exception e) {
pl.getLogger().severe("Your jailedgamemode setting is incorrect, please fix."); StringBuilder gamemodes = new StringBuilder();
for(GameMode m : GameMode.values()) {
if(gamemodes.length() != 0)
gamemodes.append(", ");
gamemodes.append(m.toString().toLowerCase());
}
pl.getLogger().warning("Your jailed gamemode setting is problematic. It is currently '"
+ pl.getConfig().getString(Settings.JAILEDGAMEMODE.getPath())
+ "' and should be one of the following: " + gamemodes.toString());
player.setGameMode(GameMode.ADVENTURE); player.setGameMode(GameMode.ADVENTURE);
} }