Interface WorldStorageHandler<S extends NetworkStorage>
- All Superinterfaces:
ImmersiveHandler<S>
- All Known Implementing Classes:
AnvilHandler,ApothSalvagingTableHandler,BeaconHandler,CraftingHandler,ETableHandler,GrindstoneHandler,ItemWorldStorageHandler,SmithingTableHandler
An
Important info:
ImmersiveHandler that saves and loads from world save data using WorldStorage instances. See
WorldStorage for more info.
Important info:
- ImmersiveMC only handles saving and loading
WorldStorageinstances. ImmersiveMC does NOT manage the creation or deletion of them. This means you'll need to handle creatingWorldStorageinstances (usually by callingWorldStorages.getOrCreate(BlockPos, ServerLevel)inImmersiveHandler.makeInventoryContents(ServerPlayer, BlockPos)and/orImmersiveHandler.swap(int, InteractionHand, BlockPos, ServerPlayer, com.hammy275.immersivemc.server.storage.server.ItemSwapAmount)and by callingWorldStorages.remove(BlockPos, ServerLevel)inImmersiveHandler.onStopTracking(ServerPlayer, BlockPos).
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanSince the retrieval and saving of world storages are server-side only, this Immersive cannot be client authoritative.Class<? extends WorldStorage> Methods inherited from interface com.hammy275.immersivemc.api.common.immersive.ImmersiveHandler
enabledInConfig, getEmptyNetworkStorage, getID, isDirtyForClientSync, isValidBlock, makeInventoryContents, onStopTracking, swap
-
Method Details
-
clientAuthoritative
default boolean clientAuthoritative()Since the retrieval and saving of world storages are server-side only, this Immersive cannot be client authoritative.- Specified by:
clientAuthoritativein interfaceImmersiveHandler<S extends NetworkStorage>- Returns:
- Whether this immersive should have tracking initiated by the client. The same value should always be returned by this method.
-
getEmptyWorldStorage
WorldStorage getEmptyWorldStorage()- Returns:
- An empty WorldStorage to load from NBT in.
-
getWorldStorageClass
Class<? extends WorldStorage> getWorldStorageClass()- Returns:
- The class this handler's world storage uses.
-