Skip to content

feat: Add create-style filter items to transporter, greedy familiar and all worker spirits that pick up items.#1606

Open
klikli-dev wants to merge 102 commits intoversion/26.1.2from
feature/port-theurgy-filter-guis
Open

feat: Add create-style filter items to transporter, greedy familiar and all worker spirits that pick up items.#1606
klikli-dev wants to merge 102 commits intoversion/26.1.2from
feature/port-theurgy-filter-guis

Conversation

@klikli-dev
Copy link
Copy Markdown
Owner

No description provided.

klikli-dev added 30 commits May 2, 2026 18:25
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new filtering system for spirits using 'List' and 'Attribute' filters, replacing the previous tag-based filtering. It includes necessary infrastructure updates, such as adding the 'code-defined-gui' dependency, updating GUI rendering logic, and modifying spirit entity data handling. My feedback highlights concerns regarding the reduction of filter slots from 14 to 1, which may cause data loss for existing entities, and suggests verifying if migration logic is required.

TagValueOutput tagOutput = TagValueOutput.createWithContext(ProblemReporter.DISCARDING, SpiritEntity.this.level().registryAccess());
this.serialize(tagOutput);
SpiritEntity.this.entityData.set(FILTER_ITEMS, tagOutput.buildResult().toString());
SpiritEntity.this.entityData.set(FILTER_ITEM, tagOutput.buildResult().toString());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The filterItemStackHandler is initialized with a size of 1, but the previous code used MAX_FILTER_SLOTS (14). Ensure that this reduction in filter capacity is intentional and does not break existing spirit configurations.

String compoundStr = this.entityData.get(FILTER_ITEM);
try {
CompoundTag compound = compoundStr.isEmpty() ? new CompoundTag() : TagParser.parseCompoundFully(compoundStr);
compound.putInt("Size", 1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The deserialization logic now forces a size of 1 for the filter handler. If this entity previously supported more slots, this will truncate existing data. Verify if migration logic is needed for existing entities.


@Override
public int getMaxStackSize() {
return 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filter slot is hardcoded to a max stack size of 1. Ensure this is consistent with the intended behavior for all filter types, as some might support larger stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant