Added perm checks to skill commands

This commit is contained in:
GJ 2012-04-04 10:57:13 -04:00
parent 06c3a588bf
commit 1c7709a18b
16 changed files with 57 additions and 6 deletions

View File

@ -9,9 +9,10 @@ Key:
Version 1.3.06-dev Version 1.3.06-dev
+ Added API functions for obtaining offline profiles & profiles via player names + Added API functions for obtaining offline profiles & profiles via player names
+ Changed /addlevel command to work for offline users + Added permissions check to skill functions
+ Changed PlayerProfile constructor to always take a boolean ! Changed /addlevel command to work for offline users
+ Changed getPlayerProfile funtion to work for online & offline users ! Changed PlayerProfile constructor to always take a boolean
! Changed getPlayerProfile funtion to work for online & offline users
Version 1.3.05 Version 1.3.05
+ Added Skill Shot to Archery which increases damage dealt by 10% every 50 skill levels (caps at 200%) + Added Skill Shot to Archery which increases damage dealt by 10% every 50 skill levels (caps at 200%)

View File

@ -53,7 +53,6 @@ public class InspectCommand implements CommandExecutor {
return true; return true;
} }
else { else {
if (sender instanceof Player && !sender.isOp()) { if (sender instanceof Player && !sender.isOp()) {
sender.sendMessage(mcLocale.getString("Inspect.Offline")); sender.sendMessage(mcLocale.getString("Inspect.Offline"));
return true; return true;

View File

@ -14,7 +14,6 @@ public class McstatsCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (CommandHelper.noConsoleUsage(sender)) { if (CommandHelper.noConsoleUsage(sender)) {
return true; return true;
} }

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -21,6 +22,10 @@ public class AcrobaticsCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.acrobatics")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,9 @@ public class ArcheryCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.archery")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -19,6 +20,9 @@ public class AxesCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.axes")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,9 @@ public class ExcavationCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.excavation")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -21,6 +22,10 @@ public class FishingCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.fishing")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,10 @@ public class HerbalismCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.herbalism")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,10 @@ public class MiningCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.mining")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -22,6 +23,9 @@ public class RepairCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.repair")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,9 @@ public class SwordsCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.swords")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
@ -21,6 +22,9 @@ public class TamingCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.taming")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,10 @@ public class UnarmedCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.unarmed")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.mcPermissions;
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;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
@ -20,6 +21,9 @@ public class WoodcuttingCommand implements CommandExecutor {
return true; return true;
} }
if (CommandHelper.noCommandPermissions(sender, "mcmmo.skills.woodcutting")) {
return true;
}
Player player = (Player) sender; Player player = (Player) sender;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);

View File

@ -3,7 +3,6 @@ main: com.gmail.nossr50.mcMMO
version: ${project.version}-b${BUILD_NUMBER} version: ${project.version}-b${BUILD_NUMBER}
softdepend: [Spout] softdepend: [Spout]
authors: authors:
- TheYeti
- nossr50 - nossr50
- NuclearW - NuclearW
- gmcferrin - gmcferrin