1
0
forked from Clones/Controlify

lots of API docs and fix sources jar

This commit is contained in:
isXander
2023-04-15 13:12:45 +01:00
parent 2c08d5f15c
commit 8eb8510590
16 changed files with 233 additions and 59 deletions

View File

@ -21,7 +21,22 @@ public final class ControlifyEvents {
/**
* Triggers every tick when the current controller state has been updated.
*/
public static final Event<ControllerStateUpdate> CONTROLLER_STATE_UPDATED = EventFactory.createArrayBacked(ControllerStateUpdate.class, callbacks -> controller -> {
public static final Event<ControllerStateUpdate> ACTIVE_CONTROLLER_TICKED = EventFactory.createArrayBacked(ControllerStateUpdate.class, callbacks -> controller -> {
for (ControllerStateUpdate callback : callbacks) {
callback.onControllerStateUpdate(controller);
}
});
/**
* @deprecated Use {@link #ACTIVE_CONTROLLER_TICKED} instead.
*/
@Deprecated
public static final Event<ControllerStateUpdate> CONTROLLER_STATE_UPDATED = ACTIVE_CONTROLLER_TICKED;
/**
* Triggers every tick when any connected controller's state has been updated before the active controller is ticked.
*/
public static final Event<ControllerStateUpdate> CONTROLLER_STATE_UPDATE = EventFactory.createArrayBacked(ControllerStateUpdate.class, callbacks -> controller -> {
for (ControllerStateUpdate callback : callbacks) {
callback.onControllerStateUpdate(controller);
}
@ -45,6 +60,10 @@ public final class ControlifyEvents {
}
});
/**
* Allows you to modify the look input before it is applied to the player.
* These modifiers are called before the look input is multiplied by the sensitivity.
*/
public static final Event<LookInputModifier> LOOK_INPUT_MODIFIER = EventFactory.createArrayBacked(LookInputModifier.class, callbacks -> new LookInputModifier() {
@Override
public float modifyX(float x, Controller<?, ?> controller) {