Class MultiblockMember
java.lang.Object
fr.robie.machineengine.api.multiblock.MultiblockMember
- All Implemented Interfaces:
MachineBehavior
A block of a multiblock (D33): a frame block, valve or port, as a machine behavior. Each finds its
structure when it loads (or is placed), and unforms it when removed. The anchor sizes its storages for
the structure and checks it again every few seconds (blocks placed inside, cells added...). A member
that passes through (storages given) shows the anchor's storages on all its sides.
Built with of(List); data-driven machines use the behavior type
machineengine:multiblock_member.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceWork an anchor does while its structure is formed (e.g.static final classMakes the behavior factories of members.static interfaceWhat an output port pushes per tick, from the structure and the port block's options (D34).Nested classes/interfaces inherited from interface MachineBehavior
MachineBehavior.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MachineDataKey<String> A port's mode:input(default) oroutput, pushing to its neighbors. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MultiblockMember.Builderof(@NotNull List<MultiblockType> types) Members of a structure of one oftypes(tried in order).voidonLoad(@NotNull MachineContext context) Called after the machine was placed or loaded, before it first ticks.voidonRemove(@NotNull MachineContext context) Called when the machine is removed from the world.voidonWake(@NotNull MachineContext context, @NotNull WakeReason reason) Called before the first tick after waking up.voidtick(@NotNull MachineContext context) Called each tick while the machine isSchedulerState.ACTIVE.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MachineBehavior
catchUp, onUnload
-
Field Details
-
PORT_MODE
A port's mode:input(default) oroutput, pushing to its neighbors. Builders may use another key.
-
-
Method Details
-
of
@NotNull public static @NotNull MultiblockMember.Builder of(@NotNull @NotNull List<MultiblockType> types) Members of a structure of one oftypes(tried in order). -
onLoad
Description copied from interface:MachineBehaviorCalled after the machine was placed or loaded, before it first ticks.- Specified by:
onLoadin interfaceMachineBehavior
-
tick
Description copied from interface:MachineBehaviorCalled each tick while the machine isSchedulerState.ACTIVE.- Specified by:
tickin interfaceMachineBehavior
-
onRemove
Description copied from interface:MachineBehaviorCalled when the machine is removed from the world.- Specified by:
onRemovein interfaceMachineBehavior
-
onWake
Description copied from interface:MachineBehaviorCalled before the first tick after waking up.- Specified by:
onWakein interfaceMachineBehavior
-