Class ClientBookData
java.lang.Object
com.hammy275.immersivemc.common.immersive.CommonBookData
com.hammy275.immersivemc.client.immersive.book.ClientBookData
- All Implemented Interfaces:
NetworkStorage
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 Summary
FieldsModifier and TypeFieldDescriptionfinal List
<BookInteractable> protected float
protected float
final List
<BookRenderable> Fields inherited from class com.hammy275.immersivemc.common.immersive.CommonBookData
isDirty, leftPageIndex, leftPageRot, leftPageTurn, linesPerPage, maxLeftPageIndex, onSetPageCallback, pageChangeState, pageHalfHeight, pageTilt, pageTurnBoxes, pageTurner, pageTurnerHandIndex, pageTurnPositions, pixelsPerLine, rightPageTurn, scaleSize, singlePageWidth, startVRPageTurnCallback, textInteractDistanceSqr, textStackScaleSize, textUpAmount
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
mergeFromServer
(CommonBookData fromServer) Merges aCommonBookData
instance from the server into this instance.void
Should be called when rendering.protected void
renderPage
(com.mojang.blaze3d.vertex.PoseStack stack, PosRot bookPosRot, boolean leftPage, int light) void
void
Should be called every tick.Methods inherited from class com.hammy275.immersivemc.common.immersive.CommonBookData
decode, encode, getAwayVector, getLeftPageIndex, getLeftRightVector, getPageChangeState, isDirty, lastPage, nextPage, onFirstPage, onLastPage, setDirty, setMaxLeftPageIndex, setNoLongerDirty, setPage, setPage, startNonVRPageTurnAnim, startVRPageTurn
-
Field Details
-
interactables
-
renderables
-
obbs
-
lastLeftPageTurn
protected float lastLeftPageTurn -
lastRightPageTurn
protected float lastRightPageTurn
-
-
Constructor Details
-
ClientBookData
public ClientBookData()
-
-
Method Details
-
tick
Should be called every tick.- Overrides:
tick
in classCommonBookData
- Parameters:
bookPosRot
- PosRot of the book itself.others
- PosRots for things that can interact with the book (VR controllers).
-
render
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
Merges aCommonBookData
instance from the server into this instance. Important to keep the server and client in-sync.- Parameters:
fromServer
- Data from the server.
-
getPageTurnHitboxes
-
getInteractableHitboxes
-
renderPage
protected void renderPage(com.mojang.blaze3d.vertex.PoseStack stack, PosRot bookPosRot, boolean leftPage, int light) -
resetTurnState
public void resetTurnState()- Overrides:
resetTurnState
in classCommonBookData
-