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