Package dev.boze.api.utility.interaction
Class Interaction
java.lang.Object
dev.boze.api.utility.interaction.Interaction
Interaction represents a client to server interaction that may require rotation
-
Constructor Summary
ConstructorsConstructorDescriptionInteraction(Runnable action) Creates an interaction that doesn't require rotationInteraction(Runnable action, boolean rotate, float yaw, float pitch) Creates an interaction that requires specific rotationInteraction(Runnable action, float yaw, float pitch) Creates an interaction that requires specific rotation -
Method Summary
-
Constructor Details
-
Interaction
Creates an interaction that doesn't require rotation- Parameters:
action- The action to run
-
Interaction
Creates an interaction that requires specific rotation- Parameters:
action- The action to runyaw- The yaw rotation requiredpitch- The pitch rotation required
-
Interaction
Creates an interaction that requires specific rotation- Parameters:
action- The action to runrotate- Whether to rotate or notyaw- The yaw rotation requiredpitch- The pitch rotation required
-
-
Method Details
-
shouldRotate
public boolean shouldRotate()Returns whether this interaction requires rotation- Returns:
- true if rotation is required, false otherwise
-
getYaw
public float getYaw()Gets the yaw rotation- Returns:
- The yaw rotation
-
getPitch
public float getPitch()Gets the pitch rotation- Returns:
- The pitch rotation
-
run
public void run()Runs the interaction action
-