diff --git a/src/main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRThrustHandler.java b/src/main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRThrustHandler.java index 9d111c4..783d3b0 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRThrustHandler.java +++ b/src/main/java/ru/octol1ttle/flightassistant/compatibility/doabarrelroll/DaBRThrustHandler.java @@ -23,10 +23,15 @@ public DaBRThrustHandler() { } @Override - public boolean canBeUsed() { + public boolean available() { return ModConfig.INSTANCE.getEnableThrust(); } + @Override + public boolean isFireworkLike() { + return true; + } + @Override public void reset() { } diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/ComputerHost.java b/src/main/java/ru/octol1ttle/flightassistant/computers/ComputerHost.java index e4ae943..f9300ed 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/ComputerHost.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/ComputerHost.java @@ -25,7 +25,7 @@ import ru.octol1ttle.flightassistant.computers.impl.safety.StallComputer; import ru.octol1ttle.flightassistant.computers.impl.safety.VoidLevelComputer; import ru.octol1ttle.flightassistant.registries.ComputerRegistry; -import ru.octol1ttle.flightassistant.registries.events.CustomComputerRegistrationCallback; +import ru.octol1ttle.flightassistant.registries.events.RegisterCustomComputersCallback; public class ComputerHost { public static ComputerHost instance() { @@ -36,7 +36,6 @@ public ComputerHost(@NotNull MinecraftClient mc) { ComputerRegistry.register(new AirDataComputer(mc)); ComputerRegistry.register(new TimeComputer(mc)); - ComputerRegistry.register(new FireworkController(mc)); ComputerRegistry.register(new PitchLimitComputer()); ComputerRegistry.register(new FlightProtectionsComputer()); ComputerRegistry.register(new ChunkStatusComputer()); @@ -54,9 +53,11 @@ public ComputerHost(@NotNull MinecraftClient mc) { ComputerRegistry.register(new HeadingController()); ComputerRegistry.register(new RollController()); + ComputerRegistry.register(new FireworkController(mc)); + ComputerRegistry.register(new AlertController(mc.getSoundManager())); - CustomComputerRegistrationCallback.EVENT.invoker().registerCustomComputers(); + RegisterCustomComputersCallback.EVENT.invoker().registerCustomComputers(); } public void tick() { diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/api/IThrustHandler.java b/src/main/java/ru/octol1ttle/flightassistant/computers/api/IThrustHandler.java index 64b6a07..0ad5a37 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/api/IThrustHandler.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/api/IThrustHandler.java @@ -3,10 +3,15 @@ import ru.octol1ttle.flightassistant.computers.impl.autoflight.ThrustController; /** - * Implementing classes should inject ThrustController and use {@link ThrustController#currentThrust} and {@link ThrustController#targetThrust} themselves as needed. + * Implementing classes should inject ThrustController and use {@link ThrustController#currentThrust} and {@link ThrustController#targetThrust} in {@link IThrustHandler#tickThrust()}. * Implementing this interface is required to resolve any conflicts between multiple thrust handlers. * In case of multiple thrust handlers being present, only the first one is registered */ public interface IThrustHandler extends IComputer { - boolean canBeUsed(); + default void tickThrust() { + } + + boolean available(); + + boolean isFireworkLike(); } diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/FlightPhaseComputer.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/FlightPhaseComputer.java index 8f24429..ee57259 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/FlightPhaseComputer.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/FlightPhaseComputer.java @@ -10,67 +10,67 @@ public class FlightPhaseComputer implements ITickableComputer { private final AirDataComputer data = ComputerRegistry.resolve(AirDataComputer.class); private final AutoFlightController autoflight = ComputerRegistry.resolve(AutoFlightController.class); private final FlightPlanner plan = ComputerRegistry.resolve(FlightPlanner.class); - public FlightPhase phase = FlightPhase.UNKNOWN; + public Phase phase = Phase.UNKNOWN; @SuppressWarnings("DataFlowIssue") @Override public void tick() { if (data.player().isOnGround()) { - phase = FlightPhase.ON_GROUND; + phase = Phase.ON_GROUND; } if (!data.isFlying()) { return; } - if (phase == FlightPhase.ON_GROUND) { - phase = FlightPhase.TAKEOFF; + if (phase == Phase.ON_GROUND) { + phase = Phase.TAKEOFF; } - if (phase == FlightPhase.TAKEOFF && data.heightAboveGround() <= 10.0f) { + if (phase == Phase.TAKEOFF && data.heightAboveGround() <= 15.0f) { return; } Integer cruiseAltitude = plan.getCruiseAltitude(); Integer targetAltitude = autoflight.getTargetAltitude(); if (cruiseAltitude == null || targetAltitude == null) { - phase = FlightPhase.UNKNOWN; + phase = Phase.UNKNOWN; return; } if (!isNearDestination()) { if (data.altitude() - targetAltitude <= 5.0f) { - phase = FlightPhase.CLIMB; + phase = Phase.CLIMB; } else { - phase = FlightPhase.DESCENT; + phase = Phase.DESCENT; } if (targetAltitude.equals(cruiseAltitude) && Math.abs(cruiseAltitude - data.altitude()) <= 5.0f) { - phase = FlightPhase.CRUISE; + phase = Phase.CRUISE; } } - if (phase == FlightPhase.GO_AROUND) { + if (phase == Phase.GO_AROUND) { if (plan.getDistanceToWaypoint() > 150.0f) { - phase = FlightPhase.APPROACH; + phase = Phase.APPROACH; } } else { if (plan.isOnApproach()) { - phase = FlightPhase.APPROACH; + phase = Phase.APPROACH; } - if (phase == FlightPhase.APPROACH && plan.autolandAllowed) { - phase = FlightPhase.LAND; + if (phase == Phase.APPROACH && plan.autolandAllowed) { + phase = Phase.LAND; } } } private boolean isAboutToLand() { - return phase == FlightPhase.APPROACH || phase == FlightPhase.LAND; + return phase == Phase.APPROACH || phase == Phase.LAND; } public boolean isNearDestination() { - return isAboutToLand() || phase == FlightPhase.GO_AROUND; + return isAboutToLand() || phase == Phase.GO_AROUND; } @Override @@ -80,10 +80,10 @@ public String getId() { @Override public void reset() { - phase = FlightPhase.UNKNOWN; + phase = Phase.UNKNOWN; } - public enum FlightPhase { + public enum Phase { ON_GROUND("on_ground"), TAKEOFF("takeoff"), CLIMB("climb"), @@ -96,11 +96,11 @@ public enum FlightPhase { public final Text text; - FlightPhase(Text text) { + Phase(Text text) { this.text = text; } - FlightPhase(String key) { + Phase(String key) { this(Text.translatable("status.flightassistant.phase." + key)); } } diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/AutopilotComputer.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/AutopilotComputer.java index ffe193f..620ffb1 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/AutopilotComputer.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/AutopilotComputer.java @@ -2,7 +2,6 @@ import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; -import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.Nullable; import org.joml.Vector2d; import ru.octol1ttle.flightassistant.FAMathHelper; @@ -17,45 +16,102 @@ import ru.octol1ttle.flightassistant.computers.api.ThrustControlInput; import ru.octol1ttle.flightassistant.computers.impl.AirDataComputer; import ru.octol1ttle.flightassistant.computers.impl.FlightPhaseComputer; +import ru.octol1ttle.flightassistant.computers.impl.FlightPhaseComputer.Phase; import ru.octol1ttle.flightassistant.computers.impl.navigation.FlightPlanner; import ru.octol1ttle.flightassistant.registries.ComputerRegistry; public class AutopilotComputer implements ITickableComputer, IAutopilotProvider, IPitchController, IHeadingController, IRollController, IThrustController { + private static final float THRUST_CLIMB = 0.9f; + private static final float THRUST_CLIMB_REDUCED = 0.75f; + private final AirDataComputer data = ComputerRegistry.resolve(AirDataComputer.class); private final AutoFlightController autoflight = ComputerRegistry.resolve(AutoFlightController.class); private final FlightPhaseComputer phase = ComputerRegistry.resolve(FlightPhaseComputer.class); private final FlightPlanner plan = ComputerRegistry.resolve(FlightPlanner.class); private final ThrustController thrust = ComputerRegistry.resolve(ThrustController.class); + public Text verticalMode; public Text lateralMode; public Text thrustMode; + private Float targetPitch; private Float targetHeading; private Float targetThrust; + private Float togaHeading; + @Override public void tick() { - if (phase.phase == FlightPhaseComputer.FlightPhase.TAKEOFF - || phase.phase == FlightPhaseComputer.FlightPhase.GO_AROUND && data.heightAboveGround() < 15.0f) { + if (phase.phase == Phase.TAKEOFF + || phase.phase == Phase.GO_AROUND && data.heightAboveGround() < 15.0f) { + if (togaHeading == null) { + togaHeading = data.heading(); + } + setTargetThrust(1.0f, Text.translatable("mode.flightassistant.thrust.toga")); - setTargetPitch(PitchController.CLIMB_PITCH, Text.translatable("mode.flightassistant.vert.climb.optimum")); - setTargetHeading(data.heading(), Text.translatable("mode.flightassistant.lat.current")); + setTargetPitch(55.0f, Text.translatable("mode.flightassistant.vert.climb.optimum")); + + String lat = phase.phase == Phase.TAKEOFF ? ".takeoff" : ".go_around"; + setTargetHeading(togaHeading, Text.translatable("mode.flightassistant.lat" + lat, togaHeading.intValue())); return; } + togaHeading = null; + setTargetHeading(null, Text.empty()); tickLateral(); + Integer targetSpeed = autoflight.getTargetSpeed(); + setTargetThrust(null, Text.empty()); + + setTargetPitch(null, Text.empty()); Integer targetAltitude = autoflight.getTargetAltitude(); if (targetAltitude == null) { - targetPitch = null; - targetThrust = null; return; } - boolean useThrustConservatively = thrust.thrustHandler instanceof FireworkController || !thrust.thrustHandler.canBeUsed(); - // TODO - throw new NotImplementedException(); + float diff = targetAltitude - data.altitude(); + + boolean useReducedThrust = thrust.getThrustHandler().isFireworkLike(); // I wish I didn't have to account for this + float climbThrust = useReducedThrust ? THRUST_CLIMB_REDUCED : THRUST_CLIMB; + String thrustSuffix = useReducedThrust ? "_reduced" : ""; + + if (autoflight.selectedAltitude != null) { + float speedAdjustment = targetSpeed != null ? data.speed() - targetSpeed : 0.0f; + if (targetAltitude >= data.altitude()) { + setTargetThrust(climbThrust, Text.translatable("mode.flightassistant.thrust.climb" + thrustSuffix)); + float pitch; + if (useReducedThrust) { + pitch = 47.5f - 47.5f * (Math.max(20.0f - diff, 0.0f) / 15.0f) + 7.5f; + } else { + pitch = 55.0f - 55.0f * (Math.max(15.0f - diff, 0.0f) / 15.0f) + speedAdjustment; + } + setTargetPitch(pitch, Text.translatable("mode.flightassistant.vert.climb.selected")); + } else { + setTargetThrust(climbThrust, Text.translatable("mode.flightassistant.thrust.descend" + thrustSuffix)); + } + } + + if (targetAltitude > data.altitude()) { + + } + + // overwrite any thrust setting if we have a target speed + tickSpeed(targetSpeed); + } + + private void tickSpeed(Integer targetSpeed) { + if (targetSpeed == null) { + return; + } + + float diff = Math.abs(targetSpeed - data.speed()); + + float thr = targetSpeed > data.speed() ? THRUST_CLIMB : -0.5f; + if (thrust.getThrustHandler().isFireworkLike()) { + thr = targetSpeed / FireworkController.FIREWORK_SPEED; + } + setTargetThrust(thr * Math.min(diff * 0.1f, 1.0f), Text.translatable("mode.flightassistant.thrust.speed.selected", targetSpeed)); } private void tickLateral() { @@ -75,7 +131,7 @@ private Float computeTargetPitch() { Vector2d planPos = plan.getTargetPosition(); float diff = targetAltitude - data.altitude(); - boolean landing = phase.phase == FlightPhaseComputer.FlightPhase.LAND; + boolean landing = phase.phase == Phase.LAND; if (!landing && diff > -10.0f && diff < 5.0f) { return (PitchController.GLIDE_PITCH + PitchController.ALTITUDE_PRESERVE_PITCH) * 0.5f; } @@ -188,16 +244,19 @@ public ThrustControlInput getThrustInput() { @Override public String getId() { - return "autopilot_ctl"; + return "autopilot"; } @Override public void reset() { - targetPitch = null; verticalMode = null; - targetHeading = null; lateralMode = null; + thrustMode = null; + + targetPitch = null; + targetHeading = null; targetThrust = null; + togaHeading = null; autoflight.disconnectAutoFirework(true); autoflight.disconnectAutopilot(true); diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/FireworkController.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/FireworkController.java index 2ea8ab6..283d50a 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/FireworkController.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/FireworkController.java @@ -55,12 +55,12 @@ public void tick() { i++; } + } - - if (thrust.thrustHandler == this || !thrust.thrustHandler.canBeUsed()) { - if (data.speed() / FIREWORK_SPEED < thrust.currentThrust) { - activateFirework(false); - } + @Override + public void tickThrust() { + if (data.speed() / FIREWORK_SPEED < thrust.currentThrust) { + activateFirework(false); } } @@ -140,10 +140,15 @@ public boolean isFireworkSafe(ItemStack stack) { } @Override - public boolean canBeUsed() { + public boolean available() { return true; } + @Override + public boolean isFireworkLike() { + return false; + } + @Override public String getId() { return "frwk_ctl"; diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/HeadingController.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/HeadingController.java index ebe2610..ec52779 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/HeadingController.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/HeadingController.java @@ -15,11 +15,11 @@ import ru.octol1ttle.flightassistant.registries.events.AllowComputerRegisterCallback; public class HeadingController implements ITickableComputer, IAutopilotProvider { + private static final List controllers = new ArrayList<>(); private final AirDataComputer data = ComputerRegistry.resolve(AirDataComputer.class); private final TimeComputer time = ComputerRegistry.resolve(TimeComputer.class); - private final List controllers = new ArrayList<>(); - public HeadingController() { + static { AllowComputerRegisterCallback.EVENT.register((computer -> { if (computer instanceof IHeadingController controller) { controllers.add(controller); diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/PitchController.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/PitchController.java index a644dfa..ed50c71 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/PitchController.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/PitchController.java @@ -20,12 +20,12 @@ public class PitchController implements ITickableComputer, INormalLawProvider { public static final float ALTITUDE_PRESERVE_PITCH = 15.0f; public static final float GLIDE_PITCH = -2.2f; public static final float DESCEND_PITCH = -35.0f; - private final List controllers = new ArrayList<>(); + private static final List controllers = new ArrayList<>(); private final AirDataComputer data = ComputerRegistry.resolve(AirDataComputer.class); private final TimeComputer time = ComputerRegistry.resolve(TimeComputer.class); private final PitchLimitComputer limit = ComputerRegistry.resolve(PitchLimitComputer.class); - public PitchController() { + static { AllowComputerRegisterCallback.EVENT.register((computer -> { if (computer instanceof IPitchController controller) { controllers.add(controller); diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/RollController.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/RollController.java index 3d8628e..eee3232 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/RollController.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/RollController.java @@ -18,16 +18,16 @@ import ru.octol1ttle.flightassistant.computers.impl.TimeComputer; import ru.octol1ttle.flightassistant.registries.ComputerRegistry; import ru.octol1ttle.flightassistant.registries.events.AllowComputerRegisterCallback; -import ru.octol1ttle.flightassistant.registries.events.CustomComputerRegistrationCallback; +import ru.octol1ttle.flightassistant.registries.events.RegisterCustomComputersCallback; public class RollController implements ITickableComputer, INormalLawProvider { - private final List controllers = new ArrayList<>(); + private static final List controllers = new ArrayList<>(); + private static @Nullable IRollHandler rollHandler = null; private final AirDataComputer data = ComputerRegistry.resolve(AirDataComputer.class); private final TimeComputer time = ComputerRegistry.resolve(TimeComputer.class); - private @Nullable IRollHandler rollHandler = null; - public RollController() { - CustomComputerRegistrationCallback.EVENT.register(() -> { + static { + RegisterCustomComputersCallback.EVENT.register(() -> { if (FabricLoader.getInstance().isModLoaded("do_a_barrel_roll")) { ComputerRegistry.register(new DaBRRollHandler()); } diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/ThrustController.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/ThrustController.java index db88877..a2a0265 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/ThrustController.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/autoflight/ThrustController.java @@ -16,18 +16,19 @@ import ru.octol1ttle.flightassistant.config.FAConfig; import ru.octol1ttle.flightassistant.registries.ComputerRegistry; import ru.octol1ttle.flightassistant.registries.events.AllowComputerRegisterCallback; -import ru.octol1ttle.flightassistant.registries.events.CustomComputerRegistrationCallback; +import ru.octol1ttle.flightassistant.registries.events.RegisterCustomComputersCallback; public class ThrustController implements ITickableComputer, INormalLawProvider { private static final float MIN_TO_MAX_SPOOL_UP_TIME = 5.0f; + private static final List controllers = new ArrayList<>(); + private static IThrustHandler thrustHandler; + private static IThrustHandler fallback; private final TimeComputer time = ComputerRegistry.resolve(TimeComputer.class); - private final List controllers = new ArrayList<>(); - public IThrustHandler thrustHandler; public float currentThrust = 0.0f; public float targetThrust = 0.0f; - public ThrustController() { - CustomComputerRegistrationCallback.EVENT.register(() -> { + static { + RegisterCustomComputersCallback.EVENT.register(() -> { if (FabricLoader.getInstance().isModLoaded("do_a_barrel_roll")) { ComputerRegistry.register(new DaBRThrustHandler()); } @@ -44,6 +45,8 @@ public ThrustController() { thrustHandler = handler; if (!(thrustHandler instanceof FireworkController)) { FlightAssistant.LOGGER.info("Active thrust handler is %s".formatted(handler.getClass().getName())); + } else { + fallback = handler; } } return true; @@ -60,6 +63,8 @@ public void tick() { } else { currentThrust = currentThrust + diff * time.deltaTime / MIN_TO_MAX_SPOOL_UP_TIME * Math.max(currentThrust, 0.1f); } + + getThrustHandler().tickThrust(); } private void updateTargetThrust() { @@ -86,6 +91,10 @@ private void updateTargetThrust() { } } + public IThrustHandler getThrustHandler() { + return thrustHandler.available() ? thrustHandler : fallback; + } + @Override public String getId() { return "thrust_ctl"; diff --git a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/safety/PitchLimitComputer.java b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/safety/PitchLimitComputer.java index 9c1ec8a..d0343ad 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/computers/impl/safety/PitchLimitComputer.java +++ b/src/main/java/ru/octol1ttle/flightassistant/computers/impl/safety/PitchLimitComputer.java @@ -13,11 +13,11 @@ import ru.octol1ttle.flightassistant.registries.events.AllowComputerRegisterCallback; public class PitchLimitComputer implements ITickableComputer, INormalLawProvider { - private final List limiters = new ArrayList<>(); + private static final List limiters = new ArrayList<>(); public float minimumSafePitch = -90.0f; public float maximumSafePitch = 90.0f; - public PitchLimitComputer() { + static { AllowComputerRegisterCallback.EVENT.register((computer -> { if (computer instanceof IPitchLimiter limiter) { limiters.add(limiter); diff --git a/src/main/java/ru/octol1ttle/flightassistant/hud/impl/StatusDisplay.java b/src/main/java/ru/octol1ttle/flightassistant/hud/impl/StatusDisplay.java index 4c2c55c..b5feb59 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/hud/impl/StatusDisplay.java +++ b/src/main/java/ru/octol1ttle/flightassistant/hud/impl/StatusDisplay.java @@ -51,7 +51,7 @@ public void render(DrawContext context, TextRenderer textRenderer) { } } - if (FAConfig.indicator().showFlightPhase && phase.phase != FlightPhaseComputer.FlightPhase.UNKNOWN) { + if (FAConfig.indicator().showFlightPhase && phase.phase != FlightPhaseComputer.Phase.UNKNOWN) { DrawHelper.drawRightAlignedText(textRenderer, context, phase.phase.text, x, y + 10, FAConfig.indicator().statusColor); } } diff --git a/src/main/java/ru/octol1ttle/flightassistant/registries/events/CustomComputerRegistrationCallback.java b/src/main/java/ru/octol1ttle/flightassistant/registries/events/RegisterCustomComputersCallback.java similarity index 63% rename from src/main/java/ru/octol1ttle/flightassistant/registries/events/CustomComputerRegistrationCallback.java rename to src/main/java/ru/octol1ttle/flightassistant/registries/events/RegisterCustomComputersCallback.java index 21b3684..b93a0bf 100644 --- a/src/main/java/ru/octol1ttle/flightassistant/registries/events/CustomComputerRegistrationCallback.java +++ b/src/main/java/ru/octol1ttle/flightassistant/registries/events/RegisterCustomComputersCallback.java @@ -4,11 +4,11 @@ import net.fabricmc.fabric.api.event.EventFactory; @FunctionalInterface -public interface CustomComputerRegistrationCallback { - Event EVENT = EventFactory.createArrayBacked( - CustomComputerRegistrationCallback.class, +public interface RegisterCustomComputersCallback { + Event EVENT = EventFactory.createArrayBacked( + RegisterCustomComputersCallback.class, (listeners) -> () -> { - for (CustomComputerRegistrationCallback event : listeners) { + for (RegisterCustomComputersCallback event : listeners) { event.registerCustomComputers(); } } diff --git a/src/main/resources/assets/flightassistant/lang/en_us.yml b/src/main/resources/assets/flightassistant/lang/en_us.yml index c4c760b..2e39ae9 100644 --- a/src/main/resources/assets/flightassistant/lang/en_us.yml +++ b/src/main/resources/assets/flightassistant/lang/en_us.yml @@ -217,9 +217,13 @@ mode.flightassistant: relative: MINIM +%s not_set: NO MINIMS thrust: - toga: - auto: AUTO TOGA - manual: MAN TOGA + toga: TOGA + climb: THR CLB + climb_reduced: RED CLB + idle: THR IDLE + speed: + selected: SPD %s + managed: P. SPD %s firework: none_in_hotbar: NO FRWKS locked: A/FRWK ONLY @@ -239,12 +243,13 @@ mode.flightassistant: descend: selected: DES %s managed: P. DES %s - alt_hold: + hold: selected: ALT %s managed: P. ALT %s land: LAND %s lat: - current: CUR HDG + takeoff: TO HDG %s + go_around: GA HDG %s selected: HDG %s managed: POS %s %s approach: APPR %s %s diff --git a/src/main/resources/assets/flightassistant/lang/ru_ru.yml b/src/main/resources/assets/flightassistant/lang/ru_ru.yml index 20e585f..72cff3a 100644 --- a/src/main/resources/assets/flightassistant/lang/ru_ru.yml +++ b/src/main/resources/assets/flightassistant/lang/ru_ru.yml @@ -235,12 +235,13 @@ mode.flightassistant: descend: selected: СНИЖ %s managed: П. СНИЖ %s - alt_hold: + hold: selected: ВЫС %s managed: П. ВЫС %s land: ПОСАДКА %s lat: - current: ТЕКУЩ КУРС + takeoff: ВЗЛЕТ КРС %s + go_around: В.КРУГ КРС %s selected: КУРС %s managed: ПОЗ %s %s approach: ЗАХОД %s %s