Interface WorldStorage
- All Known Implementing Classes:
AnvilStorage,ApothSalvagingTableStorage,BeaconStorage,CraftingTableStorage,ETableWorldStorage,GrindstoneStorage,ItemStorage,SmithingTableStorage
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> voidload(net.minecraft.nbt.CompoundTag nbt, net.minecraft.resources.RegistryOps<net.minecraft.nbt.Tag> ops, int lastVanillaDataVersion) Load from the NBT tag into this object.net.minecraft.nbt.CompoundTagsave(net.minecraft.nbt.CompoundTag nbt, net.minecraft.resources.RegistryOps<net.minecraft.nbt.Tag> ops, net.minecraft.nbt.EndTag prefix) Save this object into the NBT tag.
-
Method Details
-
load
void load(net.minecraft.nbt.CompoundTag nbt, net.minecraft.resources.RegistryOps<net.minecraft.nbt.Tag> ops, int lastVanillaDataVersion) Load from the NBT tag into this object.- Parameters:
nbt- NBT tag to load from.ops- Registry operations.lastVanillaDataVersion- The last vanilla data version this storage was loaded in.
-
save
net.minecraft.nbt.CompoundTag save(net.minecraft.nbt.CompoundTag nbt, net.minecraft.resources.RegistryOps<net.minecraft.nbt.Tag> ops, net.minecraft.nbt.EndTag prefix) Save this object into the NBT tag.- Parameters:
nbt- NBT tag to save to.ops- Registry operations.prefix- Prefix.- Returns:
- The same NBT tag as provided to this method.
-
getHandler
WorldStorageHandler<? extends NetworkStorage> getHandler()- Returns:
- Handler for this type of WorldStorage.
-