Class UpgradeActions
java.lang.Object
fr.robie.machineengine.api.upgrade.UpgradeActions
The upgrade action and list every machine type with upgrade slots gets (D40), unless it declares its own
with the same ids.
- action "upgrade": with an upgrade item held, installs as many as fit (right-click: one);
with nothing held, takes upgrades of row
indexof the list out as items (one; shift: all); - list "upgrades": every upgrade the machine accepts, then any installed one it no longer accepts,
in registry order. Fields:
id,namespace,value,count,max,installed(true/false),item(the id of an item installing it, or empty).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final MachineActionstatic final MachineList -
Method Summary
Modifier and TypeMethodDescriptionstatic MachineAction.Outcomeinstall(@NotNull MachineContext context, @NotNull ResourceStack held, boolean one) Installs as many of the held upgrade as fit (one: a single one).static MachineAction.Outcometake(@NotNull MachineInstance machine, @NotNull UpgradeType upgrade, int count) Takes up tocountofupgradeout, as items; nothing is removed if it has no item.
-
Field Details
-
ACTION
- See Also:
-
LIST
- See Also:
-
UPGRADE
-
UPGRADES
-
-
Method Details
-
install
@NotNull public static MachineAction.Outcome install(@NotNull @NotNull MachineContext context, @NotNull @NotNull ResourceStack held, boolean one) Installs as many of the held upgrade as fit (one: a single one). -
take
@NotNull public static MachineAction.Outcome take(@NotNull @NotNull MachineInstance machine, @NotNull @NotNull UpgradeType upgrade, int count) Takes up tocountofupgradeout, as items; nothing is removed if it has no item.
-