Contents
Class EmptyResourceStorage
java.lang.Object
com.hypixel.hytale.component.EmptyResourceStorage
- All Implemented Interfaces:
IResourceStorage
A resource storage implementation that has no persistent storage.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EmptyResourceStorageget()<T extends Resource<ECS_TYPE>, ECS_TYPE>
CompletableFuture<T> load(Store<ECS_TYPE> store, ComponentRegistry.Data<ECS_TYPE> data, ResourceType<ECS_TYPE, T> resourceType) Called to load a resource from the given store and data.<T extends Resource<ECS_TYPE>, ECS_TYPE>
CompletableFuture<Void> remove(Store<ECS_TYPE> store, ComponentRegistry.Data<ECS_TYPE> data, ResourceType<ECS_TYPE, T> resourceType) Called to remove a resource from the given store and data.<T extends Resource<ECS_TYPE>, ECS_TYPE>
CompletableFuture<Void> save(Store<ECS_TYPE> store, ComponentRegistry.Data<ECS_TYPE> data, ResourceType<ECS_TYPE, T> resourceType, T resource) Called to save a resource to the given store and data.
-
Constructor Details
-
EmptyResourceStorage
public EmptyResourceStorage()
-
-
Method Details
-
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:IResourceStorageCalled to load a resource from the given store and data.- Specified by:
loadin interfaceIResourceStorage- 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
CompletableFuturethat 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:IResourceStorageCalled to save a resource to the given store and data.- Specified by:
savein interfaceIResourceStorage- 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
CompletableFuturethat 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:IResourceStorageCalled to remove a resource from the given store and data.- Specified by:
removein interfaceIResourceStorage- 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
CompletableFuturethat will complete when the remove operation is done.
-