Fixing & Listening

This commit is contained in:
skippyall
2026-01-18 00:52:13 +01:00
parent 3f2a52fd0a
commit 382b394523
29 changed files with 284 additions and 63 deletions
@@ -14,11 +14,11 @@ import net.minecraft.util.Identifier;
import java.util.List;
public record MinionModule(List<InstructionType<MinionRuntime>> instructions, List<String> specialBehaviour) {
public record MinionModule(List<InstructionType<MinionRuntime>> instructions, List<SpecialAbility> specialAbilities) {
public static final Codec<MinionModule> CODEC = RecordCodecBuilder.create(instance ->
instance.group(
MinionRegistries.INSTRUCTION_TYPES.getCodec().listOf().fieldOf("instructions").forGetter(MinionModule::instructions),
Codec.STRING.listOf().fieldOf("specialBehaviour").forGetter(MinionModule::specialBehaviour)
MinionRegistries.SPECIAL_ABILITIES.getCodec().listOf().fieldOf("specialAbilities").forGetter(MinionModule::specialAbilities)
).apply(instance, MinionModule::new)
);
@@ -30,9 +30,9 @@ public record MinionModule(List<InstructionType<MinionRuntime>> instructions, Li
this(instructions, List.of());
}
public MinionModule(List<InstructionType<MinionRuntime>> instructions, List<String> specialBehaviour) {
public MinionModule(List<InstructionType<MinionRuntime>> instructions, List<SpecialAbility> specialAbilities) {
this.instructions = List.copyOf(instructions);
this.specialBehaviour = List.copyOf(specialBehaviour);
this.specialAbilities = List.copyOf(specialAbilities);
}
public static void register() {