Class MachineInteractions
java.lang.Object
fr.robie.machineengine.api.paper.MachineInteractions
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA click on a machine's block with the main hand.static interfaceWhat a machine type's block does; every method's default does nothing. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull List<MachineInteractions.Interaction> of(@NotNull net.kyori.adventure.key.Key machineType) What is registered formachineType, in registration order (empty if nothing).static voidregister(@NotNull net.kyori.adventure.key.Key machineType, @NotNull MachineInteractions.Interaction interaction) Adds what blocks of the machine typemachineTypedo.static voidunregister(@NotNull net.kyori.adventure.key.Key machineType, @NotNull MachineInteractions.Interaction interaction)
-
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 typemachineTypedo. 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 formachineType, in registration order (empty if nothing).
-