DespawnComponent

public class DespawnComponent implements Component

Component for tracking despawn state. Attach this component to entities that need to track despawn data.

java.lang.Object > DespawnComponent

Field Summary

timeToDespawnAt

private Instant timeToDespawnAt

Field timeToDespawnAt.

Method Detail

getComponentType

public DespawnComponent> getComponentType ()

Method getComponentType.

DespawnComponent

public public DespawnComponent ()

Method DespawnComponent.

setDespawn

public void setDespawn (final Instant timeToDespawnAt)

Method setDespawn.

Parameters:
final Instant timeToDespawnAt

setDespawnTo

public void setDespawnTo (@Nonnull final Instant from, final float additionalSeconds)

Method setDespawnTo.

Parameters:
@Nonnull final Instant from
final float additionalSeconds

getDespawn

public Instant getDespawn ()

Method getDespawn.

despawnInSeconds

static DespawnComponent despawnInSeconds (@Nonnull final TimeResource time, final int seconds)

Method despawnInSeconds.

Parameters:
@Nonnull final TimeResource time
final int seconds

despawnInMilliseconds

static DespawnComponent despawnInMilliseconds (@Nonnull final TimeResource time, final long milliseconds)

Method despawnInMilliseconds.

Parameters:
@Nonnull final TimeResource time
final long milliseconds

trySetDespawn

static void trySetDespawn (@Nonnull final CommandBuffer commandBuffer, @Nonnull final TimeResource timeResource, @Nonnull final Ref ref, @Nullable final DespawnComponent despawnComponent, @Nullable final Float newLifetime)

Method trySetDespawn.

Parameters:
@Nonnull final CommandBuffer commandBuffer
@Nonnull final TimeResource timeResource
@Nonnull final Ref ref
@Nullable final DespawnComponent despawnComponent
@Nullable final Float newLifetime

clone

public Component clone ()

Method clone.