mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Added permission node to prevent inspecting hidden players
This commit is contained in:
parent
da25b02e0a
commit
375fa4f75c
@ -28,6 +28,7 @@ Version 1.4.06-dev
|
|||||||
+ Added multiplier to Archery XP based on bow force
|
+ Added multiplier to Archery XP based on bow force
|
||||||
+ Added information about /party itemshare and /party expshare to the party help page
|
+ Added information about /party itemshare and /party expshare to the party help page
|
||||||
+ Added option to use scoreboards for power level display instead of Spout.
|
+ Added option to use scoreboards for power level display instead of Spout.
|
||||||
|
+ Added permission node to prevent inspecting hidden players
|
||||||
= Fixed bug where custom Spout titles were overwritten by mcMMO.
|
= Fixed bug where custom Spout titles were overwritten by mcMMO.
|
||||||
= Fixed bug where Nether Quartz wasn't included in Smelting or item sharing
|
= Fixed bug where Nether Quartz wasn't included in Smelting or item sharing
|
||||||
= Fixed bug where players were able to join the same party multiple times
|
= Fixed bug where players were able to join the same party multiple times
|
||||||
|
@ -73,6 +73,10 @@ public class InspectCommand implements TabExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommandUtils.hidden(sender, target, Permissions.inspectHidden(sender))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (sender instanceof Player && Config.getInstance().getInspectScoreboardEnabled()) {
|
if (sender instanceof Player && Config.getInstance().getInspectScoreboardEnabled()) {
|
||||||
ScoreboardManager.enablePlayerInspectScoreboardOnline((Player) sender, mcMMOPlayer);
|
ScoreboardManager.enablePlayerInspectScoreboardOnline((Player) sender, mcMMOPlayer);
|
||||||
return true;
|
return true;
|
||||||
|
@ -48,6 +48,7 @@ public final class Permissions {
|
|||||||
|
|
||||||
public static boolean inspect(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect")); }
|
public static boolean inspect(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect")); }
|
||||||
public static boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); }
|
public static boolean inspectFar(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.far")); }
|
||||||
|
public static boolean inspectHidden(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.hidden")); }
|
||||||
public static boolean inspectOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.offline")); }
|
public static boolean inspectOffline(Permissible permissible) { return (permissible.hasPermission("mcmmo.commands.inspect.offline")); }
|
||||||
|
|
||||||
public static boolean kraken(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken"); }
|
public static boolean kraken(Permissible permissible) { return permissible.hasPermission("mcmmo.commands.kraken"); }
|
||||||
|
@ -55,6 +55,15 @@ public final class CommandUtils {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean hidden(CommandSender sender, Player target, boolean hasPermission) {
|
||||||
|
if (sender instanceof Player && ((Player)sender).canSee(target) && !hasPermission) {
|
||||||
|
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean noConsoleUsage(CommandSender sender) {
|
public static boolean noConsoleUsage(CommandSender sender) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -612,6 +612,7 @@ permissions:
|
|||||||
mcmmo.bypass.hardcoremode: true
|
mcmmo.bypass.hardcoremode: true
|
||||||
mcmmo.bypass.kraken: true
|
mcmmo.bypass.kraken: true
|
||||||
mcmmo.commands.inspect.far: true
|
mcmmo.commands.inspect.far: true
|
||||||
|
mcmmo.commands.inspect.hidden: true
|
||||||
mcmmo.commands.inspect.offline: true
|
mcmmo.commands.inspect.offline: true
|
||||||
mcmmo.bypass.arcanebypass:
|
mcmmo.bypass.arcanebypass:
|
||||||
default: false
|
default: false
|
||||||
@ -627,6 +628,11 @@ permissions:
|
|||||||
description: Allows user to bypass Inspect's distance requirements
|
description: Allows user to bypass Inspect's distance requirements
|
||||||
children:
|
children:
|
||||||
mcmmo.commands.inspect.far: true
|
mcmmo.commands.inspect.far: true
|
||||||
|
mcmmo.bypass.inspect.hidden:
|
||||||
|
default: false
|
||||||
|
description: Allows user to bypass Inspect's hidden player requirements
|
||||||
|
children:
|
||||||
|
mcmmo.commands.inspect.hidden: true
|
||||||
mcmmo.bypass.inspect.offline:
|
mcmmo.bypass.inspect.offline:
|
||||||
default: false
|
default: false
|
||||||
description: Allows user to bypass Inspect's offline player requirements
|
description: Allows user to bypass Inspect's offline player requirements
|
||||||
@ -701,6 +707,7 @@ permissions:
|
|||||||
mcmmo.commands.defaults: true
|
mcmmo.commands.defaults: true
|
||||||
mcmmo.commands.hardcore.all: true
|
mcmmo.commands.hardcore.all: true
|
||||||
mcmmo.commands.inspect.far: true
|
mcmmo.commands.inspect.far: true
|
||||||
|
mcmmo.commands.inspect.hidden: true
|
||||||
mcmmo.commands.inspect.offline: true
|
mcmmo.commands.inspect.offline: true
|
||||||
mcmmo.commands.kraken: true
|
mcmmo.commands.kraken: true
|
||||||
mcmmo.commands.kraken.others: true
|
mcmmo.commands.kraken.others: true
|
||||||
@ -772,11 +779,14 @@ permissions:
|
|||||||
children:
|
children:
|
||||||
mcmmo.commands.inspect: true
|
mcmmo.commands.inspect: true
|
||||||
mcmmo.commands.inspect.far: true
|
mcmmo.commands.inspect.far: true
|
||||||
|
mcmmo.commands.inspect.hidden: true
|
||||||
mcmmo.commands.inspect.offline: true
|
mcmmo.commands.inspect.offline: true
|
||||||
mcmmo.commands.inspect:
|
mcmmo.commands.inspect:
|
||||||
description: Allows access to the inspect command
|
description: Allows access to the inspect command
|
||||||
mcmmo.commands.inspect.far:
|
mcmmo.commands.inspect.far:
|
||||||
description: Allows access to the inspect command for far players
|
description: Allows access to the inspect command for far players
|
||||||
|
mcmmo.commands.inspect.hidden:
|
||||||
|
description: Allows access to the inspect command for hidden players
|
||||||
mcmmo.commands.inspect.offline:
|
mcmmo.commands.inspect.offline:
|
||||||
description: Allows access to the inspect command for offline players
|
description: Allows access to the inspect command for offline players
|
||||||
mcmmo.commands.kraken:
|
mcmmo.commands.kraken:
|
||||||
|
Loading…
Reference in New Issue
Block a user