Interface MachineAction

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MachineAction
Something a player asks a machine to do from a menu (D40): take an upgrade out, switch a module off, … A machine type declares its actions by id (MachineType.Builder.action(String, MachineAction)); a menu button names one (machineengine_action, action: <id>) and runs it with the click. Runs on the machine's owner thread; the action changes the machine through its context and wakes it if needed.
MachineType.builder(key("station"))
    .action("take", (context, click) -> {
        ResourceStack taken = takeOut(context, click.index());
        return taken == null ? Outcome.refused(Component.text("Nothing there")) : Outcome.give(taken);
    })