Search in sources :

Example 1 with ItemMantle

use of hellfirepvp.astralsorcery.common.item.armor.ItemMantle in project AstralSorcery by HellFirePvP.

the class MantleEffectVicio method isUsableElytra.

public static boolean isUsableElytra(ItemStack elytraStack, PlayerEntity wearingEntity) {
    if (elytraStack.getItem() instanceof ItemMantle) {
        MantleEffect effect = ItemMantle.getEffect(wearingEntity, ConstellationsAS.vicio);
        PlayerProgress progress;
        if (wearingEntity.getEntityWorld().isRemote()) {
            progress = ResearchHelper.getClientProgress();
        } else {
            progress = ResearchHelper.getProgress(wearingEntity, LogicalSide.SERVER);
        }
        return effect != null && !progress.getPerkData().hasPerkEffect(p -> p instanceof KeyMantleFlight);
    }
    return false;
}
Also used : MantleEffect(hellfirepvp.astralsorcery.common.constellation.mantle.MantleEffect) ItemMantle(hellfirepvp.astralsorcery.common.item.armor.ItemMantle) KeyMantleFlight(hellfirepvp.astralsorcery.common.perk.node.key.KeyMantleFlight) PlayerProgress(hellfirepvp.astralsorcery.common.data.research.PlayerProgress)

Example 2 with ItemMantle

use of hellfirepvp.astralsorcery.common.item.armor.ItemMantle in project AstralSorcery by HellFirePvP.

the class ScreenJournalConstellationDetail method drawCapeInformationPages.

private void drawCapeInformationPages(MatrixStack renderStack, int mouseX, int mouseY, float partialTicks) {
    for (int i = 0; i < locTextMantle.size(); i++) {
        IReorderingProcessor line = locTextMantle.get(i);
        renderStack.push();
        renderStack.translate(guiLeft + 30, guiTop + 30 + i * 10, this.getGuiZLevel());
        RenderingDrawUtils.renderStringAt(line, renderStack, font, 0xFFCCCCCC, true);
        renderStack.pop();
    }
    if (ResearchHelper.getClientProgress().getTierReached().isThisLaterOrEqual(ProgressionTier.TRAIT_CRAFT)) {
        SimpleAltarRecipe recipe = RecipeHelper.findAltarRecipeResult(stack -> stack.getItem() instanceof ItemMantle && this.constellation.equals(ItemsAS.MANTLE.getConstellation(stack)));
        if (recipe != null) {
            lastFramePage = new RenderPageAltarRecipe(null, -1, recipe);
            lastFramePage.render(renderStack, guiLeft + 220, guiTop + 20, this.getGuiZLevel(), partialTicks, mouseX, mouseY);
            lastFramePage.postRender(renderStack, guiLeft + 220, guiTop + 20, this.getGuiZLevel(), partialTicks, mouseX, mouseY);
        }
    }
}
Also used : IReorderingProcessor(net.minecraft.util.IReorderingProcessor) ItemMantle(hellfirepvp.astralsorcery.common.item.armor.ItemMantle) RenderPageAltarRecipe(hellfirepvp.astralsorcery.client.screen.journal.page.RenderPageAltarRecipe) SimpleAltarRecipe(hellfirepvp.astralsorcery.common.crafting.recipe.SimpleAltarRecipe)

Example 3 with ItemMantle

use of hellfirepvp.astralsorcery.common.item.armor.ItemMantle in project AstralSorcery by HellFirePvP.

the class MantleEffectBootes method forEachFlare.

protected void forEachFlare(LivingEntity owner, Consumer<EntityFlare> fn) {
    ItemStack mantle = owner.getItemStackFromSlot(EquipmentSlotType.CHEST);
    if (mantle.isEmpty() || !(mantle.getItem() instanceof ItemMantle)) {
        return;
    }
    this.gatherFlares(owner.getEntityWorld(), mantle).forEach(fn);
}
Also used : ItemMantle(hellfirepvp.astralsorcery.common.item.armor.ItemMantle) ItemStack(net.minecraft.item.ItemStack)

Example 4 with ItemMantle

use of hellfirepvp.astralsorcery.common.item.armor.ItemMantle in project AstralSorcery by HellFirePvP.

the class MantleEffectBootes method tickServer.

@Override
protected void tickServer(PlayerEntity player) {
    super.tickServer(player);
    ItemStack mantle = player.getItemStackFromSlot(EquipmentSlotType.CHEST);
    if (mantle.isEmpty() || !(mantle.getItem() instanceof ItemMantle)) {
        return;
    }
    World world = player.getEntityWorld();
    List<EntityFlare> flares = gatherFlares(world, mantle);
    if (flares.size() < CONFIG.maxFlareCount.get()) {
        if (player.ticksExisted % 80 == 0) {
            if (AlignmentChargeHandler.INSTANCE.hasCharge(player, LogicalSide.SERVER, CONFIG.chargeCostPerFlare.get()) && rand.nextInt(4) == 0) {
                EntityFlare flare = EntityTypesAS.FLARE.create(player.getEntityWorld());
                flare.setPosition(player.getPosX(), player.getPosY(), player.getPosZ());
                flare.setFollowingTarget(player);
                if (world.addEntity(flare)) {
                    flares.add(flare);
                    AlignmentChargeHandler.INSTANCE.drainCharge(player, LogicalSide.SERVER, CONFIG.chargeCostPerFlare.get(), false);
                }
            }
        }
    }
    for (EntityFlare flare : flares) {
        if (flare.getFollowingTarget() != null && (flare.getAttackTarget() == null ? player.getDistance(flare) >= 12 : player.getDistance(flare) >= 35)) {
            flare.setPositionAndRotation(player.getPosX(), player.getPosY(), player.getPosZ(), 0, 0);
        }
    }
    setEntityIds(mantle, flares.stream().map(Entity::getEntityId).collect(Collectors.toList()));
}
Also used : EntityFlare(hellfirepvp.astralsorcery.common.entity.EntityFlare) Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ItemMantle(hellfirepvp.astralsorcery.common.item.armor.ItemMantle) ItemStack(net.minecraft.item.ItemStack) World(net.minecraft.world.World)

Aggregations

ItemMantle (hellfirepvp.astralsorcery.common.item.armor.ItemMantle)4 ItemStack (net.minecraft.item.ItemStack)2 RenderPageAltarRecipe (hellfirepvp.astralsorcery.client.screen.journal.page.RenderPageAltarRecipe)1 MantleEffect (hellfirepvp.astralsorcery.common.constellation.mantle.MantleEffect)1 SimpleAltarRecipe (hellfirepvp.astralsorcery.common.crafting.recipe.SimpleAltarRecipe)1 PlayerProgress (hellfirepvp.astralsorcery.common.data.research.PlayerProgress)1 EntityFlare (hellfirepvp.astralsorcery.common.entity.EntityFlare)1 KeyMantleFlight (hellfirepvp.astralsorcery.common.perk.node.key.KeyMantleFlight)1 Entity (net.minecraft.entity.Entity)1 LivingEntity (net.minecraft.entity.LivingEntity)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 IReorderingProcessor (net.minecraft.util.IReorderingProcessor)1 World (net.minecraft.world.World)1