public final class FunctionSensor<T> extends AbstractAddSensorFeed<T>
EntityInitializer
which adds a function sensor feed.
This calls the function periodically, to compute the sensor's value.FunctionFeed
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.util.concurrent.Callable<?>> |
FUNCTION |
LOG_WARNING_GRACE_TIME, LOG_WARNING_GRACE_TIME_ON_STARTUP, SUPPRESS_DUPLICATES
SENSOR_NAME, SENSOR_PERIOD, SENSOR_TYPE
Constructor and Description |
---|
FunctionSensor(ConfigBag params) |
Modifier and Type | Method and Description |
---|---|
void |
apply(EntityLocal entity)
Applies initialization logic to a just-built entity.
|
public static final ConfigKey<java.util.concurrent.Callable<?>> FUNCTION
public FunctionSensor(ConfigBag params)
public void apply(EntityLocal entity)
EntityInitializer
apply
in interface EntityInitializer
apply
in class AddSensor<T>
entity
- guaranteed to be the actual implementation instance,
thus guaranteed to be castable to EntityInternal which is often desired,
or to the type at hand (it is not even a proxy)