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 inspect The player to retrieve stats for
* @param display The sender to display stats to * @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) { public static void printGatheringSkills(Player inspect, CommandSender display) {
if (Skills.hasGatheringSkills(inspect)) { if (Skills.hasGatheringSkills(inspect)) {
@ -85,7 +84,6 @@ public class CommandHelper {
* *
* @param inspect The player to retrieve stats for * @param inspect The player to retrieve stats for
* @param display The sender to display stats to * @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) { public static void printCombatSkills(Player inspect, CommandSender display) {
if (Skills.hasCombatSkills(inspect)) { if (Skills.hasCombatSkills(inspect)) {
@ -124,7 +122,6 @@ public class CommandHelper {
* *
* @param inspect The player to retrieve stats for * @param inspect The player to retrieve stats for
* @param display The sender to display stats to * @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) { public static void printMiscSkills(Player inspect, CommandSender display) {
if (Skills.hasMiscSkills(inspect)) { if (Skills.hasMiscSkills(inspect)) {

View File

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

View File

@ -178,7 +178,7 @@ public class mcMMO extends JavaPlugin {
* </br> * </br>
* This function is designed for API usage. * 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 * @return the PlayerProfile object
*/ */
public PlayerProfile getPlayerProfileByName(String playerName) { public PlayerProfile getPlayerProfileByName(String playerName) {

View File

@ -29,10 +29,21 @@ public class mcPermissions {
return player.hasPermission("mcmmo.admin"); return player.hasPermission("mcmmo.admin");
} }
/*
* MCMMO.BYPASS.*
*/
public boolean arcaneBypass(Player player) { public boolean arcaneBypass(Player player) {
return player.hasPermission("mcmmo.bypass.arcanebypass"); 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.* * MCMMO.TOOLS.*
*/ */

View File

@ -259,11 +259,11 @@ Experience:
Multiplier: Multiplier:
Animals: 1.0 Animals: 1.0
Creeper: 4.0 Creeper: 4.0
Skeleton: 2.0 Skeleton: 3.0
Spider: 3.0 Spider: 2.0
Zombie: 2.0 Zombie: 2.0
Pig_Zombie: 3.0 Pig_Zombie: 3.0
Enderman: 2.0 Enderman: 4.0
Cave_Spider: 3.0 Cave_Spider: 3.0
Silverfish: 3.0 Silverfish: 3.0
Blaze: 3.0 Blaze: 3.0
@ -399,4 +399,4 @@ Spout:
Mining: Mining:
BLUE: 0.75 BLUE: 0.75
GREEN: 0.3 GREEN: 0.3
RED: 0.3 RED: 0.3

View File

@ -139,8 +139,18 @@ permissions:
mcmmo.tools.*: true mcmmo.tools.*: true
mcmmo.admin: mcmmo.admin:
description: Allows access to mmoupdate and other sensitive commands description: Allows access to mmoupdate and other sensitive commands
mcmmo.bypass.*:
description: Implies all bypass permissions.
children:
mcmmo.bypass.arcanebypass: true
mcmmo.bypass.inspect.distance: true
mcmmo.bypass.inspect.offline: true
mcmmo.bypass.arcanebypass: mcmmo.bypass.arcanebypass:
description: Allows user to bypass Arcane Repair so he will never lose enchantments description: Allows user to bypass Arcane Repair so he will never lose enchantments
mcmmo.bypass.inspect.distance:
description: Allows user to bypass Inspect's distance requirements
mcmmo.bypass.inspect.offline:
description: Allows user to bypass Inspect's offline player requirements
mcmmo.tools.*: mcmmo.tools.*:
description: Implies all mcmmo.tools permissions. description: Implies all mcmmo.tools permissions.
children: children: