Interface BuiltBlockBasedImmersiveInfo<E>

All Superinterfaces:
BlockBasedImmersiveInfo, ImmersiveInfo
All Known Implementing Classes:
BuiltBlockBasedImmersiveInfoImpl

public interface BuiltBlockBasedImmersiveInfo<E> extends BlockBasedImmersiveInfo
An implementation of BlockBasedImmersiveInfo provided by ImmersiveMC that's used with Immersives built via BlockBasedImmersiveBuilder. The hitboxIndex below always references the order in which hitboxes were added.

Do not implement this interface yourself! Instead, implement BlockBasedImmersiveInfo directly.

  • Method Details

    • ticksExisted

      long ticksExisted()
      Returns:
      The number of times this Immersive has ticked.
    • getExtraData

      E getExtraData()
      Returns:
      The extra data instance attached to this info.
    • getItem

      net.minecraft.world.item.ItemStack getItem(int hitboxIndex)
      Get the item stored at the given hitbox index. The item returned is an empty stack if the hitbox does not contain an item.
      Parameters:
      hitboxIndex - The hitbox index to get the item from.
      Returns:
      The item in that hitbox.
    • setFakeItem

      void setFakeItem(int hitboxIndex, net.minecraft.world.item.ItemStack item)
      Sets an item into the provided hitbox only on the client-side. A network sync may overwrite this data!
      Parameters:
      hitboxIndex - The index to set an item in.
      item - The item to set.
    • isSlotHovered

      boolean isSlotHovered(int hitboxIndex)
      Checks if the given hitbox is currently hovered by some hand or the mouse.
      Parameters:
      hitboxIndex - The hitbox index to check if hovered.
      Returns:
      Whether the given hitboxIndex is hovered.