Interface HitboxVRMovementInfoBuilder
- All Known Implementing Classes:
HitboxVRMovementInfoBuilderImpl
public interface HitboxVRMovementInfoBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The controllers to detect for passing the threshold for movement. -
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.static HitboxVRMovementInfoBuilder
create()
Starts creation of aHitboxVRMovementInfo
.threshold
(double threshold) Sets the amount of distance that should be covered within a game tick for the movement to have succeeded.
-
Method Details
-
create
Starts creation of aHitboxVRMovementInfo
.- Returns:
- A builder object to begin creation.
-
axis
Sets the axis of movement for the HitboxVRMovementInfo.- Parameters:
axis
- The axis of movement to detect motion on, or null to detect on all axes combined.- Returns:
- Builder object.
-
threshold
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.- Parameters:
threshold
- Threshold of movement.- Returns:
- Builder object.
-
controllerMode
HitboxVRMovementInfoBuilder controllerMode(HitboxVRMovementInfoBuilder.ControllerMode controllerMode) Sets which controllers are detected for meeting the threshold of movement.- Parameters:
controllerMode
- Which controller(s) should be watched for meeting the movement threshold.- Returns:
- Builder object.
-
actionConsumer
HitboxVRMovementInfoBuilder actionConsumer(BiConsumer<BuiltImmersiveInfo<?>, List<net.minecraft.world.InteractionHand>> actionConsumer) Sets a callback to run when the threshold is met.- 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
HitboxVRMovementInfo build()Builds this builder into aHitboxVRMovementInfo
.- Returns:
- The built HitboxVRMovementInfo.
-