Class StorageRepositoryImpl
java.lang.Object
net.minecraft.world.level.saveddata.SavedData
com.refinedmods.refinedstorage.common.support.AbstractPlatformSavedData
com.refinedmods.refinedstorage.common.storage.StorageRepositoryImpl
- All Implemented Interfaces:
StorageRepository
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.saveddata.SavedData
net.minecraft.world.level.saveddata.SavedData.Factory<T extends net.minecraft.world.level.saveddata.SavedData>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStorageRepositoryImpl
(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a storage by ID, if it exists.Retrieves info for a given storage ID.void
Marks to be saved.void
Removes a storage by ID.removeIfEmpty
(UUID id) If the storage exists, and is empty, it will remove the storage from the repository.net.minecraft.nbt.CompoundTag
save
(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) void
set
(UUID id, SerializableStorage storage) Sets a storage by ID.Methods inherited from class com.refinedmods.refinedstorage.common.support.AbstractPlatformSavedData
save
Methods inherited from class net.minecraft.world.level.saveddata.SavedData
isDirty, setDirty, setDirty
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
StorageRepositoryImpl
public StorageRepositoryImpl(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) -
StorageRepositoryImpl
public StorageRepositoryImpl()
-
-
Method Details
-
get
Description copied from interface:StorageRepository
Retrieves a storage by ID, if it exists.- Specified by:
get
in interfaceStorageRepository
- Parameters:
id
- the id- Returns:
- the storage, if present
-
set
Description copied from interface:StorageRepository
Sets a storage by ID.- Specified by:
set
in interfaceStorageRepository
- Parameters:
id
- the idstorage
- the storage
-
removeIfEmpty
Description copied from interface:StorageRepository
If the storage exists, and is empty, it will remove the storage from the repository.- Specified by:
removeIfEmpty
in interfaceStorageRepository
- Parameters:
id
- the id- Returns:
- the removed storage, if it existed and was empty
-
remove
Description copied from interface:StorageRepository
Removes a storage by ID.- Specified by:
remove
in interfaceStorageRepository
- Parameters:
id
- the id
-
getInfo
Description copied from interface:StorageRepository
Retrieves info for a given storage ID.- Specified by:
getInfo
in interfaceStorageRepository
- Parameters:
id
- the id- Returns:
- the info, or
StorageInfo.UNKNOWN
if the ID was not found
-
markAsChanged
public void markAsChanged()Description copied from interface:StorageRepository
Marks to be saved.- Specified by:
markAsChanged
in interfaceStorageRepository
-
save
public net.minecraft.nbt.CompoundTag save(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider provider) - Specified by:
save
in classnet.minecraft.world.level.saveddata.SavedData
-