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 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: BlockBasedImmersiveHandler
      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 interface BlockBasedImmersiveHandler<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: ImmersiveHandler
      Whether 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:
      clientAuthoritative in interface ImmersiveHandler
      Returns:
      Whether this immersive should have tracking initiated by the client. The same value should always be returned by this method.