Skip to content

Mc1.21.1/neoforge/dev#158

Open
Starior wants to merge 13 commits intocotrin8672:mc1.21.1/neoforge/devfrom
Starior:mc1.21.1/neoforge/dev
Open

Mc1.21.1/neoforge/dev#158
Starior wants to merge 13 commits intocotrin8672:mc1.21.1/neoforge/devfrom
Starior:mc1.21.1/neoforge/dev

Conversation

@Starior
Copy link
Copy Markdown

@Starior Starior commented Mar 23, 2026

  • Refactored Crushing Wheel Fortune to use an effective pair level L = (F1 + F2) / 2, persisted in controller NBT as EffectiveFortuneLevel, and applied a crusher-specific expected roll model at 0.8 * (1/(L+2) + (L+1)/2) (~20% below vanilla-style reference).
  • Added Silk Touch processing behavior for Crushing Wheels: per input roll, return one input item with 5% chance if one wheel has Silk Touch, or 10% if both wheels have Silk Touch; persisted wheel Silk count in NBT as SilkTouchWheelCount.
  • Added an anvil restriction for machine block items so enchanting only works with a single item in the left slot (count > 1 is blocked by clearing result).
  • Added custom anvil merge support for Fortune + Silk Touch on Crushing Wheels, with pair detection in both directions and custom anvil cost multiplier x4.
  • Added scoped compatibility override for the Fortune/Silk conflict using EnchantmentMixin + AnvilCompatibilityContext, so compatibility is lifted only during the intended anvil flow (not globally).
  • Extended Crushing Wheel detection for anvil logic to include modded wheel variants via item tag c:create/crushing_wheels.
  • Added a small crusher-side optimization: before doing enchantment registry lookups for wheel/controller sync, it now checks whether either wheel has any enchantments (mayHaveAnyEnchantments), and skips the expensive lookup/merge path when both are empty.

cotrin8672 and others added 7 commits March 1, 2026 18:53
Enable Fortune + Silk Touch only for crushing wheel items during anvil merges. Add a scoped compatibility context and Enchantment mixin so the conflict override applies only in the intended anvil flow, with x4 cost preserved.
Enable Fortune+Silk Touch anvil compatibility only for crushing wheels, including modded variants from c:create/crushing_wheels. Keep the compatibility override scoped to the anvil context and preserve existing machine enchanting rules.
@Starior Starior closed this Mar 23, 2026
@Starior Starior reopened this Mar 23, 2026
@cotrin8672
Copy link
Copy Markdown
Owner

Thanks for the PR!
The enchantability of items is intended to be controlled via the tag-based system in mc 1.21.1, so the IItemExtension mixin should not be needed. Please use the tag-based approach instead.

@Starior Starior closed this Mar 26, 2026
@cotrin8672
Copy link
Copy Markdown
Owner

Is it okay if I reopen and merge this?

@Starior Starior reopened this Mar 28, 2026
@Starior
Copy link
Copy Markdown
Author

Starior commented Mar 28, 2026

I think I did what you asked with the tag
assigning ENCHANTABLE_MECHANICAL_ to blocks of other mods
But I completely understood your approach of creating a separate ENCHANTABLE_MECHANICAL_ for each block.
So, when placed in the game, the enchanted dndecor crushing wheel looks like a standard create block with glint. But when destroyed and in the inventory, it will appear as an enchanted dndecor crushing wheel.
So, I've settled on this implementation.

And I'm trying out the implementation of leaving the original block in the world and storing the enchantments in its BlockEntity in another branch.

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.

2 participants