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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether blocks matching this Immersive should be initiated by the client.boolean
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.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, 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: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
-
clientAuthoritative
public boolean clientAuthoritative()Description copied from interface:ImmersiveHandler
Whether 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.- 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.
-