Swap item instruction (for now) & freezin

This commit is contained in:
skippyall
2026-01-29 21:44:52 +01:00
parent 5bd7c08f83
commit 1e430ef506
17 changed files with 185 additions and 65 deletions
@@ -1,5 +1,6 @@
package io.github.skippyall.minions.registration;
import io.github.skippyall.minions.instruction.inventory.SwapItemExecution;
import io.github.skippyall.minions.program.instruction.InstructionExecution;
import io.github.skippyall.minions.program.instruction.InstructionType;
import io.github.skippyall.minions.Minions;
@@ -57,6 +58,12 @@ public class Instructions {
() -> new ActionExecution(EntityPlayerActionPack.ActionType.USE)
);
public static final InstructionType<MinionRuntime> SWAP_ITEM = register(
"swap_item",
SwapItemExecution::new,
List.of(SwapItemExecution.FROM_SLOT, SwapItemExecution.FROM_SCREEN, SwapItemExecution.TO_SLOT, SwapItemExecution.TO_SCREEN)
);
private static InstructionType<MinionRuntime> register(String id, Supplier<InstructionExecution<MinionRuntime>> factory, Collection<Parameter<?>> parameters, Collection<Parameter<?>> returnParameters) {
Identifier identifier = Identifier.of(Minions.MOD_ID, id);
return Registry.register(MinionRegistries.INSTRUCTION_TYPES, identifier, new InstructionType<>(factory, parameters, returnParameters));