Skip to content

Conversation

@eygwi
Copy link
Contributor

@eygwi eygwi commented Dec 26, 2025

Description

This PR fixes a critical bug in the Stoneworks Factory where Slimefun items (or any items with NBT data) were reverting to vanilla items when passing through the machine without being processed.

Previously, the machine logic reconstructed the output item solely based on its Material type during the pass-through phase. This caused the loss of all custom data, including Slimefun IDs, enchantments, and lore.

Proposed changes

  • Modified the process method in StoneworksFactory.kt.
  • Updated the logic to distinguish between processing and passing through:
    • If a transformation recipe is applied: Create the new item based on the recipe output.
    • If no recipe applies (Choice is NONE): Clone the original item stack instead of creating a new one from the material. This preserves all NBT data.

Related Issues (if applicable)

#57

Checklist

  • I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • I followed the existing code standards and didn't mess up the formatting.
  • I did my best to add documentation to any public classes or methods I added.
  • I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • I added sufficient Unit Tests to cover my code.

@sonarqubecloud
Copy link

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