Class AbstractImmersive<I extends AbstractImmersiveInfo,S extends NetworkStorage>

java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractImmersive<I,S>
All Implemented Interfaces:
Immersive<I,S>
Direct Known Subclasses:
ImmersiveBeacon, ImmersiveChest

public abstract class AbstractImmersive<I extends AbstractImmersiveInfo,S extends NetworkStorage> extends Object implements Immersive<I,S>
  • Field Details

  • Constructor Details

    • AbstractImmersive

      public AbstractImmersive()
  • Method Details

    • getTrackedObjects

      public Collection<I> getTrackedObjects()
      Description copied from interface: Immersive
      Get the collection of ImmersiveInfos currently active for this Immersive. The contents of the list may be modified by ImmersiveMC with the intention of updating the actual set of active ImmersiveInfos.
      For example, if this Immersive represented a furnace, and the furnace was broken, ImmersiveMC would remove the ImmersiveInfo from the collection returned by this function to indicate that this Immersive should no longer handle the block, as it is no longer a furnace. As another example, if this Immersive represented a furnace, and a player placed a furnace, ImmersiveMC would add the result of Immersive.buildInfo(BlockPos, Level) to the collection returned by this function.
      In short, you should the actual collection of ImmersiveInfos used by this Immersive instead of a copy of it, unless you want to deal with a lot of extra work.
      Specified by:
      getTrackedObjects in interface Immersive<I extends AbstractImmersiveInfo,S extends NetworkStorage>
      Returns:
      The collection of all ImmersiveInfos tied to this Immersive.
    • tick

      public void tick(I info)
      Description copied from interface: Immersive
      This method is called once per game tick. This is where you should, for example, recalculate hitboxes if needed.
      Specified by:
      tick in interface Immersive<I extends AbstractImmersiveInfo,S extends NetworkStorage>
      Parameters:
      info - The info being ticked.