Search in sources :

Example 6 with PlayerDataManager

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));
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) PlayerDataManager(net.tslat.aoa3.utils.player.PlayerDataManager)

Example 7 with PlayerDataManager

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();
    }
}
Also used : PlayerDataManager(net.tslat.aoa3.utils.player.PlayerDataManager)

Example 8 with PlayerDataManager

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();
    }
}
Also used : PlayerDataManager(net.tslat.aoa3.utils.player.PlayerDataManager)

Example 9 with PlayerDataManager

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);
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) PlayerDataManager(net.tslat.aoa3.utils.player.PlayerDataManager)

Example 10 with PlayerDataManager

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);
}
Also used : PortalCoordinatesContainer(net.tslat.aoa3.library.misc.PortalCoordinatesContainer) BlockPos(net.minecraft.util.math.BlockPos) PlayerDataManager(net.tslat.aoa3.utils.player.PlayerDataManager)

Aggregations

PlayerDataManager (net.tslat.aoa3.utils.player.PlayerDataManager)49 EntityPlayer (net.minecraft.entity.player.EntityPlayer)20 ItemStack (net.minecraft.item.ItemStack)18 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)7 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)7 BlockPos (net.minecraft.util.math.BlockPos)6 Entity (net.minecraft.entity.Entity)5 EntityTameable (net.minecraft.entity.passive.EntityTameable)4 Block (net.minecraft.block.Block)3 Item (net.minecraft.item.Item)3 CapabilityBaseMiscStackSerializable (net.tslat.aoa3.capabilities.interfaces.CapabilityBaseMiscStackSerializable)3 Enums (net.tslat.aoa3.library.Enums)3 PortalCoordinatesContainer (net.tslat.aoa3.library.misc.PortalCoordinatesContainer)3 IBlockState (net.minecraft.block.state.IBlockState)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 PotionEffect (net.minecraft.potion.PotionEffect)2 TextComponentString (net.minecraft.util.text.TextComponentString)2 WorldServer (net.minecraft.world.WorldServer)2 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1