Class ContainerHandler<S extends NetworkStorage>
java.lang.Object
com.hammy275.immersivemc.common.immersive.handler.ContainerHandler<S>
- All Implemented Interfaces:
BlockBasedImmersiveHandler<S>, ImmersiveHandler
- Direct Known Subclasses:
BrewingStandHandler, ChestLikeHandler, ChiseledBookshelfHandler, FurnaceHandler, TCCraftingStationHandler
public abstract class ContainerHandler<S extends NetworkStorage>
extends Object
implements BlockBasedImmersiveHandler<S>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the client should be the one to begin tracking this immersive.booleanisDirtyForClientSync(net.minecraft.server.level.ServerPlayer tracker, 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BlockBasedImmersiveHandler
getEmptyNetworkStorage, isValidBlock, makeInventoryContents, onStopTracking, swapMethods inherited from interface ImmersiveHandler
enabledInConfig, getID
-
Constructor Details
-
ContainerHandler
public ContainerHandler()
-
-
Method Details
-
isDirtyForClientSync
public boolean isDirtyForClientSync(net.minecraft.server.level.ServerPlayer tracker, net.minecraft.core.BlockPos pos) Description copied from interface:BlockBasedImmersiveHandlerFunction 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 interfaceBlockBasedImmersiveHandler<S extends NetworkStorage>- Parameters:
tracker- 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 the client should be the one to begin tracking this immersive. If this is true, the server should not send any data to the client about this Immersive, and does not know who is tracking this Immersive.- Specified by:
clientAuthoritativein interfaceImmersiveHandler- Returns:
- Whether this immersive should have tracking initiated by the client. The same value should always be returned by this method.
-