Interface WorldStorage
- All Known Implementing Classes:
AnvilStorage
,BeaconStorage
,BookData
,ClientBookData
,CraftingTableStorage
,ETableWorldStorage
,ItemStorage
,SmithingTableStorage
@Beta
public interface WorldStorage
An object that can be written to and from NBT used with a
WorldStorageHandler
. Allows Immersives to hold
items and persist them between world shutdowns if the block doesn't already handle holding items. For example,
ImmersiveMC uses this for vanilla crafting tables, since crafting tables can't hold items on their own.-
Method Summary
Modifier and TypeMethodDescriptionWorldStorageHandler<? extends NetworkStorage>
void
load
(net.minecraft.nbt.CompoundTag nbt, int lastVanillaDataVersion) Load from the NBT tag into this object.net.minecraft.nbt.CompoundTag
save
(net.minecraft.nbt.CompoundTag nbt) Save this object into the NBT tag.
-
Method Details
-
load
void load(net.minecraft.nbt.CompoundTag nbt, int lastVanillaDataVersion) Load from the NBT tag into this object.- Parameters:
nbt
- NBT tag to load from.lastVanillaDataVersion
- The last vanilla data version this storage was loaded in.
-
save
net.minecraft.nbt.CompoundTag save(net.minecraft.nbt.CompoundTag nbt) Save this object into the NBT tag.- Parameters:
nbt
- NBT tag to save to.- Returns:
- The same NBT tag as provided to this method.
-
getHandler
WorldStorageHandler<? extends NetworkStorage> getHandler()- Returns:
- Handler for this type of WorldStorage.
-