Class HitboxVRMovementInfoBuilderImpl
java.lang.Object
com.hammy275.immersivemc.client.immersive.HitboxVRMovementInfoBuilderImpl
- All Implemented Interfaces:
HitboxVRMovementInfoBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.hammy275.immersivemc.api.client.immersive.HitboxVRMovementInfoBuilder
HitboxVRMovementInfoBuilder.ControllerMode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactionConsumer
(BiConsumer<BuiltImmersiveInfo<?>, List<net.minecraft.world.InteractionHand>> actionConsumer) Sets a callback to run when the threshold is met.axis
(net.minecraft.core.Direction.Axis axis) Sets the axis of movement for the HitboxVRMovementInfo.build()
Builds this builder into aHitboxVRMovementInfo
.controllerMode
(HitboxVRMovementInfoBuilder.ControllerMode controllerMode) Sets which controllers are detected for meeting the threshold of movement.threshold
(double threshold) Sets the amount of distance that should be covered within a game tick for the movement to have succeeded.
-
Constructor Details
-
HitboxVRMovementInfoBuilderImpl
public HitboxVRMovementInfoBuilderImpl()
-
-
Method Details
-
axis
Description copied from interface:HitboxVRMovementInfoBuilder
Sets the axis of movement for the HitboxVRMovementInfo.- Specified by:
axis
in interfaceHitboxVRMovementInfoBuilder
- Parameters:
axis
- The axis of movement to detect motion on, or null to detect on all axes combined.- Returns:
- Builder object.
-
threshold
Description copied from interface:HitboxVRMovementInfoBuilder
Sets the amount of distance that should be covered within a game tick for the movement to have succeeded.
One positive and one negative threshold can be set. Future sets will override the value already there. For example, setting the thresholds 0.03, -0.02, and 0.02, will have the thresholds for movement detection be 0.02 positive movement and 0.02 negative movement.
Setting a threshold of 0 will clear both the positive and negative thresholds.- Specified by:
threshold
in interfaceHitboxVRMovementInfoBuilder
- Parameters:
threshold
- Threshold of movement.- Returns:
- Builder object.
-
controllerMode
public HitboxVRMovementInfoBuilder controllerMode(HitboxVRMovementInfoBuilder.ControllerMode controllerMode) Description copied from interface:HitboxVRMovementInfoBuilder
Sets which controllers are detected for meeting the threshold of movement.- Specified by:
controllerMode
in interfaceHitboxVRMovementInfoBuilder
- Parameters:
controllerMode
- Which controller(s) should be watched for meeting the movement threshold.- Returns:
- Builder object.
-
actionConsumer
public HitboxVRMovementInfoBuilder actionConsumer(BiConsumer<BuiltImmersiveInfo<?>, List<net.minecraft.world.InteractionHand>> actionConsumer) Description copied from interface:HitboxVRMovementInfoBuilder
Sets a callback to run when the threshold is met.- Specified by:
actionConsumer
in interfaceHitboxVRMovementInfoBuilder
- Parameters:
actionConsumer
- The callback to run when the threshold is met, taking the info and the hand(s) that met the threshold.- Returns:
- Builder object.
-
build
Description copied from interface:HitboxVRMovementInfoBuilder
Builds this builder into aHitboxVRMovementInfo
.- Specified by:
build
in interfaceHitboxVRMovementInfoBuilder
- Returns:
- The built HitboxVRMovementInfo.
-