use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class EntityAnimaStone method onCollideWithPlayer.
@Override
public void onCollideWithPlayer(EntityPlayer player) {
if (!world.isRemote && !isDead) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer(player);
int lvl = plData.stats().getLevel(Enums.Skills.ANIMA);
plData.stats().addXp(Enums.Skills.ANIMA, PlayerUtil.getXpRequiredForNextLevel(lvl / AnimaUtil.getExpDenominator(lvl)), false, false);
world.playSound(null, posX, posY, posZ, SoundsRegister.HEART_STONE_USE, SoundCategory.PLAYERS, 1.0f, 1.0f);
setDead();
if (rand.nextInt(3) == 0)
ItemUtil.givePlayerItemOrDrop(player, new ItemStack(ItemRegister.FRAGMENTED_ANIMA_STONE, 1));
}
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class EntityBloodlust method onCollideWithPlayer.
@Override
public void onCollideWithPlayer(EntityPlayer player) {
if (!world.isRemote && !isDead) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer(player);
int lvl = plData.stats().getLevelForDisplay(Enums.Skills.BUTCHERY);
plData.stats().addXp(Enums.Skills.BUTCHERY, PlayerUtil.getXpRequiredForNextLevel(lvl) / ButcheryUtil.getExpDenominator(lvl), false, false);
world.playSound(null, posX, posY, posZ, SoundsRegister.BLOODLUST_COLLECT, SoundCategory.NEUTRAL, 1.0f, 1.0f);
setDead();
}
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class EntityHeartStone method onCollideWithPlayer.
@Override
public void onCollideWithPlayer(EntityPlayer player) {
if (!world.isRemote && !isDead) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer(player);
int lvl = plData.stats().getLevelForDisplay(Enums.Skills.INNERVATION);
EntityUtil.healEntity(player, InnervationUtil.getHeartstoneHealAmount(lvl));
plData.stats().addXp(Enums.Skills.INNERVATION, PlayerUtil.getXpRequiredForNextLevel(lvl) / InnervationUtil.getExpDenominator(lvl), false, false);
world.playSound(null, posX, posY, posZ, SoundsRegister.HEART_STONE_USE, SoundCategory.NEUTRAL, 1.0f, 1.0f);
setDead();
}
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class EntityHoron method doMeleeEffect.
@Override
protected void doMeleeEffect(Entity target) {
if (target instanceof EntityPlayer) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer((EntityPlayer) target);
plData.stats().consumeResource(Enums.Resources.ENERGY, 60, true);
plData.stats().consumeResource(Enums.Resources.CREATION, 20, true);
plData.stats().consumeResource(Enums.Resources.SOUL, 20, true);
}
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class AncientCavernTeleporter method findExistingPortal.
@Override
public BlockPos findExistingPortal(World world, Entity entity) {
if (world.provider.getDimension() == ConfigurationUtil.MainConfig.dimensionIds.ancientCavern) {
if (entity.hasCapability(AdventPlayerProvider.ADVENT_PLAYER, null)) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer((EntityPlayer) entity);
PortalCoordinatesContainer portalLoc = new PortalCoordinatesContainer(world.provider.getDimension(), entity.posX, entity.posY, entity.posZ);
plData.setPortalReturnLocation(entity.world.provider.getDimension(), portalLoc);
}
return new BlockPos(0, 18, 0);
}
return super.findExistingPortal(world, entity);
}
Aggregations