Class ImmersiveLever
java.lang.Object
com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
com.hammy275.immersivemc.client.immersive.ImmersiveLever
- 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractDragImmersive.AutoDragSettingsConfigures 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 ImmersiveConfigScreenInfoThe info needed to build a config screen button for this Immersive.protected voidhitboxDragged(DragImmersiveInfo info, int controller, int oldIndex, int newIndex) Called whenever a drag occurs from some old hitbox index to a new one.voidtick(DragImmersiveInfo info) This method is called once per game tick.Methods inherited from class com.hammy275.immersivemc.client.immersive.AbstractDragImmersive
getDragHitbox, getTrackedObjects, handleHitboxInteract, isInputHitbox, isVROnly, makeHitboxes, processStorageFromNetwork, render, shouldDisableRightClicksWhenVanillaInteractionsDisabled, shouldRenderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hammy275.immersivemc.api.client.immersive.Immersive
globalTick
-
Constructor Details
-
ImmersiveLever
public ImmersiveLever()
-
-
Method Details
-
hitboxDragged
Description copied from class:AbstractDragImmersiveCalled whenever a drag occurs from some old hitbox index to a new one. This is an ideal spot to updateDragImmersiveInfo.startingHitboxIndexif not auto-dragging.- Specified by:
hitboxDraggedin 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:AbstractDragImmersiveConfigures auto-dragging.- All integers in nonInteractable represent indexes into
DragImmersiveInfo.hitboxeswhich 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:
autoDragSettingsin classAbstractDragImmersive- Returns:
- Whether to use auto-dragging.
- All integers in nonInteractable represent indexes into
-
tick
Description copied from interface:ImmersiveThis method is called once per game tick. This is where you should, for example, recalculate hitboxes if needed.- Specified by:
tickin interfaceImmersive<DragImmersiveInfo,NullStorage> - Overrides:
tickin classAbstractDragImmersive- Parameters:
info- The info being ticked.
-
buildInfo
public DragImmersiveInfo buildInfo(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) Description copied from interface:ImmersiveConstructs 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.
-
getHandler
- Returns:
- The
ImmersiveHandlerthis Immersive uses.
-
configScreenInfo
Description copied from interface:ImmersiveThe 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.
-