public class HealthValueProcessor extends AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
Constructor and Description |
---|
HealthValueProcessor() |
Modifier and Type | Method and Description |
---|---|
protected org.spongepowered.api.data.value.immutable.ImmutableBoundedValue<Double> |
constructImmutableValue(Double value) |
org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double> |
constructValue(Double health)
Builds a
Value of the type produced by this processor from an
input, actual value. |
Optional<org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>> |
getApiValueFromContainer(org.spongepowered.api.data.value.ValueContainer<?> container)
Gets the actual
Value object wrapping around the underlying value
desired from the provided ValueContainer . |
protected Optional<Double> |
getVal(net.minecraft.entity.EntityLivingBase container) |
org.spongepowered.api.data.DataTransactionResult |
offerToStore(org.spongepowered.api.data.value.ValueContainer<?> container,
Double value)
Offers the provided
BaseValue containing a value of the
appropriate value type of this ValueProcessor to offer
back to the ValueContainer . |
org.spongepowered.api.data.DataTransactionResult |
removeFrom(org.spongepowered.api.data.value.ValueContainer<?> container)
Attempts to remove the known keyed data associated with this
ValueProcessor from the provided ValueContainer . |
protected boolean |
set(net.minecraft.entity.EntityLivingBase container,
Double value) |
boolean |
supports(org.spongepowered.api.data.value.ValueContainer<?> container)
Checks if the provided
ValueContainer is compatible with the
value of data associated with this ValueProcessor . |
getKey, getPriority, getValueFromContainer, supports
public org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double> constructValue(Double health)
AbstractSpongeValueProcessor
Value
of the type produced by this processor from an
input, actual value.constructValue
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
health
- The actual valueValue
protected boolean set(net.minecraft.entity.EntityLivingBase container, Double value)
set
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
protected Optional<Double> getVal(net.minecraft.entity.EntityLivingBase container)
getVal
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
protected org.spongepowered.api.data.value.immutable.ImmutableBoundedValue<Double> constructImmutableValue(Double value)
constructImmutableValue
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
public Optional<org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>> getApiValueFromContainer(org.spongepowered.api.data.value.ValueContainer<?> container)
ValueProcessor
Value
object wrapping around the underlying value
desired from the provided ValueContainer
. This is very similar to
ValueProcessor.getValueFromContainer(ValueContainer)
except that instead of an
actual value, a Value
or extension there of is returned.getApiValueFromContainer
in interface ValueProcessor<Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
getApiValueFromContainer
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
container
- The container to get the API value fromValue
typed valuepublic boolean supports(org.spongepowered.api.data.value.ValueContainer<?> container)
ValueProcessor
ValueContainer
is compatible with the
value of data associated with this ValueProcessor
.supports
in interface ValueProcessor<Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
supports
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
container
- The value container to checkpublic org.spongepowered.api.data.DataTransactionResult offerToStore(org.spongepowered.api.data.value.ValueContainer<?> container, Double value)
ValueProcessor
BaseValue
containing a value of the
appropriate value type of this ValueProcessor
to offer
back to the ValueContainer
.offerToStore
in interface ValueProcessor<Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
offerToStore
in class AbstractSpongeValueProcessor<net.minecraft.entity.EntityLivingBase,Double,org.spongepowered.api.data.value.mutable.MutableBoundedValue<Double>>
container
- The value containervalue
- The valuepublic org.spongepowered.api.data.DataTransactionResult removeFrom(org.spongepowered.api.data.value.ValueContainer<?> container)
ValueProcessor
ValueProcessor
from the provided ValueContainer
. If
the result is not possible, the result will be an expected
DataTransactionResult.Type#FAILURE
.container
- The value container to remove data from