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;
}
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);
}
}
}
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);
}
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()));
}
Aggregations