Package com.gmail.nossr50.runnables.commands

Examples of com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask


                        writer.append(":");
                        writer.append(profile.getSkillLevel(SkillType.FISHING)).append(":");
                        writer.append(profile.getSkillXpLevel(SkillType.FISHING)).append(":");
                        writer.append((int) profile.getAbilityDATS(AbilityType.BLAST_MINING)).append(":");
                        writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":");
                        MobHealthbarType mobHealthbarType = profile.getMobHealthbarType();
                        writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":");
                        writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
                        writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
                        writer.append(uuid.toString()).append(":");
                        writer.append("\r\n");
                    }
View Full Code Here


    private PlayerProfile loadFromLine(String[] character) {
        Map<SkillType, Integer>   skills     = getSkillMapFromLine(character);      // Skill levels
        Map<SkillType, Float>     skillsXp   = new EnumMap<SkillType, Float>(SkillType.class);     // Skill & XP
        Map<AbilityType, Integer> skillsDATS = new EnumMap<AbilityType, Integer>(AbilityType.class); // Ability & Cooldown
        MobHealthbarType mobHealthbarType;

        // TODO on updates, put new values in a try{} ?

        skillsXp.put(SkillType.TAMING, (float) Integer.valueOf(character[25]));
        skillsXp.put(SkillType.MINING, (float) Integer.valueOf(character[4]));
View Full Code Here

                for (int i = 1; i <= resultSet.getMetaData().getColumnCount(); i++) {
                    column.add(resultSet.getString(i));
                }

                stats.add(new PlayerStat(column.get(1), Integer.valueOf(column.get(0))));
            }
        }
        catch (SQLException ex) {
            printErrors(ex);
        }
View Full Code Here

        return null;
    }

    private int putStat(List<PlayerStat> statList, String playerName, int statValue) {
        statList.add(new PlayerStat(playerName, statValue));
        return statValue;
    }
View Full Code Here

     * @param skillType Type of skill to check
     * @return the total amount of Xp until next level
     */
    public int getXpToLevel(SkillType skillType) {
        int level = (ExperienceConfig.getInstance().getCumulativeCurveEnabled()) ? UserManager.getPlayer(playerName).getPowerLevel() : skills.get(skillType);
        FormulaType formulaType = ExperienceConfig.getInstance().getFormulaType();

        return mcMMO.getFormulaManager().getCachedXpToLevel(level, formulaType);
    }
View Full Code Here

public class ConvertExperienceCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        switch (args.length) {
            case 2:
                FormulaType previousType = mcMMO.getFormulaManager().getPreviousFormulaType();
                FormulaType newType = FormulaType.getFormulaType(args[1].toUpperCase());

                if (newType == FormulaType.UNKNOWN) {
                    sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Invalid"));
                    return true;
                }

                if (previousType == newType) {
                    sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Same", newType.toString()));
                    return true;
                }

                sender.sendMessage(LocaleLoader.getString("Commands.mcconvert.Experience.Start", previousType.toString(), newType.toString()));

                UserManager.saveAll();
                UserManager.clearAll();

                new FormulaConversionTask(sender, newType).runTaskLater(mcMMO.p, 1);
View Full Code Here

     *
     * @param skillType Skill being used
     * @param xp Experience amount to add
     */
    public void registerXpGain(SkillType skillType, float xp) {
        gainedSkillsXp.add(new SkillXpGain(skillType, xp));
        rollingSkillsXp.put(skillType, getRegisteredXpGain(skillType) + xp);
    }
View Full Code Here

    /**
     * Remove experience gains older than a given time
     * This is used for diminished XP returns
     */
    public void purgeExpiredXpGains() {
        SkillXpGain gain;
        while ((gain = gainedSkillsXp.poll()) != null) {
            rollingSkillsXp.put(gain.getSkill(), getRegisteredXpGain(gain.getSkill()) - gain.getXp());
        }
    }
View Full Code Here

        }

        xp = (float) (xp / skillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier());

        if (Config.getInstance().getToolModsEnabled()) {
            CustomTool tool = mcMMO.getModManager().getTool(player.getItemInHand());

            if (tool != null) {
                xp *= tool.getXpMultiplier();
            }
        }

        return PerksUtils.handleXpPerks(player, xp, skillType);
    }
View Full Code Here

     * @param mcMMOPlayer Player who picked up the item
     * @return True if the item has been shared
     */
    public static boolean handleItemShare(Item drop, McMMOPlayer mcMMOPlayer) {
        ItemStack itemStack = drop.getItemStack();
        ItemShareType dropType = ItemShareType.getShareType(itemStack);

        if (dropType == null) {
            return false;
        }

View Full Code Here

TOP

Related Classes of com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask

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.