Skip to content

Replace Create-side SCADA subclasses with a less invasive composition mechanism #7

Description

@SolAstrius

PR #6 restored four Create-side peripheral subclasses (CreativeMotorPeripheral, SpeedControllerPeripheral, SpeedGaugePeripheral, StressGaugePeripheral) and the ComputerBehaviourMixin entries that route Create's blocks through them. They exist solely to add the SCADA pack on top of Create's built-in peripheral methods.

This is a load-bearing hack: CC: Tweaked's GenericSource only fills in for block entities that have no IPeripheral. Create already registers an IPeripheral for these four blocks, so KineticSource never reaches them — hence the subclass + mixin override.

Costs:

  • Four subclasses Avionics has to keep in sync with Create's API surface (setGeneratedSpeed/getGeneratedSpeed, scroll-value access, etc.).
  • A mixin that intercepts ComputerBehaviour.getPeripheralFor — fragile against Create internal refactors.
  • The same SCADA pack methods exist via the KineticScadaSurface interface, but only because each subclass extends KineticPeripheral. The interface is the right abstraction; the subclasses are the wrong way to apply it here.

Ideas to explore:

  1. Upstream a CC API change that lets a GenericSource compose onto an existing IPeripheral instead of only being a fallback. Cleanest if it lands.
  2. Lighter mixin that injects @LuaFunction-discoverable methods directly onto Create's peripheral classes (via @At("RETURN") on getPeripheralFor to wrap the returned peripheral with a composite, or via mixin @Intrinsic on the class itself). Avoids the subclass-per-block model.
  3. Drop the subclasses entirely and document that SCADA is only available on bare kinetic BEs and Avionics/Aero/Sim-wrapped ones. Loses coverage on Speedometer/Stressometer/Motor/SpeedController — probably unacceptable.

Tracking so the temporary restoration in PR #6 doesn't become permanent by inertia.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:createCreate base (kinetic SCADA, generic source, mixins on Create classes)blocked-upstreamGated on a fix in an upstream modtech-debtRefactor or cleanup, no user-visible regression

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions