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;
}

View File

@ -178,7 +178,7 @@ public class mcMMO extends JavaPlugin {
* </br>
* This function is designed for API usage.
*
* @param player Name of player whose profile to get
* @param playerName Name of player whose profile to get
* @return the PlayerProfile object
*/
public PlayerProfile getPlayerProfileByName(String playerName) {

View File

@ -29,10 +29,21 @@ public class mcPermissions {
return player.hasPermission("mcmmo.admin");
}
/*
* MCMMO.BYPASS.*
*/
public boolean arcaneBypass(Player player) {
return player.hasPermission("mcmmo.bypass.arcanebypass");
}
public boolean inspectDistanceBypass(Player player) {
return player.hasPermission("mcmmo.bypass.inspect.distance");
}
public boolean inspectOfflineBypass(Player player) {
return player.hasPermission("mcmmo.bypass.inspect.offline");
}
/*
* MCMMO.TOOLS.*
*/