Class ItemWorldStorageHandler<S extends NetworkStorage>
java.lang.Object
com.hammy275.immersivemc.common.immersive.handler.ItemWorldStorageHandler<S>
- All Implemented Interfaces:
ImmersiveHandler<S>
,WorldStorageHandler<S>
- Direct Known Subclasses:
AnvilHandler
,BeaconHandler
,CraftingHandler
,ETableHandler
,SmithingTableHandler
public abstract class ItemWorldStorageHandler<S extends NetworkStorage>
extends Object
implements WorldStorageHandler<S>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isDirtyForClientSync
(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos) Function to determine whether the block has changed its contents to sync to the client since its last sync.void
onStopTracking
(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos) Function called whenever this immersive is no longer being tracked.void
updateStorageOutputAfterItemReturn
(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos, ItemStorage storage) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.hammy275.immersivemc.api.common.immersive.ImmersiveHandler
enabledInConfig, getEmptyNetworkStorage, getID, isValidBlock, makeInventoryContents, swap
Methods inherited from interface com.hammy275.immersivemc.api.common.immersive.WorldStorageHandler
clientAuthoritative, getEmptyWorldStorage, getWorldStorageClass
-
Constructor Details
-
ItemWorldStorageHandler
public ItemWorldStorageHandler()
-
-
Method Details
-
isDirtyForClientSync
public boolean isDirtyForClientSync(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos) Description copied from interface:ImmersiveHandler
Function to determine whether the block has changed its contents to sync to the client since its last sync. Dirtiness is addressed every tick, so for every tick, you should clear ALL flags used for dirtiness.- Specified by:
isDirtyForClientSync
in interfaceImmersiveHandler<S extends NetworkStorage>
- Parameters:
player
- Player to potentially send new data to.pos
- Position of block to check.- Returns:
- Whether the given block has changed since it was last synced to the client
-
onStopTracking
public void onStopTracking(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos) Description copied from interface:ImmersiveHandler
Function called whenever this immersive is no longer being tracked. Only ever called server-side.- Specified by:
onStopTracking
in interfaceImmersiveHandler<S extends NetworkStorage>
- Parameters:
player
- Player who is no longer tracking this immersive.pos
- Position of the block no longer being tracked.
-
updateStorageOutputAfterItemReturn
public void updateStorageOutputAfterItemReturn(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos, ItemStorage storage)
-