use of hellfirepvp.astralsorcery.common.item.base.PerkExperienceRevealer in project AstralSorcery by HellFirePvP.
the class PerkExperienceRenderer method tick.
@Override
public void tick(TickEvent.Type type, Object... context) {
PlayerEntity player = Minecraft.getInstance().player;
if (player != null) {
ItemStack held = player.getHeldItem(Hand.MAIN_HAND);
if (!held.isEmpty() && held.getItem() instanceof PerkExperienceRevealer && ((PerkExperienceRevealer) held.getItem()).shouldReveal(held)) {
revealExperience(20);
}
held = player.getHeldItem(Hand.OFF_HAND);
if (!held.isEmpty() && held.getItem() instanceof PerkExperienceRevealer && ((PerkExperienceRevealer) held.getItem()).shouldReveal(held)) {
revealExperience(20);
}
}
revealTicks--;
if ((revealTicks - fadeTicks) < 0) {
if (visibilityReveal > 0) {
visibilityReveal = Math.max(0, visibilityReveal - visibilityChange);
}
} else {
if (visibilityReveal < 1) {
visibilityReveal = Math.min(1, visibilityReveal + visibilityChange);
}
}
}
Aggregations