Package com.gmail.nossr50.datatypes.skills

Examples of com.gmail.nossr50.datatypes.skills.SkillType


import com.google.common.collect.ImmutableList;

public class MctopCommand implements TabExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        SkillType skill = null;

        switch (args.length) {
            case 0:
                display(1, skill, sender, command);
                return true;
View Full Code Here


    private SkillType extractSkill(CommandSender sender, String skillName) {
        if (CommandUtils.isInvalidSkill(sender, skillName)) {
            return null;
        }

        SkillType skill = SkillType.getSkill(skillName);

        if (CommandUtils.isChildSkill(sender, skill)) {
            return null;
        }
View Full Code Here

     *
     * @param skillType the skill to check
     * @return true if this is a valid, non-child mcMMO skill
     */
    public static boolean isNonChildSkill(String skillType) {
        SkillType skill = SkillType.getSkill(skillType);

        return skill != null && !skill.isChildSkill();
    }
View Full Code Here

     *
     * @throws InvalidSkillException if the given skill is not valid
     * @throws InvalidXPGainReasonException if the given xpGainReason is not valid
     */
    public static void addModifiedXP(Player player, String skillType, int XP, String xpGainReason, boolean isUnshared) {
        SkillType skill = getSkillType(skillType);

        if (isUnshared) {
            getPlayer(player).beginUnsharedXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
            return;
        }

        getPlayer(player).applyXpGain(skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()), getXPGainReason(xpGainReason));
    }
View Full Code Here

     * @throws InvalidSkillException if the given skill is not valid
     * @throws InvalidPlayerException if the given player does not exist in the database
     */
    @Deprecated
    public static void addModifiedXPOffline(String playerName, String skillType, int XP) {
        SkillType skill = getSkillType(skillType);

        addOfflineXP(playerName, skill, (int) (XP / skill.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()));
    }
View Full Code Here

     *
     * @throws InvalidSkillException if the given skill is not valid
     * @throws UnsupportedOperationException if the given skill is a child skill
     */
    public static int getXPRemaining(Player player, String skillType) {
        SkillType skill = getNonChildSkillType(skillType);

        PlayerProfile profile = getPlayer(player).getProfile();

        return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
    }
View Full Code Here

     * @throws InvalidPlayerException if the given player does not exist in the database
     * @throws UnsupportedOperationException if the given skill is a child skill
     */
    @Deprecated
    public static int getOfflineXPRemaining(String playerName, String skillType) {
        SkillType skill = getNonChildSkillType(skillType);
        PlayerProfile profile = getOfflineProfile(playerName);

        return profile.getXpToLevel(skill) - profile.getSkillXpLevel(skill);
    }
View Full Code Here

     * @throws InvalidSkillException if the given skill is not valid
     * @throws InvalidPlayerException if the given player does not exist in the database
     * @throws UnsupportedOperationException if the given skill is a child skill
     */
    public static float getOfflineXPRemaining(UUID uuid, String skillType) {
        SkillType skill = getNonChildSkillType(skillType);
        PlayerProfile profile = getOfflineProfile(uuid);

        return profile.getXpToLevel(skill) - profile.getSkillXpLevelRaw(skill);
    }
View Full Code Here

     * @throws InvalidPlayerException if the given player does not exist in the database
     */
    @Deprecated
    public static void addLevelOffline(String playerName, String skillType, int levels) {
        PlayerProfile profile = getOfflineProfile(playerName);
        SkillType skill = getSkillType(skillType);

        if (skill.isChildSkill()) {
            Set<SkillType> parentSkills = FamilyTree.getParents(skill);

            for (SkillType parentSkill : parentSkills) {
                profile.addLevels(parentSkill, (levels / parentSkills.size()));
            }
View Full Code Here

     * @throws InvalidSkillException if the given skill is not valid
     * @throws InvalidPlayerException if the given player does not exist in the database
     */
    public static void addLevelOffline(UUID uuid, String skillType, int levels) {
        PlayerProfile profile = getOfflineProfile(uuid);
        SkillType skill = getSkillType(skillType);

        if (skill.isChildSkill()) {
            Set<SkillType> parentSkills = FamilyTree.getParents(skill);

            for (SkillType parentSkill : parentSkills) {
                profile.addLevels(parentSkill, (levels / parentSkills.size()));
            }
View Full Code Here

TOP

Related Classes of com.gmail.nossr50.datatypes.skills.SkillType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.