mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-05-28 18:17:33 +00:00
We can't test for essentials.jail.exempt, if the player is offline, so added a new permission essentials.togglejail.offline
This commit is contained in:
parent
a65390ed98
commit
c8ba06f0ee
1 changed files with 16 additions and 3 deletions
|
@ -5,6 +5,7 @@ import org.bukkit.Server;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.Util;
|
import com.earth2me.essentials.Util;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
public class Commandtogglejail extends EssentialsCommand
|
public class Commandtogglejail extends EssentialsCommand
|
||||||
|
@ -25,12 +26,24 @@ public class Commandtogglejail extends EssentialsCommand
|
||||||
User p = getPlayer(server, args, 0, true);
|
User p = getPlayer(server, args, 0, true);
|
||||||
|
|
||||||
if (args.length >= 2 && !p.isJailed())
|
if (args.length >= 2 && !p.isJailed())
|
||||||
|
{
|
||||||
|
if (p.getBase() instanceof OfflinePlayer)
|
||||||
|
{
|
||||||
|
if (sender instanceof Player
|
||||||
|
&& !ess.getUser(sender).isAuthorized("essentials.togglejail.offline"))
|
||||||
|
{
|
||||||
|
sender.sendMessage(Util.i18n("mayNotJail"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (p.isAuthorized("essentials.jail.exempt"))
|
if (p.isAuthorized("essentials.jail.exempt"))
|
||||||
{
|
{
|
||||||
sender.sendMessage(Util.i18n("mayNotJail"));
|
sender.sendMessage(Util.i18n("mayNotJail"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
charge(sender);
|
charge(sender);
|
||||||
p.setJailed(true);
|
p.setJailed(true);
|
||||||
p.sendMessage(Util.i18n("userJailed"));
|
p.sendMessage(Util.i18n("userJailed"));
|
||||||
|
|
Loading…
Reference in a new issue