mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Don't cycle when on child skill
This commit is contained in:
parent
a01882aea5
commit
135bfc2627
@ -40,6 +40,7 @@ public class McMMOPlayer {
|
||||
int powerLevel = 0;
|
||||
|
||||
for (SkillType type : SkillType.values()) {
|
||||
if (type.isChildSkill()) continue;
|
||||
if (type.getPermissions(player)) {
|
||||
powerLevel += profile.getSkillLevel(type);
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ public class McRankAsync implements Runnable {
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
|
||||
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", new Object[] {playerName}));
|
||||
for (SkillType skillType : SkillType.values()) {
|
||||
if (skillType.isChildSkill()) continue;
|
||||
if (skillType.equals(SkillType.ALL))
|
||||
continue; // We want the overall ranking to be at the bottom
|
||||
|
||||
|
@ -476,6 +476,7 @@ public class Database {
|
||||
if (checkConnected()) {
|
||||
try {
|
||||
for (SkillType skillType: SkillType.values()) {
|
||||
if (skillType.isChildSkill()) continue;
|
||||
String sql;
|
||||
if(skillType != SkillType.ALL) {
|
||||
sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillType.name().toLowerCase() + " > 0 AND " + skillType.name().toLowerCase() + " > (SELECT " + skillType.name().toLowerCase() + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = '" + playerName + "')";
|
||||
|
Loading…
Reference in New Issue
Block a user