use of org.valkyrienskies.mod.common.piloting.ControllerInputType in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class MixinMovementInputFromOptions method preUpdatePlayerMoveState.
@Inject(method = "updatePlayerMoveState", at = @At("HEAD"), cancellable = true)
public void preUpdatePlayerMoveState(CallbackInfo callbackInfo) {
IShipPilot pilot = (IShipPilot) Minecraft.getMinecraft().player;
if (pilot != null) {
ControllerInputType inputTypeEnum = pilot.getControllerInputEnum();
if (inputTypeEnum != null) {
if (inputTypeEnum.shouldLockPlayerMovement()) {
// Then don't let the player move anymore while it's piloting this bastard
zeroAllPlayerMovements();
callbackInfo.cancel();
}
}
}
}
Aggregations