Add an option to disallow jailing offline players.
This closes #163 and adds a new configuration option
This commit is contained in:
@@ -99,6 +99,11 @@ public class JailCommand implements Command {
|
||||
|
||||
String uuid = "";
|
||||
if(p == null) {
|
||||
if (!jm.getPlugin().getConfig().getBoolean(Settings.ALLOWJAILINGOFFLINEPLAYERS.getPath())) {
|
||||
sender.sendMessage(Lang.PLAYERHASNEVERPLAYEDBEFORE.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
//TODO: Make this whole jail command non-blocking
|
||||
OfflinePlayer of = jm.getPlugin().getServer().getOfflinePlayer(params.getPlayer());
|
||||
|
||||
|
@@ -101,6 +101,8 @@ public enum Lang {
|
||||
UNJAILED("jailing"),
|
||||
/** The message sent to the person who released a prisoner from jail. */
|
||||
UNJAILSUCCESS("jailing"),
|
||||
/** The message sent when you jailing offline players is not allowed. */
|
||||
UNALLOWEDTOJAILOFFLINE("jailing"),
|
||||
/** The message went when an offline player is unjailed. */
|
||||
WILLBEUNJAILED("jailing"),
|
||||
/** The message sent when trying to jail a player in an unloaded world. */
|
||||
|
@@ -2,6 +2,7 @@ package com.graywolf336.jail.enums;
|
||||
|
||||
public enum Settings {
|
||||
ALLOWJAILINGNEVERPLAYEDBEFOREPLAYERS("jailing.jail.allowJailingNeverPlayedBeforePlayers"),
|
||||
ALLOWJAILINGOFFLINEPLAYERS("jailing.jail.allowJaillingOfflinePlayers"),
|
||||
AUTOMATICCELL("jailing.jail.automaticCell"),
|
||||
AUTOMATICMUTE("jailing.jail.automaticMute"),
|
||||
BROADCASTJAILING("jailing.jail.broadcastJailing"),
|
||||
|
Reference in New Issue
Block a user