Interface WorldStorageHandler<S extends NetworkStorage>
- All Superinterfaces:
ImmersiveHandler<S>
- All Known Implementing Classes:
AnvilHandler
,BeaconHandler
,CraftingHandler
,ETableHandler
,ItemWorldStorageHandler
,LecternHandler
,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
WorldStorage
instances. ImmersiveMC does NOT manage the creation or deletion of them. This means you'll need to handle creatingWorldStorage
instances (usually by callingWorldStorages.getOrCreate(BlockPos, ServerLevel)
inImmersiveHandler.makeInventoryContents(ServerPlayer, BlockPos)
and/orImmersiveHandler.swap(int, InteractionHand, BlockPos, ServerPlayer, com.hammy275.immersivemc.api.server.ItemSwapAmount)
and by callingWorldStorages.remove(BlockPos, ServerLevel)
inImmersiveHandler.onStopTracking(ServerPlayer, BlockPos)
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Since 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:
clientAuthoritative
in 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.
-