From b4a740979dae4cde84c255ff1e07d852b4c58e9c Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Wed, 25 Dec 2013 23:28:01 -0600 Subject: [PATCH] Try to parse the gamemode from the config, default to adventure. --- src/main/java/com/graywolf336/jail/PrisonerManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/graywolf336/jail/PrisonerManager.java b/src/main/java/com/graywolf336/jail/PrisonerManager.java index d1d0520..3c77d9e 100644 --- a/src/main/java/com/graywolf336/jail/PrisonerManager.java +++ b/src/main/java/com/graywolf336/jail/PrisonerManager.java @@ -126,7 +126,12 @@ public class PrisonerManager { //Set their gamemode to the one in the config, if we get a null value //from the parsing then we set theirs to adventure - player.setGameMode(GameMode.valueOf(pl.getConfig().getString(Settings.JAILEDGAMEMODE.getPath(), "ADVENTURE"))); + try { + player.setGameMode(GameMode.valueOf(pl.getConfig().getString(Settings.JAILEDGAMEMODE.getPath(), "ADVENTURE").toUpperCase())); + }catch(Exception e) { + pl.getLogger().severe("Your jailedgamemode setting is incorrect, please fix."); + player.setGameMode(GameMode.ADVENTURE); + } //only eject them if they're inside a vehicle and also eject anyone else on top of them if(player.isInsideVehicle()) {