Package net.nullved.pmweatherapi.storage
Class StorageInstance<D extends IStorageData,S extends IServerStorage<D>>
java.lang.Object
net.nullved.pmweatherapi.storage.StorageInstance<D,S>
- Type Parameters:
D- TheIStorageDataof theIServerStorageS- TheIServerStorage
A Storage Instance for a given
A Storage Instance holds all of the
To get the
To load a new dimension, pass the
You should not create
IServerStorage type.
A Storage Instance holds all of the
IServerStorage instances for each dimension.
To get the
IServerStorage for a specific dimension, use get(ResourceKey).
If you are unsure the IServerStorage exists and have a ServerLevel, use getOrCreate(ServerLevel).
To load a new dimension, pass the
ServerLevel into load(ServerLevel).
To remove a dimension, call remove(ResourceKey)
You should not create
StorageInstances yourself.
Instead, get them from PMWStorages.get(net.minecraft.resources.ResourceLocation)- Since:
- 0.15.3.3
-
Constructor Summary
ConstructorsConstructorDescriptionStorageInstance(net.minecraft.resources.ResourceLocation id, Class<S> clazz, Function<net.minecraft.server.level.ServerLevel, S> creator) -
Method Summary
Modifier and TypeMethodDescription<F extends IStorageData,O extends IServerStorage<F>>
Optional<StorageInstance<F, O>> voidclear()entrySet()get(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) getOrCreate(net.minecraft.server.level.ServerLevel level) net.minecraft.resources.ResourceLocationid()Set<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> keySet()voidload(net.minecraft.server.level.ServerLevel level) voidremove(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) values()
-
Constructor Details
-
StorageInstance
-
-
Method Details
-
id
public net.minecraft.resources.ResourceLocation id() -
getBackingMap
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
get
-
getOrCreate
-
cast
public <F extends IStorageData,O extends IServerStorage<F>> Optional<StorageInstance<F,O>> cast(Class<O> oclazz) -
load
public void load(net.minecraft.server.level.ServerLevel level) -
remove
public void remove(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension)
-