mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 00:30:07 +01:00
That was an incredibly stupid way to get those permissions.
This commit is contained in:
parent
284002bf8b
commit
bf4d70e8be
@ -50,7 +50,7 @@ public class McMMOPlayer {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.getPermissions(player)) {
|
if (player.hasPermission("mcmmo.skills." + type.toString().toLowerCase())) {
|
||||||
powerLevel += profile.getSkillLevel(type);
|
powerLevel += profile.getSkillLevel(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
package com.gmail.nossr50.skills.utilities;
|
package com.gmail.nossr50.skills.utilities;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Permissions;
|
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
|
|
||||||
public enum SkillType {
|
public enum SkillType {
|
||||||
@ -67,55 +64,6 @@ public enum SkillType {
|
|||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the base permissions associated with this skill.
|
|
||||||
*
|
|
||||||
* @param player The player to check the permissions for
|
|
||||||
* @return true if the player has permissions, false otherwise
|
|
||||||
*/
|
|
||||||
public boolean getPermissions(Player player) {
|
|
||||||
switch (this) {
|
|
||||||
case ACROBATICS:
|
|
||||||
return Permissions.acrobatics(player);
|
|
||||||
|
|
||||||
case ARCHERY:
|
|
||||||
return Permissions.archery(player);
|
|
||||||
|
|
||||||
case AXES:
|
|
||||||
return Permissions.axes(player);
|
|
||||||
|
|
||||||
case EXCAVATION:
|
|
||||||
return Permissions.excavation(player);
|
|
||||||
|
|
||||||
case FISHING:
|
|
||||||
return Permissions.fishing(player);
|
|
||||||
|
|
||||||
case HERBALISM:
|
|
||||||
return Permissions.herbalism(player);
|
|
||||||
|
|
||||||
case MINING:
|
|
||||||
return Permissions.mining(player);
|
|
||||||
|
|
||||||
case REPAIR:
|
|
||||||
return Permissions.repair(player);
|
|
||||||
|
|
||||||
case SWORDS:
|
|
||||||
return Permissions.swords(player);
|
|
||||||
|
|
||||||
case TAMING:
|
|
||||||
return Permissions.taming(player);
|
|
||||||
|
|
||||||
case UNARMED:
|
|
||||||
return Permissions.unarmed(player);
|
|
||||||
|
|
||||||
case WOODCUTTING:
|
|
||||||
return Permissions.woodcutting(player);
|
|
||||||
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getXpModifier() {
|
public double getXpModifier() {
|
||||||
return xpModifier;
|
return xpModifier;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user