Class GaugeUnitElementalApplication
java.lang.Object
io.github.xrickastley.sevenelements.element.ElementalApplication
io.github.xrickastley.sevenelements.element.GaugeUnitElementalApplication
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.xrickastley.sevenelements.element.ElementalApplication
ElementalApplication.Builder, ElementalApplication.Type -
Field Summary
FieldsFields inherited from class io.github.xrickastley.sevenelements.element.ElementalApplication
appliedAt, currentGauge, DURATION_FORMAT, element, entity, GAUGE_UNIT_FORMAT, gaugeUnits, isAura, type, uuid -
Constructor Summary
ConstructorsConstructorDescriptionGaugeUnitElementalApplication(LivingEntity entity, Element element, UUID uuid, double gaugeUnits, boolean isAura) -
Method Summary
Modifier and TypeMethodDescriptionasAura()(package private) static ElementalApplicationfromNbt(LivingEntity entity, NbtCompound nbt, long syncedAt) private doubleGets the current decay rate inGauge Units/tick.protected doubleGets the default decay rate of this Elemental Application.private static doublegetDefaultDecayRate(double gaugeUnits) Gets the default decay rate per tick, derived from Elemental Gauge Theory: Aura Duration and Decay Rate.intgetText(@Nullable DecimalFormat gaugeFormat, @Nullable DecimalFormat durationFormat) booleanisEmpty()Returns whether this Elemental Application is empty.voidreapply(ElementalApplication application) Reapplies this Elemental Application, given thatapplicationhas the same element as this one.voidtick()toString()Methods inherited from class io.github.xrickastley.sevenelements.element.ElementalApplication
asNbt, getAppliedAt, getAppliedTicks, getCurrentGauge, getElement, getEntity, getGaugeUnits, getText, getText, getText, getText, getType, getUuid, isAuraElement, isDuration, isGaugeUnits, isOfElement, reapply, reduceGauge, updateFromNbt
-
Field Details
-
decayRate
private double decayRate
-
-
Constructor Details
-
GaugeUnitElementalApplication
GaugeUnitElementalApplication(LivingEntity entity, Element element, UUID uuid, double gaugeUnits, boolean isAura)
-
-
Method Details
-
fromNbt
-
getDefaultDecayRate
private static double getDefaultDecayRate(double gaugeUnits) Gets the default decay rate per tick, derived from Elemental Gauge Theory: Aura Duration and Decay Rate. -
getDecayRate
private double getDecayRate()Gets the current decay rate inGauge Units/tick. -
getDefaultDecayRate
protected double getDefaultDecayRate()Description copied from class:ElementalApplicationGets the default decay rate of this Elemental Application.- Specified by:
getDefaultDecayRatein classElementalApplication- Returns:
- The default decay rate of this Elemental Application in
GU/tick.
-
getRemainingTicks
public int getRemainingTicks()- Specified by:
getRemainingTicksin classElementalApplication
-
getText
public Text getText(@Nullable @Nullable DecimalFormat gaugeFormat, @Nullable @Nullable DecimalFormat durationFormat) - Specified by:
getTextin classElementalApplication
-
isEmpty
public boolean isEmpty()Returns whether this Elemental Application is empty.
This implementation guarantees this to betruewhencurrentGaugereaches0.- Specified by:
isEmptyin classElementalApplication
-
tick
public void tick()- Overrides:
tickin classElementalApplication
-
reapply
Description copied from class:ElementalApplicationReapplies this Elemental Application, given thatapplicationhas the same element as this one.- Specified by:
reapplyin classElementalApplication- Parameters:
application- The Elemental Application to reapply using this application.
-
asAura
- Specified by:
asAurain classElementalApplication
-
asNonAura
- Specified by:
asNonAurain classElementalApplication
-
toString
-