Class ContainerHandler<S extends NetworkStorage>
java.lang.Object
com.hammy275.immersivemc.common.immersive.handler.ContainerHandler<S>
- All Implemented Interfaces:
ImmersiveHandler<S>
- Direct Known Subclasses:
BrewingStandHandler,ChestLikeHandler,ChiseledBookshelfHandler,FurnaceHandler,TCCraftingStationHandler
public abstract class ContainerHandler<S extends NetworkStorage>
extends Object
implements ImmersiveHandler<S>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether blocks matching this Immersive should be initiated by the client.booleanisDirtyForClientSync(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hammy275.immersivemc.api.common.immersive.ImmersiveHandler
enabledInConfig, getEmptyNetworkStorage, getID, isValidBlock, makeInventoryContents, onStopTracking, swap
-
Constructor Details
-
ContainerHandler
public ContainerHandler()
-
-
Method Details
-
isDirtyForClientSync
public boolean isDirtyForClientSync(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos) Description copied from interface:ImmersiveHandlerFunction 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:
isDirtyForClientSyncin 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
-
clientAuthoritative
public boolean clientAuthoritative()Description copied from interface:ImmersiveHandlerWhether blocks matching this Immersive should be initiated by the client. If this is true, the server should not send any data to the client about this Immersive, and will never track that a client isn't tracking the Immersive orImmersiveHandler.makeInventoryContents(ServerPlayer, BlockPos)for it.- 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.
-