use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class ImmortallisProgressor method onBlockActivated.
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
PlayerDataManager plData;
switch(place) {
case 1:
if (ItemUtil.findInventoryItem(player, new ItemStack(ItemRegister.PROGRESS_COIN0), true, 1)) {
if (!player.addItemStackToInventory(new ItemStack(ItemRegister.RETURN_CRYSTAL))) {
plData = PlayerUtil.getAdventPlayer(player);
plData.sendThrottledChatMessage("message.feedback.item.returnCrystal.noSpace");
plData.stats().resetAllTribute();
player.entityDropItem(new ItemStack(ItemRegister.PROGRESS_COIN0), 0.5f);
} else {
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.goldStart.0", TextFormatting.GOLD));
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.goldStart.1", TextFormatting.GOLD));
player.setPositionAndUpdate(28, 20, 2);
}
return true;
}
break;
case 2:
if (PlayerUtil.getAdventPlayer(player).stats().getTribute(Enums.Deities.PLUTON) >= 100) {
EntityKlobber klobber = new EntityKlobber(world);
klobber.setPositionAndUpdate(69, 21, 4);
world.spawnEntity(klobber);
player.setPositionAndUpdate(67, 21, 2);
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.klobberStart", TextFormatting.DARK_AQUA));
return true;
}
break;
case 3:
if (ItemUtil.findInventoryItem(player, new ItemStack(ItemRegister.PROGRESS_COIN1), true, 1)) {
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.skeletalSpiritsStart", TextFormatting.RED));
player.setPositionAndUpdate(81, 21, 2);
return true;
}
break;
case 4:
if (PlayerUtil.getAdventPlayer(player).stats().getTribute(Enums.Deities.EREBON) >= 100) {
EntityProshield proshield = new EntityProshield(world);
proshield.setPositionAndUpdate(123, 21, 6);
world.spawnEntity(proshield);
player.setPositionAndUpdate(122, 21, 2);
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.proshieldStart", TextFormatting.DARK_AQUA));
return true;
}
break;
case 5:
if (ItemUtil.findInventoryItem(player, new ItemStack(ItemRegister.PROGRESS_COIN2), true, 1)) {
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.pureGoldStart.0", TextFormatting.GOLD));
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.pureGoldStart.1", TextFormatting.GOLD));
player.setPositionAndUpdate(141, 24, 2);
return true;
}
break;
case 6:
if (PlayerUtil.getAdventPlayer(player).stats().getTribute(Enums.Deities.PLUTON) == 200) {
EntityMirage mirage = new EntityMirage(world);
mirage.setPositionAndUpdate(177, 24, -2);
world.spawnEntity(mirage);
player.setPositionAndUpdate(168, 24, 7);
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.mirageStart", TextFormatting.DARK_AQUA));
return true;
}
break;
case 7:
if (ItemUtil.findInventoryItem(player, new ItemStack(ItemRegister.PROGRESS_COIN3), true, 1)) {
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.evilSpiritsStart", TextFormatting.RED));
player.setPositionAndUpdate(189, 20, 2);
return true;
}
break;
case 8:
if (PlayerUtil.getAdventPlayer(player).stats().getTribute(Enums.Deities.EREBON) == 200) {
EntityFlash flash = new EntityFlash(world);
flash.setPositionAndUpdate(235, 22, 10);
world.spawnEntity(flash);
player.setPositionAndUpdate(233, 21, 3);
player.sendMessage(StringUtil.getColourLocale("message.feedback.immortallisProgression.flashStart", TextFormatting.DARK_AQUA));
return true;
}
break;
case 9:
if (ItemUtil.findInventoryItem(player, new ItemStack(ItemRegister.PROGRESS_COIN4), true, 1)) {
player.setPositionAndUpdate(0, 20, 0);
ItemUtil.findInventoryItem(player, new ItemStack(ItemRegister.RETURN_CRYSTAL), true, 1);
PlayerUtil.getAdventPlayer(player).stats().resetAllTribute();
return true;
}
break;
}
}
return true;
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class PureGoldAccumulator method onBlockActivated.
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!world.isRemote && player.getHeldItem(hand).getItem() == ItemRegister.PURE_GOLD) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer(player);
if (!player.capabilities.isCreativeMode)
player.getHeldItem(hand).shrink(1);
plData.stats().addTribute(Enums.Deities.PLUTON, 20);
if (plData.stats().getTribute(Enums.Deities.PLUTON) == 200)
plData.sendThrottledChatMessage("message.feedback.immortallisProgression.pureGoldEnd", player.getDisplayNameString());
}
return true;
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class CreationForge method onBlockActivated.
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (!world.isRemote && player.getHeldItem(hand).getItem() instanceof BaseSlab) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer(player);
BaseSlab slab = (BaseSlab) player.getHeldItem(hand).getItem();
if (plData.stats().getLevel(Enums.Skills.CREATION) >= slab.sacrificeLvl) {
if (!player.capabilities.isCreativeMode)
player.getHeldItem(hand).shrink(1);
plData.stats().addXp(Enums.Skills.CREATION, slab.sacrificeXp, false, false);
world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), SoundsRegister.CREATION_FORGE_USE, SoundCategory.BLOCKS, 1.0f, 1.0f);
player.inventoryContainer.detectAndSendChanges();
} else {
if (player instanceof EntityPlayerMP)
PlayerUtil.notifyPlayerOfInsufficientLevel((EntityPlayerMP) player, Enums.Skills.CREATION, slab.sacrificeLvl);
}
}
return true;
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class BaseVulcane method onItemRightClick.
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
ItemStack stack = player.getHeldItem(hand);
if (world.isRemote)
return ActionResult.newResult(EnumActionResult.FAIL, stack);
PlayerDataManager plData = PlayerUtil.getAdventPlayer(player);
if (!plData.isRevengeActive())
return ActionResult.newResult(EnumActionResult.FAIL, stack);
return activate(plData, stack);
}
use of net.tslat.aoa3.utils.player.PlayerDataManager in project Advent-Of-Ascension by Tslat.
the class EntityNatura method doMeleeEffect.
@Override
protected void doMeleeEffect(Entity target) {
if (target instanceof EntityLivingBase) {
heal(15);
if (target instanceof EntityPlayer) {
PlayerDataManager plData = PlayerUtil.getAdventPlayer((EntityPlayer) target);
plData.stats().consumeResource(Enums.Resources.ENERGY, 50, true);
plData.sendThrottledChatMessage("message.mob.natura.attack");
}
}
}
Aggregations