Interface ImmersiveRenderState

All Known Subinterfaces:
BuiltImmersiveRenderState<ER>
All Known Implementing Classes:
AbstractImmersiveRenderState, BeaconRenderState, BuiltImmersiveRenderStateImpl, ChestRenderState, DragRenderState, LecternRenderState

public interface ImmersiveRenderState
State for rendering a ImmersiveInfo. Unlike ImmersiveInfos, these classes only need to hold information related to rendering.

Importantly, data in render states should be independent of data in the infos they come from, see Immersive.extractRenderState(I, R, float) for more info.

  • Method Details

    • hitboxes

      List<BoundingBox> hitboxes()
      Gets the list of all hitboxes for interaction, this interface's counterpart to ImmersiveInfo.getAllHitboxes(). Like its counterpart, the list can contain null elements.

      For Immersives that have hitboxes

      Returns:
      A list of all bounding boxes indexed by their slot number.
    • ticksExisted

      long ticksExisted()
      Gets the amount of ticks the info this render state comes from has existed, this interface's counterpart to ImmersiveInfo.getTicksExisted().
      Returns:
      The amount of ticks the ImmersiveInfo this render state came from has existed.
    • isSlotHovered

      boolean isSlotHovered(int slot)
      Gets whether the provided slot (index into hitboxes()) is currently hovered. This is similar to ImmersiveInfo.getSlotHovered(int), but this function gets the slot and returns whether that slot is hovered, whereas ImmersiveInfo.getSlotHovered(int) gets the hand index and returns the hovered slot.
      Parameters:
      slot - The slot/index into hitboxes() that is checked if it's hovered.
      Returns:
      Whether the aforementioned slot is hovered.