Search in sources :

Example 6 with SkillType

use of com.gmail.nossr50.datatypes.skills.SkillType in project TriggerReactor by wysohn.

the class McMmoSupport method xp.

/**
 * get current xp of player's 'skillType'
 *
 * @param player
 * @param skillType
 * @return
 */
public double xp(Player player, String skillType) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    return mmoPlayer.getSkillXpLevelRaw(type);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Example 7 with SkillType

use of com.gmail.nossr50.datatypes.skills.SkillType in project TriggerReactor by wysohn.

the class McMmoSupport method addXp.

/**
 * add 'xp' to the target player's 'skillType'
 *
 * @param player
 * @param skillType
 * @param xp
 */
public void addXp(Player player, String skillType, int xp) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    mmoPlayer.addXp(type, xp);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Example 8 with SkillType

use of com.gmail.nossr50.datatypes.skills.SkillType in project TriggerReactor by wysohn.

the class McMmoSupport method level.

/**
 * get current level of player's 'skillType'
 *
 * @param player
 * @param skillType
 * @return
 */
public int level(Player player, String skillType) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    return mmoPlayer.getSkillLevel(type);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Example 9 with SkillType

use of com.gmail.nossr50.datatypes.skills.SkillType in project TriggerReactor by wysohn.

the class McMmoSupport method xpRemain.

/**
 * get xp left until level up of 'skillType' for player.
 *
 * @param player
 * @param skillType
 * @return
 */
public double xpRemain(Player player, String skillType) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    return mmoPlayer.getXpToLevel(type);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Example 10 with SkillType

use of com.gmail.nossr50.datatypes.skills.SkillType in project TriggerReactor by wysohn.

the class McMmoSupport method addLevel.

/**
 * add 'levels' to target player's 'skillType'
 *
 * @param player
 * @param skillType
 * @param levels
 */
public void addLevel(Player player, String skillType, int levels) {
    McMMOPlayer mmoPlayer = (McMMOPlayer) player(player.getName());
    if (mmoPlayer == null)
        throw new RuntimeException("Could not find MCMMO info for player " + player.getName());
    SkillType type = SkillType.valueOf(skillType);
    mmoPlayer.addLevels(type, levels);
}
Also used : McMMOPlayer(com.gmail.nossr50.datatypes.player.McMMOPlayer) SkillType(com.gmail.nossr50.datatypes.skills.SkillType)

Aggregations

McMMOPlayer (com.gmail.nossr50.datatypes.player.McMMOPlayer)12 SkillType (com.gmail.nossr50.datatypes.skills.SkillType)7 Player (org.bukkit.entity.Player)5 Claim (com.griefdefender.api.claim.Claim)4 PlayerData (com.griefdefender.api.data.PlayerData)4 Context (com.griefdefender.api.permission.Context)4 Location (org.bukkit.Location)4 World (org.bukkit.World)4 PrimarySkillType (com.gmail.nossr50.datatypes.skills.PrimarySkillType)3 Tristate (com.griefdefender.api.Tristate)3 HashSet (java.util.HashSet)3 EventHandler (org.bukkit.event.EventHandler)3 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)1 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)1 McMMOPlayerAbilityData (com.griefdefender.hooks.provider.mcmmo.McMMOPlayerAbilityData)1 BankerService (gg.projecteden.nexus.models.banker.BankerService)1 McMMOPrestige (gg.projecteden.nexus.models.mcmmo.McMMOPrestige)1 OfflinePlayer (org.bukkit.OfflinePlayer)1 McRPGPlayer (us.eunoians.mcrpg.players.McRPGPlayer)1 Parser (us.eunoians.mcrpg.util.Parser)1