Interface ImmersiveRenderState
- All Known Subinterfaces:
BuiltImmersiveRenderState<ER>
- All Known Implementing Classes:
AbstractImmersiveRenderState, BeaconRenderState, BuiltImmersiveRenderStateImpl, ChestRenderState, DragRenderState, LecternRenderState
public interface ImmersiveRenderState
State for rendering a
ImmersiveInfo. Unlike ImmersiveInfos, these classes only need to hold information
related to rendering.
Importantly, data in render states should be independent of data in the infos they come from, see
Immersive.extractRenderState(I, R, float) for more info.
-
Method Summary
Modifier and TypeMethodDescriptionhitboxes()Gets the list of all hitboxes for interaction, this interface's counterpart toImmersiveInfo.getAllHitboxes().booleanisSlotHovered(int slot) Gets whether the provided slot (index intohitboxes()) is currently hovered.longGets the amount of ticks the info this render state comes from has existed, this interface's counterpart toImmersiveInfo.getTicksExisted().
-
Method Details
-
hitboxes
List<BoundingBox> hitboxes()Gets the list of all hitboxes for interaction, this interface's counterpart toImmersiveInfo.getAllHitboxes(). Like its counterpart, the list can contain null elements.For Immersives that have hitboxes
- Returns:
- A list of all bounding boxes indexed by their slot number.
-
ticksExisted
long ticksExisted()Gets the amount of ticks the info this render state comes from has existed, this interface's counterpart toImmersiveInfo.getTicksExisted().- Returns:
- The amount of ticks the ImmersiveInfo this render state came from has existed.
-
isSlotHovered
boolean isSlotHovered(int slot) Gets whether the provided slot (index intohitboxes()) is currently hovered. This is similar toImmersiveInfo.getSlotHovered(int), but this function gets the slot and returns whether that slot is hovered, whereasImmersiveInfo.getSlotHovered(int)gets the hand index and returns the hovered slot.- Parameters:
slot- The slot/index intohitboxes()that is checked if it's hovered.- Returns:
- Whether the aforementioned slot is hovered.
-