java.lang.Object
com.hammy275.immersivemc.common.immersive.storage.network.impl.BookData
All Implemented Interfaces:
NetworkStorage, WorldStorage
Direct Known Subclasses:
ClientBookData

public class BookData extends Object implements NetworkStorage, WorldStorage
  • Field Details

    • scaleSize

      public static final float scaleSize
      See Also:
    • singlePageWidth

      public static final double singlePageWidth
      See Also:
    • pageHalfHeight

      public static final double pageHalfHeight
      See Also:
    • textStackScaleSize

      public static final float textStackScaleSize
      See Also:
    • textUpAmount

      public static final double textUpAmount
      See Also:
    • textInteractDistanceSqr

      public static final double textInteractDistanceSqr
      See Also:
    • pageTilt

      public static final float pageTilt
      See Also:
    • linesPerPage

      public static final int linesPerPage
      See Also:
    • pixelsPerLine

      public static final int pixelsPerLine
      See Also:
    • leftPageRot

      public static final double leftPageRot
    • book

      public net.minecraft.world.item.ItemStack book
    • leftPageIndex

      public int leftPageIndex
    • pageChangeState

      public PageChangeState pageChangeState
    • leftPageTurn

      public float leftPageTurn
    • rightPageTurn

      public float rightPageTurn
    • pageTurner

      public transient net.minecraft.world.entity.player.Player pageTurner
    • pageTurnerIndex

      public transient int pageTurnerIndex
    • pageTurnBoxes

      public transient OBB[] pageTurnBoxes
    • positions

      public transient net.minecraft.world.phys.Vec3[] positions
    • lecternPosRot

      public transient PosRot lecternPosRot
    • authoritative

      public transient boolean authoritative
    • pos

      public transient net.minecraft.core.BlockPos pos
  • Constructor Details

    • BookData

      public BookData()
    • BookData

      public BookData(boolean authoritative)
  • Method Details

    • setPage

      public void setPage(int newPageIndex)
    • nextPage

      public void nextPage()
    • lastPage

      public void lastPage()
    • isDirty

      public boolean isDirty()
    • setDirty

      public void setDirty()
    • markNoLongerDirty

      public void markNoLongerDirty()
    • lecternPlayerTick

      public void lecternPlayerTick(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos)
    • lecternServerTick

      public void lecternServerTick()
    • tick

      public void tick(PosRot hand, PosRot... others)
    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: NetworkStorage
      Encode this storage into a buffer.
      Specified by:
      encode in interface NetworkStorage
      Parameters:
      buffer - Buffer to encode storage into.
    • decode

      public void decode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: NetworkStorage
      Decode the buffer into this object.
      Specified by:
      decode in interface NetworkStorage
      Parameters:
      buffer - Buffer to decode from.
    • startPageTurn

      public void startPageTurn(PageChangeState state, int handIndex)
    • startPageTurnAnim

      public void startPageTurnAnim(net.minecraft.world.entity.player.Player pageTurner, boolean isNextPage)
    • maybeConvertToNonVR

      protected void maybeConvertToNonVR()
    • maxLeftPageIndex

      protected int maxLeftPageIndex()
    • getPageCount

      protected int getPageCount()
    • getLeftRight

      protected net.minecraft.world.phys.Vec3 getLeftRight(PosRot hand, boolean left)
    • getAway

      protected net.minecraft.world.phys.Vec3 getAway(PosRot hand)
      Parameters:
      hand - Hand data
      Returns:
      The vector pointing away from the book. This is the opposite of the look vector of an HMD looking directly at the book.
    • resetTurnState

      protected void resetTurnState()
    • possiblyBeginPageTurn

      protected boolean possiblyBeginPageTurn(net.minecraft.world.phys.Vec3 handPos, OBB startBox)
    • onFirstPage

      public boolean onFirstPage()
    • onLastPage

      public boolean onLastPage()
    • getLeftPageIndex

      public int getLeftPageIndex()
    • getRightPageIndex

      public int getRightPageIndex()
    • load

      public void load(net.minecraft.nbt.CompoundTag nbt, int lastVanillaDataVersion)
      Description copied from interface: WorldStorage
      Load from the NBT tag into this object.
      Specified by:
      load in interface WorldStorage
      Parameters:
      nbt - NBT tag to load from.
      lastVanillaDataVersion - The last vanilla data version this storage was loaded in.
    • save

      public net.minecraft.nbt.CompoundTag save(net.minecraft.nbt.CompoundTag nbt)
      Description copied from interface: WorldStorage
      Save this object into the NBT tag.
      Specified by:
      save in interface WorldStorage
      Parameters:
      nbt - NBT tag to save to.
      Returns:
      The same NBT tag as provided to this method.
    • getHandler

      public WorldStorageHandler<? extends NetworkStorage> getHandler()
      Specified by:
      getHandler in interface WorldStorage
      Returns:
      Handler for this type of WorldStorage.