Class ClientBookData

java.lang.Object
com.hammy275.immersivemc.common.immersive.CommonBookData
com.hammy275.immersivemc.client.immersive.book.ClientBookData
All Implemented Interfaces:
NetworkStorage

public class ClientBookData extends CommonBookData
Data used only by the client for a book that can be used in Immersives. Has everything from its parent class, along with the ability to add renderables and interactables for rendering and allowing interactions. Interactions are only handled for VR users.
  • Field Details

    • interactables

      public final List<BookInteractable> interactables
    • renderables

      public final List<BookRenderable> renderables
    • obbs

      protected final List<OBB> obbs
    • lastLeftPageTurn

      protected float lastLeftPageTurn
    • lastRightPageTurn

      protected float lastRightPageTurn
  • Constructor Details

    • ClientBookData

      public ClientBookData()
  • Method Details

    • tick

      public void tick(PosRot bookPosRot, PosRot... others)
      Should be called every tick.
      Overrides:
      tick in class CommonBookData
      Parameters:
      bookPosRot - PosRot of the book itself.
      others - PosRots for things that can interact with the book (VR controllers).
    • render

      public void render(com.mojang.blaze3d.vertex.PoseStack stack, int light, PosRot bookPosRot)
      Should be called when rendering.
      Parameters:
      stack - The PoseStack to render with.
      light - The light level being rendered at.
      bookPosRot - The PosRot of the book.
    • mergeFromServer

      public void mergeFromServer(CommonBookData fromServer)
      Merges a CommonBookData instance from the server into this instance. Important to keep the server and client in-sync.
      Parameters:
      fromServer - Data from the server.
    • getPageTurnHitboxes

      public List<OBB> getPageTurnHitboxes()
    • getInteractableHitboxes

      public List<OBB> getInteractableHitboxes()
    • renderPage

      protected void renderPage(com.mojang.blaze3d.vertex.PoseStack stack, PosRot bookPosRot, boolean leftPage, int light)
    • resetTurnState

      public void resetTurnState()
      Overrides:
      resetTurnState in class CommonBookData