Interface BuiltImmersiveInfo<E>
- All Superinterfaces:
ImmersiveInfo
- All Known Implementing Classes:
BuiltImmersiveInfoImpl
An implementation of
ImmersiveInfo
provided by ImmersiveMC that's used with Immersives built via
ImmersiveBuilder
. The hitboxIndex below always references the order in which hitboxes were added.-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStack
getItem
(int hitboxIndex) Get the item stored at the given hitbox index.boolean
isSlotHovered
(int hitboxIndex) Checks if the given hitbox is currently hovered by some hand or the mouse.void
setFakeItem
(int hitboxIndex, net.minecraft.world.item.ItemStack item) Sets an item into the provided hitbox only on the client-side.long
Methods inherited from interface com.hammy275.immersivemc.api.client.immersive.ImmersiveInfo
getAllHitboxes, getBlockPosition, getSlotHovered, getTicksExisted, hasHitboxes, setSlotHovered
-
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.
-