mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-26 16:04:27 +02:00
Allow certain commands while in jail, but only if the user normally has access to that command.
This commit is contained in:
@@ -368,6 +368,19 @@ public class Essentials extends JavaPlugin implements IEssentials
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (user != null && user.isJailed() && !user.isAuthorized(cmd, "essentials.jail.allow."))
|
||||||
|
{
|
||||||
|
if (user.getJailTimeout() > 0)
|
||||||
|
{
|
||||||
|
user.sendMessage(_("playerJailedFor", user.getName(), Util.formatDateDiff(user.getJailTimeout())));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
user.sendMessage(_("jailMessage"));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Run the command
|
// Run the command
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -471,7 +484,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public User getOfflineUser(final String name)
|
public User getOfflineUser(final String name)
|
||||||
{
|
{
|
||||||
|
@@ -80,11 +80,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isJailed())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return ess.getPermissionsHandler().hasPermission(base, node);
|
return ess.getPermissionsHandler().hasPermission(base, node);
|
||||||
|
@@ -45,10 +45,10 @@ public class Commandseen extends EssentialsCommand
|
|||||||
: _("true")
|
: _("true")
|
||||||
: _("false"))));
|
: _("false"))));
|
||||||
sender.sendMessage(_("whoisMuted", (user.isMuted()
|
sender.sendMessage(_("whoisMuted", (user.isMuted()
|
||||||
? user.getMuteTimeout() > 0
|
? user.getMuteTimeout() > 0
|
||||||
? Util.formatDateDiff(user.getMuteTimeout())
|
? Util.formatDateDiff(user.getMuteTimeout())
|
||||||
: _("true")
|
: _("true")
|
||||||
: _("false"))));
|
: _("false"))));
|
||||||
if (extra)
|
if (extra)
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString()));
|
sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString()));
|
||||||
@@ -71,7 +71,8 @@ public class Commandseen extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress()));
|
sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress()));
|
||||||
final Location loc = player.getLastLocation();
|
final Location loc = player.getLastLocation();
|
||||||
if (loc != null) {
|
if (loc != null)
|
||||||
|
{
|
||||||
sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user