Added bypass nodes for offline inspecting & long-distance inspecting.

Also fixed some JavaDoc typos.
This commit is contained in:
GJ
2012-04-25 22:07:01 -04:00
parent de510129bc
commit a4ff2c7701
6 changed files with 29 additions and 10 deletions

View File

@ -46,7 +46,6 @@ public class CommandHelper {
*
* @param inspect The player to retrieve stats for
* @param display The sender to display stats to
* @param online true if the player to retrieve stats for is online, false otherwise
*/
public static void printGatheringSkills(Player inspect, CommandSender display) {
if (Skills.hasGatheringSkills(inspect)) {
@ -85,7 +84,6 @@ public class CommandHelper {
*
* @param inspect The player to retrieve stats for
* @param display The sender to display stats to
* @param online true if the player to retrieve stats for is online, false otherwise
*/
public static void printCombatSkills(Player inspect, CommandSender display) {
if (Skills.hasCombatSkills(inspect)) {
@ -124,7 +122,6 @@ public class CommandHelper {
*
* @param inspect The player to retrieve stats for
* @param display The sender to display stats to
* @param online true if the player to retrieve stats for is online, false otherwise
*/
public static void printMiscSkills(Player inspect, CommandSender display) {
if (Skills.hasMiscSkills(inspect)) {

View File

@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
@ -39,7 +40,7 @@ public class InspectCommand implements CommandExecutor {
if (target.isOnline()) {
Player player = (Player) target;
if (sender instanceof Player && !sender.isOp() && !m.isNear(((Player) sender).getLocation(), player.getLocation(), 5.0)) {
if (sender instanceof Player && !sender.isOp() && !m.isNear(((Player) sender).getLocation(), player.getLocation(), 5.0) && !mcPermissions.getInstance().inspectDistanceBypass((Player) sender)) {
sender.sendMessage(mcLocale.getString("Inspect.TooFar"));
return true;
}
@ -53,7 +54,7 @@ public class InspectCommand implements CommandExecutor {
return true;
}
else {
if (sender instanceof Player && !sender.isOp()) {
if (sender instanceof Player && !sender.isOp() && !mcPermissions.getInstance().inspectOfflineBypass((Player) sender)) {
sender.sendMessage(mcLocale.getString("Inspect.Offline"));
return true;
}