Class ItemWorldStorageHandler<S extends NetworkStorage>

java.lang.Object
com.hammy275.immersivemc.common.immersive.handler.ItemWorldStorageHandler<S>
All Implemented Interfaces:
ImmersiveHandler<S>, WorldStorageHandler<S>
Direct Known Subclasses:
AnvilHandler, BeaconHandler, CraftingHandler, ETableHandler, SmithingTableHandler

public abstract class ItemWorldStorageHandler<S extends NetworkStorage> extends Object implements WorldStorageHandler<S>
  • Constructor Details

    • ItemWorldStorageHandler

      public ItemWorldStorageHandler()
  • 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
    • onStopTracking

      public void onStopTracking(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos)
      Description copied from interface: ImmersiveHandler
      Function called whenever this immersive is no longer being tracked. Only ever called server-side.
      Specified by:
      onStopTracking in interface ImmersiveHandler<S extends NetworkStorage>
      Parameters:
      player - Player who is no longer tracking this immersive.
      pos - Position of the block no longer being tracked.
    • updateStorageOutputAfterItemReturn

      public void updateStorageOutputAfterItemReturn(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos, ItemStorage storage)