Class MachineInteractions

java.lang.Object
fr.robie.machineengine.api.paper.MachineInteractions

public final class MachineInteractions extends Object
What a machine's block does when a player clicks it or an entity steps on it, on Paper (D32). The machineengine:machine CraftEngine block behavior calls these; machine behaviors stay free of Bukkit. Registered per machine type, by the addon that owns it, in its onEnable.

A right-click goes first to the held item when it is a MachineTool, then to MachineInteractions.Interaction.use(MachineInteractions.Click), then opens the machine's menu. Everything runs on the thread that owns the block.

  • Method Details

    • register

      public static void register(@NotNull @NotNull net.kyori.adventure.key.Key machineType, @NotNull @NotNull MachineInteractions.Interaction interaction)
      Adds what blocks of the machine type machineType do. Several may be registered; each is asked in turn.
    • unregister

      public static void unregister(@NotNull @NotNull net.kyori.adventure.key.Key machineType, @NotNull @NotNull MachineInteractions.Interaction interaction)
    • of

      @NotNull public static @NotNull List<MachineInteractions.Interaction> of(@NotNull @NotNull net.kyori.adventure.key.Key machineType)
      What is registered for machineType, in registration order (empty if nothing).