Class Dirty

java.lang.Object
com.hypixel.hytale.server.core.entity.Dirty
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class Dirty extends Object implements Component<EntityStore>
  • Constructor Details

    • Dirty

      public Dirty()
    • Dirty

      public Dirty(@Nullable EntitySection section, boolean dirty)
  • Method Details

    • getComponentType

      @Nonnull public static ComponentType<EntityStore, Dirty> getComponentType()
    • markDirty

      public void markDirty()
    • forceMarkDirty

      public void forceMarkDirty()
    • consumeDirty

      public boolean consumeDirty()
    • isDirty

      public boolean isDirty()
    • pollCooldown

      public float pollCooldown(float dt)
      Decrements the save cooldown by the given delta time.
      Returns:
      the remaining cooldown after decrement; saves should only be issued once this is <= 0.0f.
    • isSaving

      public boolean isSaving()
    • setSaving

      public void setSaving(@Nonnull CompletableFuture<Void> future)
      Records the in-flight save's I/O future. isSaving() then reads non-null, so other savers won't start a second write for this entity and the removal path can chain its delete on future via getSavingFuture().
    • clearSaving

      public void clearSaving(@Nonnull CompletableFuture<Void> future)
      Clears the in-flight save marker, but only if future is still the tracked one, so a late completion can't clobber a newer save that already replaced it.
    • getSavingFuture

      @Nullable public CompletableFuture<Void> getSavingFuture()
    • setSection

      @Deprecated public void setSection(@Nullable EntitySection section)
      Deprecated.
    • clone

      @Nullable public Component<EntityStore> clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.