Class EmptyResourceStorage

java.lang.Object
com.hypixel.hytale.component.EmptyResourceStorage
All Implemented Interfaces:
IResourceStorage

public class EmptyResourceStorage extends Object implements IResourceStorage
A resource storage implementation that has no persistent storage.
  • Constructor Details

    • EmptyResourceStorage

      public EmptyResourceStorage()
  • Method Details

    • get

      public static EmptyResourceStorage get()
    • load

      @Nonnull public <T extends Resource<ECS_TYPE>, ECS_TYPE> CompletableFuture<T> load(@Nonnull Store<ECS_TYPE> store, @Nonnull ComponentRegistry.Data<ECS_TYPE> data, @Nonnull ResourceType<ECS_TYPE,T> resourceType)
      Description copied from interface: IResourceStorage
      Called to load a resource from the given store and data.
      Specified by:
      load in interface IResourceStorage
      Type Parameters:
      T - The type of resource.
      ECS_TYPE - The ECS type.
      Parameters:
      store - The store to load from.
      data - The component data associated with the resource.
      resourceType - The type of resource to load.
      Returns:
      a CompletableFuture that will complete with the loaded resource.
    • save

      @Nonnull public <T extends Resource<ECS_TYPE>, ECS_TYPE> CompletableFuture<Void> save(@Nonnull Store<ECS_TYPE> store, @Nonnull ComponentRegistry.Data<ECS_TYPE> data, @Nonnull ResourceType<ECS_TYPE,T> resourceType, T resource)
      Description copied from interface: IResourceStorage
      Called to save a resource to the given store and data.
      Specified by:
      save in interface IResourceStorage
      Type Parameters:
      T - The type of resource.
      ECS_TYPE - The ECS type.
      Parameters:
      store - The store to save to.
      data - The component data associated with the resource.
      resourceType - The type of resource to save.
      resource - The resource to save.
      Returns:
      a CompletableFuture that will complete when the save operation is done.
    • remove

      @Nonnull public <T extends Resource<ECS_TYPE>, ECS_TYPE> CompletableFuture<Void> remove(@Nonnull Store<ECS_TYPE> store, @Nonnull ComponentRegistry.Data<ECS_TYPE> data, @Nonnull ResourceType<ECS_TYPE,T> resourceType)
      Description copied from interface: IResourceStorage
      Called to remove a resource from the given store and data.
      Specified by:
      remove in interface IResourceStorage
      Type Parameters:
      T - The type of resource.
      ECS_TYPE - The ECS type.
      Parameters:
      store - The store to remove from.
      data - The component data associated with the resource.
      resourceType - The type of resource to remove.
      Returns:
      a CompletableFuture that will complete when the remove operation is done.