Class ImmersiveRepeater
java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
com.hammy275.immersivemc.client.immersive.ImmersiveRepeater
- All Implemented Interfaces:
Immersive<DragImmersiveInfo,
NullStorage>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
AbstractDragImmersive.AutoDragSettings
-
Field Summary
Fields inherited from class com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
trackedObjects
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractDragImmersive.AutoDragSettings
Configures auto-dragging.buildInfo
(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) Constructs a new ImmersiveInfo based on the provided block position.@Nullable ImmersiveConfigScreenInfo
The info needed to build a config screen button for this Immersive.protected void
hitboxDragged
(DragImmersiveInfo info, int controller, int oldIndex, int newIndex) Called whenever a drag occurs from some old hitbox index to a new one.protected void
makeHitboxes
(DragImmersiveInfo info, net.minecraft.world.level.Level level) Add/set hitboxes into the info instance.void
tick
(DragImmersiveInfo info) This method is called once per game tick.Methods inherited from class com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
getTrackedObjects, handleHitboxInteract, isVROnly, processStorageFromNetwork, render, shouldDisableRightClicksWhenVanillaInteractionsDisabled, shouldRender
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.hammy275.immersivemc.api.client.immersive.Immersive
globalTick
-
Constructor Details
-
ImmersiveRepeater
public ImmersiveRepeater()
-
-
Method Details
-
hitboxDragged
Description copied from class:AbstractDragImmersive
Called whenever a drag occurs from some old hitbox index to a new one. This is an ideal spot to updateDragImmersiveInfo.startingHitboxIndex
if not auto-dragging.- Specified by:
hitboxDragged
in classAbstractDragImmersive
- Parameters:
info
- Info with dragging happening.controller
- Controller number that is dragging.oldIndex
- Old hitbox index. This will be -1 if starting a drag from "anywhere".newIndex
- New hitbox index. This will never be -1.
-
autoDragSettings
Description copied from class:AbstractDragImmersive
Configures auto-dragging.- All integers in nonInteractable represent indexes into
DragImmersiveInfo.hitboxes
which will count for dragging but will never be passed toAbstractDragImmersive.hitboxDragged(DragImmersiveInfo, int, int, int)
as either the old or new index. This is mainly intended for when you want to allow dragging between some hitboxes, but need an outer hitbox that keeps the dragging going; this function should return the index for that outer hitbox. - makeHitboxesEveryTick determines whether
AbstractDragImmersive.makeHitboxes(DragImmersiveInfo, Level)
is called every tick.
- Specified by:
autoDragSettings
in classAbstractDragImmersive
- Returns:
- Whether to use auto-dragging.
- All integers in nonInteractable represent indexes into
-
tick
Description copied from interface:Immersive
This method is called once per game tick. This is where you should, for example, recalculate hitboxes if needed.- Specified by:
tick
in interfaceImmersive<DragImmersiveInfo,
NullStorage> - Overrides:
tick
in classAbstractDragImmersive
- Parameters:
info
- The info being ticked.
-
getHandler
- Returns:
- The
ImmersiveHandler
this Immersive uses.
-
makeHitboxes
Description copied from class:AbstractDragImmersive
Add/set hitboxes into the info instance. Called automatically on each tick ifAbstractDragImmersive.AutoDragSettings.makeHitboxesEveryTick
is true. Otherwise, it's not called.- Overrides:
makeHitboxes
in classAbstractDragImmersive
- Parameters:
info
- Info to set hitboxes into.level
- The current level.
-
buildInfo
public DragImmersiveInfo buildInfo(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) Description copied from interface:Immersive
Constructs a new ImmersiveInfo based on the provided block position. It's best to calculate initial hitboxes, etc. in this method to make the Immersive available for interaction as soon as possible.- Parameters:
pos
- The position of a block that matches this Immersive.level
- The level in which this info is being built.- Returns:
- An instance of an ImmersiveInfo implementation with the same position as provided.
-
configScreenInfo
Description copied from interface:Immersive
The info needed to build a config screen button for this Immersive. If this method returns null, ImmersiveMC will not add a setting for this Immersive to its in-game configuration. Reasons to possibly return null from this method include, but are not limited to:- This Immersive cannot be controlled via a config.
- Another mod already handles configuring this Immersive.
- Returns:
- An ImmersiveConfigScreenInfo instance used for ImmersiveMC to add this Immersive to its in-game configuration screens, or null if ImmersiveMC should not do so.
-