MASSIVE Permissions overhaul. Added a handful of new permissions,

renamed a few more. Changed Green Terra to handle blocks based on
perms rather than the config file.

For more details, read the diff.
This commit is contained in:
GJ
2013-02-19 00:56:25 -05:00
parent 2eab93292e
commit 701822c69f
73 changed files with 513 additions and 998 deletions

View File

@ -11,6 +11,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;
public class InspectCommand implements CommandExecutor {
@ -20,11 +21,6 @@ public class InspectCommand implements CommandExecutor {
switch (args.length) {
case 1:
if (!sender.hasPermission("mcmmo.commands.inspect")) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
McMMOPlayer mcMMOPlayer = Users.getPlayer(args[0]);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
@ -36,7 +32,8 @@ public class InspectCommand implements CommandExecutor {
return true;
}
if (sender instanceof Player && !sender.hasPermission("mcmmo.commands.inspect.offline")) {
// TODO: Why do we care if this is a player?
if (sender instanceof Player && !Permissions.inspectOffline(sender)) {
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
return true;
}
@ -67,7 +64,7 @@ public class InspectCommand implements CommandExecutor {
if (sender instanceof Player) {
Player inspector = (Player) sender;
if (!Misc.isNear(inspector.getLocation(), target.getLocation(), 5.0) && !inspector.hasPermission("mcmmo.commands.inspect.far")) {
if (!Misc.isNear(inspector.getLocation(), target.getLocation(), 5.0) && !Permissions.inspectFar(inspector)) {
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
return true;
}