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 floatprotected floatfinal 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 TypeMethodDescriptionvoidmergeFromServer(CommonBookData fromServer) Merges aCommonBookDatainstance from the server into this instance.voidShould be called when rendering.protected voidrenderPage(com.mojang.blaze3d.vertex.PoseStack stack, PosRot bookPosRot, boolean leftPage, int light) voidvoidShould 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:
tickin 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 aCommonBookDatainstance 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:
resetTurnStatein classCommonBookData
-