use of com.gmail.nossr50.datatypes.player.McMMOPlayer 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);
}
use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project TriggerReactor by wysohn.
the class McMmoSupport method setLevel.
/**
* set level of target player's 'skillType' to 'level'
*
* @param player
* @param skillType
* @param level
*/
public void setLevel(Player player, String skillType, int level) {
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.modifySkill(type, level);
}
use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project Nexus by ProjectEdenGG.
the class McMMOResetProvider method prestigeAll.
public void prestigeAll(Player player) {
Koda.say(Nickname.of(player) + " has reset all of their mcMMO skills!");
PlayerUtils.runCommandAsConsole("ce give " + player.getName() + " diamond_chestplate enlighted:1 beserk:1 durability:3 mending:1");
McMMOPlayer mcmmoPlayer = UserManager.getPlayer(player);
boolean allMax = true;
for (PrimarySkillType skillType : PrimarySkillType.values()) {
if (skillType.isChildSkill())
continue;
if (mcmmoPlayer.getSkillLevel(skillType) < TIER_TWO)
allMax = false;
prestige(player, ResetSkillType.valueOf(skillType.name()), false);
}
int deposit = DEPOSIT_ALL;
if (allMax)
deposit += MAX_DEPOSIT_ALL_MULTIPLIER;
new BankerService().deposit(player, deposit, ShopGroup.SURVIVAL, TransactionCause.MCMMO_RESET);
McMMOPrestige mcMMOPrestige = service.getPrestige(player.getUniqueId().toString());
mcMMOPrestige.prestige("all");
service.save(mcMMOPrestige);
}
use of com.gmail.nossr50.datatypes.player.McMMOPlayer in project Depenizen by DenizenScript.
the class PartyTag method forPlayer.
public static PartyTag forPlayer(PlayerTag player) {
McMMOPlayer pl = UserManager.getOfflinePlayer(player.getOfflinePlayer());
if (pl == null) {
return null;
}
Party party = pl.getParty();
if (party == null) {
return null;
}
return new PartyTag(party);
}
Aggregations