mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-27 01:51:21 +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) {
|
if (mcmmoPlayer != null) {
|
||||||
Player target = mcmmoPlayer.getPlayer();
|
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"));
|
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ public class InspectCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sender instanceof Player && !Permissions.inspectOfflineBypass((Player) sender)) {
|
if (sender instanceof Player && !Permissions.inspectOffline((Player) sender)) {
|
||||||
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -35,20 +35,28 @@ public final class Permissions {
|
|||||||
return hasPermission(player, "mcmmo.bypass.arcanebypass");
|
return hasPermission(player, "mcmmo.bypass.arcanebypass");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #inspectFar(player)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public static boolean inspectDistanceBypass(Player player) {
|
public static boolean inspectDistanceBypass(Player player) {
|
||||||
// DEPRECATED PERMISSION
|
return hasPermission(player, "mcmmo.bypass.inspect.distance");
|
||||||
if (hasPermission(player, "mcmmo.bypass.inspect.distance"))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return hasPermission(player, "mcmmo.commands.inspect.far");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean inspectOfflineBypass(Player player) {
|
public static boolean inspectFar(Player player) {
|
||||||
// DEPRECATED PERMISSION
|
return (hasPermission(player, "mcmmo.commands.inspect.far") || inspectDistanceBypass(player));
|
||||||
if (hasPermission(player, "mcmmo.bypass.inspect.offline"))
|
}
|
||||||
return true;
|
|
||||||
|
|
||||||
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user