Skip to content

Fix race condition in Purifier enchantment blacklist game tests#1175

Merged
rubensworks merged 5 commits intomaster-1.21-ltsfrom
copilot/add-enchantment-id-blacklist
Mar 21, 2026
Merged

Fix race condition in Purifier enchantment blacklist game tests#1175
rubensworks merged 5 commits intomaster-1.21-ltsfrom
copilot/add-enchantment-id-blacklist

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

  • Add enchantmentIdBlacklist config to BlockEntityPurifierConfig using @ConfigurableProperty
  • Modify DisenchantPurifyAction to filter blacklisted enchantments
  • Modify ToolBadEnchantPurifyAction to skip blacklisted curses
  • Add GameTestsPurifier with 3 game tests:
    • testPurifierDisenchant: normal disenchanting works
    • testPurifierCurseRemoval: normal curse removal works
    • testPurifierEnchantmentBlacklist: both blacklist scenarios run in isolated batch = "purifier_blacklist_0" to avoid concurrent interference with other tests that use the same enchantments
Original prompt

This section details on the original issue you should resolve

<issue_title>Enchantment ID Blacklist for the Purifier</issue_title>
<issue_description>

Issue type:

  • ➕ Feature request

Short description:

The Purifier can disenchant tools and remove curses as well.
This is pretty powerful, depending on the modpack.
I think it would be nice to have a blacklist for enchantments that the purifier can effect or not.
Proposed format:

[machine]

	[machine.purifier]
		#Item that can not be disenchanted. Regular expressions are allowed.
		disenchantBlacklist = ["tetra:.*"]
		#Enchantments to be disqualified from disenchantment, or curses disallowed from purification.
		enchantmentIdBlacklist = ["minecraft:vanishing_curse","evilcraft:vengeance"]

Potentially disenchantBlacklist could be renamed to disambiguate.
Might be some work, but if it happens, I'd suggest "itemBlacklist"

</issue_description>

<agent_instructions>Please implement this, the proposed format suggestion looks good.
Config properties can be added in BlockEntityPurifierConfig using @ConfigurableProperty.
Add game tests to validate the functionality.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@rubensworks

Thanks for the suggestion!


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@github-project-automation github-project-automation bot moved this to Options in Features Mar 20, 2026
@rubensworks rubensworks moved this from Options to In Progress in Features Mar 20, 2026
@coveralls
Copy link

coveralls commented Mar 20, 2026

Pull Request Test Coverage Report for Build 23374137913

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.0%) to 28.511%

Files with Coverage Reduction New Missed Lines %
org/cyclops/evilcraft/blockentity/tickaction/purifier/ToolBadEnchantPurifyAction.java 2 81.82%
org/cyclops/evilcraft/blockentity/tickaction/purifier/DisenchantPurifyAction.java 5 75.27%
Totals Coverage Status
Change from base Build 22867788481: 1.0%
Covered Lines: 5018
Relevant Lines: 15065

💛 - Coveralls

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Agent-Logs-Url: https://github.com/CyclopsMC/EvilCraft/sessions/d9138adc-a71b-4613-8178-3fbdbb18dfdf
Copilot AI changed the title [WIP] Add enchantment ID blacklist for the Purifier Add enchantment ID blacklist config for the Purifier Mar 20, 2026
Copilot stopped work on behalf of rubensworks due to an error March 20, 2026 21:43
Copilot AI changed the title Add enchantment ID blacklist config for the Purifier Fix race condition in Purifier enchantment blacklist game tests Mar 21, 2026
@rubensworks
Copy link
Member

@copilot one gametest fails. Please fix, and run it yourself after fixing to ensure it works.

… own batch

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Agent-Logs-Url: https://github.com/CyclopsMC/EvilCraft/sessions/ad67f4c7-d463-4fae-9bec-0a11c2ea7528
Copy link
Contributor Author

Copilot AI commented Mar 21, 2026

@copilot one gametest fails. Please fix, and run it yourself after fixing to ensure it works.

Fixed in fb59962. The root cause was testPurifierEnchantmentBlacklist running concurrently (same default batch) with testPurifierDisenchant. The blacklist test set BlockPurifierConfig.enchantmentIdBlacklist = ["minecraft:sharpness", ...] globally, which prevented the purifier in testPurifierDisenchant from ever removing sharpness — causing that test to time out and fail.

The fix adds batch = "purifier_blacklist_0" to testPurifierEnchantmentBlacklist, following the same pattern used in GameTestsVengeanceSpirits. Tests in different batches run sequentially, so the blacklist test now runs in complete isolation from the other purifier tests.

@rubensworks rubensworks marked this pull request as ready for review March 21, 2026 13:55
@rubensworks rubensworks merged commit e34240e into master-1.21-lts Mar 21, 2026
3 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Features Mar 21, 2026
@rubensworks rubensworks deleted the copilot/add-enchantment-id-blacklist branch March 21, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enchantment ID Blacklist for the Purifier

3 participants