Interface BookRenderable
- All Known Implementing Classes:
WrittenBookHelpers.BookTextRenderer
public interface BookRenderable
Something that can be rendered in a book.
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.Vec3
getStartOffset
(ClientBookData data, boolean leftPage, PosRot bookPosRot) Called to get the offset on the page to start rendering from.void
render
(com.mojang.blaze3d.vertex.PoseStack stack, ClientBookData data, boolean leftPage, int light, PosRot bookPosRot) Called to render this.
-
Method Details
-
render
void render(com.mojang.blaze3d.vertex.PoseStack stack, ClientBookData data, boolean leftPage, int light, PosRot bookPosRot) Called to render this.- Parameters:
stack
- The PoseStack to use with rendering. This is already centered on the page and rotated appropriately.data
- The book data being rendered.leftPage
- Whether this is rendering on the left page or the right.light
- Light value.bookPosRot
- The book's position and rotation.
-
getStartOffset
net.minecraft.world.phys.Vec3 getStartOffset(ClientBookData data, boolean leftPage, PosRot bookPosRot) Called to get the offset on the page to start rendering from. +X is towards the book center, +Y is towards the top of the page, and +Z is towards the player's face if they're looking directly at the book.
The coordinate system is described by example below. The rest should be pretty inferrable.- The center of the page is located at (0, 0, 0)
- (1, 0, 0) is the very center of the book
- (0, 1, 0) is the top-center of the page
- (0, 0, 1) is an arbitrary unit closer to the player's face.
- Parameters:
data
- The book data being rendered.leftPage
- Whether this is rendering on the left page or the right.bookPosRot
- The book's position and rotation.- Returns:
- The offset to use as described above.
-