Class ImmersiveHitboxesInfo
java.lang.Object
com.hammy275.immersivemc.client.immersive.info.ImmersiveHitboxesInfo
- All Implemented Interfaces:
ImmersiveInfo, PlayerAttachmentImmersiveInfo
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<? extends HitboxInfo> net.minecraft.client.player.AbstractClientPlayergetOwner()Get the player who owns/controls this PlayerAttachmentImmersiveInfo.intgetSlotHovered(int handIndex) longbooleanWhether this ImmersiveInfo contains valid hitboxes that are ready for use by users in-game.voidsetSlotHovered(int hitboxIndex, int handIndex) A notification to mark the given slot as hovered by the given hand index.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PlayerAttachmentImmersiveInfo
ownerIsLocalPlayer
-
Field Details
-
BAG_BACK_INDEX
public static final int BAG_BACK_INDEX- See Also:
-
hitboxes
-
canOpen
public boolean canOpen -
slotHovered
public int slotHovered -
tickCount
public long tickCount
-
-
Constructor Details
-
ImmersiveHitboxesInfo
public ImmersiveHitboxesInfo()
-
-
Method Details
-
getOwner
public net.minecraft.client.player.AbstractClientPlayer getOwner()Description copied from interface:PlayerAttachmentImmersiveInfoGet the player who owns/controls this PlayerAttachmentImmersiveInfo.- Specified by:
getOwnerin interfacePlayerAttachmentImmersiveInfo- Returns:
- The player as described.
-
getAllHitboxes
- Specified by:
getAllHitboxesin interfaceImmersiveInfo- Returns:
- The list of all hitboxes this Immersive uses. This can contain null elements, and can return an immutable list implementation if desired.
-
hasHitboxes
public boolean hasHitboxes()Description copied from interface:ImmersiveInfoWhether this ImmersiveInfo contains valid hitboxes that are ready for use by users in-game.ImmersiveInfo.getAllHitboxes()will not be called if this method returns false for a given tick.- Specified by:
hasHitboxesin interfaceImmersiveInfo- Returns:
- Whether
ImmersiveInfo.getAllHitboxes()can be safely called and contains expected data.
-
setSlotHovered
public void setSlotHovered(int hitboxIndex, int handIndex) Description copied from interface:ImmersiveInfoA notification to mark the given slot as hovered by the given hand index.- Specified by:
setSlotHoveredin interfaceImmersiveInfo- Parameters:
hitboxIndex- The index intoImmersiveInfo.getAllHitboxes()to mark as hovered, or -1 to indicate no slot is hovered by this hand.handIndex- 0 for the primary hand (primary controller in VR or the player hand in non-VR), and 1 for the secondary hand (secondary controller in VR, or nothing in non-VR).
-
getSlotHovered
public int getSlotHovered(int handIndex) - Specified by:
getSlotHoveredin interfaceImmersiveInfo- Parameters:
handIndex- The hand that is checking for a hovered hitbox.- Returns:
- The hitbox the handIndex is hovering, or -1 if it isn't hovering any slot.
-
getTicksExisted
public long getTicksExisted()- Specified by:
getTicksExistedin interfaceImmersiveInfo- Returns:
- The number of ticks this info has existed for.
-