Skip to content

Add operator aspect to crafting writer - #245

Merged
rubensworks merged 1 commit into
CyclopsMC:master-1.21-ltsfrom
harshverma27:operator-craft
Oct 11, 2026
Merged

rubensworks merged 1 commit into
CyclopsMC:master-1.21-ltsfrom
harshverma27:operator-craft

Conversation

@harshverma27

Copy link
Copy Markdown

Closes #76.

Changes

This PR adds a new aspect to the crafting writer: "Craft Recipe from Operator".

  • The aspect takes an operator without inputs. The operator must give a recipe.
  • On each update, the writer runs the operator and crafts the recipe that it gives.
  • If the recipe is empty, the writer does not craft.
  • If the operator needs inputs or does not give a recipe, the writer shows an error.

The aspect uses the same settings and craft logic as "Craft Recipe" (PROP_CRAFT_RECIPE).
The model uses the texture of "Craft Recipe". I did not add a new texture.

Tests

I added three game tests to GameTestsItemsCraft:

  • testItemsCraftChestOneOperator: the operator gives the chest recipe. The writer crafts one chest.
  • testItemsCraftChestOneOperatorEmptyRecipe: the operator gives an empty recipe. The writer does not craft and shows no error.
  • testItemsCraftOperatorWithInputs: the operator needs an input. The writer shows an error.

To make an operator without inputs, the tests apply a recipe to the id operator.

Validation

  • ./gradlew build passes.
  • ./gradlew runGameTestServer passes all 79 required tests.

The writer runs the operator without inputs and crafts the recipe that it gives.
The writer does not craft when the recipe is empty.
@CLAassistant

CLAassistant commented Oct 10, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@harshverma27

Copy link
Copy Markdown
Author

@rubensworks Hi, just did the changes as we talked about in #76.

@rubensworks
rubensworks merged commit 4e0f372 into CyclopsMC:master-1.21-lts Oct 11, 2026
4 checks passed
@rubensworks

Copy link
Copy Markdown
Member

Thanks @harshverma27, looks perfect! Will publish new releases soon.

@harshverma27

Copy link
Copy Markdown
Author

@rubensworks Thanks, I'll see #20 now.

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.

3 participants