mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Better way to deprecate these.
This commit is contained in:
parent
cd35df17ec
commit
bd2cd07f46
@ -30,7 +30,7 @@ public class InspectCommand implements CommandExecutor {
|
||||
if (mcmmoPlayer != null) {
|
||||
Player target = mcmmoPlayer.getPlayer();
|
||||
|
||||
if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), 5.0) && !Permissions.inspectDistanceBypass((Player) sender)) {
|
||||
if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), 5.0) && !Permissions.inspectFar((Player) sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||
return true;
|
||||
}
|
||||
@ -44,7 +44,7 @@ public class InspectCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sender instanceof Player && !Permissions.inspectOfflineBypass((Player) sender)) {
|
||||
if (sender instanceof Player && !Permissions.inspectOffline((Player) sender)) {
|
||||
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||
return true;
|
||||
}
|
||||
|
@ -35,20 +35,28 @@ public final class Permissions {
|
||||
return hasPermission(player, "mcmmo.bypass.arcanebypass");
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #inspectFar(player)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean inspectDistanceBypass(Player player) {
|
||||
// DEPRECATED PERMISSION
|
||||
if (hasPermission(player, "mcmmo.bypass.inspect.distance"))
|
||||
return true;
|
||||
|
||||
return hasPermission(player, "mcmmo.commands.inspect.far");
|
||||
return hasPermission(player, "mcmmo.bypass.inspect.distance");
|
||||
}
|
||||
|
||||
public static boolean inspectOfflineBypass(Player player) {
|
||||
// DEPRECATED PERMISSION
|
||||
if (hasPermission(player, "mcmmo.bypass.inspect.offline"))
|
||||
return true;
|
||||
public static boolean inspectFar(Player player) {
|
||||
return (hasPermission(player, "mcmmo.commands.inspect.far") || inspectDistanceBypass(player));
|
||||
}
|
||||
|
||||
return hasPermission(player, "mcmmo.commands.inspect.offline");
|
||||
/**
|
||||
* @deprecated Use {@link #inspectOffline(player)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean inspectOfflineBypass(Player player) {
|
||||
return hasPermission(player, "mcmmo.bypass.inspect.offline");
|
||||
}
|
||||
|
||||
public static boolean inspectOffline(Player player) {
|
||||
return (hasPermission(player, "mcmmo.commands.inspect.offline") || inspectOfflineBypass(player));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -340,8 +340,8 @@ permissions:
|
||||
mcmmo.tools.all:
|
||||
description: Implies all mcmmo.tools permissions.
|
||||
children:
|
||||
mcmmo.tools.mcrefresh: true
|
||||
mcmmo.tools.mmoedit: true
|
||||
mcmmo.tools.mcrefresh: true
|
||||
mcmmo.tools.mmoedit: true
|
||||
mcmmo.tools.mcgod: true
|
||||
mcmmo.tools.mcremove: true
|
||||
mcmmo.tools.mcrefresh:
|
||||
|
Loading…
Reference in New Issue
Block a user