Examples of SkillType


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

                if (!validateArguments(sender, args[1])) {
                    return true;
                }

                SkillType skill;
                if (args[1].equalsIgnoreCase("all")) {
                    skill = null;
                }
                else {
                    skill = SkillType.getSkill(args[1]);
View Full Code Here

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

import com.google.common.collect.ImmutableList;

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

        switch (args.length) {
            case 2:
                if (CommandUtils.noConsoleUsage(sender)) {
                    return true;
View Full Code Here

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

public class SelfListener implements Listener {
    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {
        Player player = event.getPlayer();
        SkillType skill = event.getSkill();

        ScoreboardManager.handleLevelUp(player, skill);

        if (!Config.getInstance().getLevelUpEffectsEnabled()) {
            return;
        }

        if ((event.getSkillLevel() % Config.getInstance().getLevelUpEffectsTier()) == 0) {
            skill.celebrateLevelUp(player);
        }
    }
View Full Code Here

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

        ScoreboardManager.cooldownUpdate(event.getPlayer(), event.getSkill());
    }

    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    public void onPlayerXpGain(McMMOPlayerXpGainEvent event) {
        SkillType skillType = event.getSkill();
        int threshold = ExperienceConfig.getInstance().getDiminishedReturnsThreshold(skillType);

        if (threshold <= 0 || !ExperienceConfig.getInstance().getDiminishedReturnsEnabled()) {
            // Diminished returns is turned off
            return;
        }

        final float rawXp = event.getRawXpGained();
        if (rawXp < 0) {
            // Don't calculate for XP subtraction
            return;
        }

        Player player = event.getPlayer();
        McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);

        if (skillType.isChildSkill()) {
            return;
        }

        float modifiedThreshold = (float) (threshold / skillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier());
        float difference = (mcMMOPlayer.getProfile().getRegisteredXpGain(skillType) - modifiedThreshold) / modifiedThreshold;

        if (difference > 0) {
//            System.out.println("Total XP Earned: " + mcMMOPlayer.getProfile().getRegisteredXpGain(skillType) + " / Threshold value: " + threshold);
//            System.out.println(difference * 100 + "% over the threshold!");
View Full Code Here

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

            case 2:
                if (CommandUtils.isInvalidSkill(sender, args[0])) {
                    return true;
                }

                SkillType skill = SkillType.getSkill(args[0]);

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

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

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

    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

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

     *
     * @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

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

     *
     * @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

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

     * @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
TOP
Copyright © 2018 www.massapi.com. 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.