Skip to content

Ignore generated direct reward files in conflict check#268

Merged
BenCodez merged 1 commit into
BenCodez:masterfrom
RapidGravy:feature/ignore-generated-direct-reward-conflicts
Jun 3, 2026
Merged

Ignore generated direct reward files in conflict check#268
BenCodez merged 1 commit into
BenCodez:masterfrom
RapidGravy:feature/ignore-generated-direct-reward-conflicts

Conversation

@RapidGravy
Copy link
Copy Markdown
Contributor

This updates the direct reward conflict check so it skips reward files that are already marked as DirectlyDefinedReward.

Those files are generated/managed by AdvancedCore itself, so they should not trigger the same warning as a normal reward file that conflicts with a directly defined reward path.

This came up while testing VotingPlugin 7.x, where startup can show a lot of reward file conflict warnings for generated files under Rewards/DirectlyDefined.

Normal reward file conflicts should still be reported.

Tests added:

  • generated/directly defined reward files do not warn
  • normal reward files with the same name still warn

@BenCodez
Copy link
Copy Markdown
Owner

BenCodez commented Jun 2, 2026

There actually should not be any directly defined reward files generating unless there is an underlying issue (or I missed something). There were bugs that caused them before that should be fixed.

Not sure if I want to have the warnings hidden as some very rare cases this saves a ton of time troubleshooting.

Eventually the directlydefined folder will be removed entirely, or atleast that is the hope.

@RapidGravy
Copy link
Copy Markdown
Contributor Author

I did a cleaner test with VotingPlugin and it looks like the file is still being generated during normal reward execution.

Steps I took while testing:

  1. Stopped the server.
  2. Cleared plugins/VotingPlugin/Rewards/DirectlyDefined, leaving the folder empty.
  3. Started the server.
  4. Startup had no reward file conflict warnings.
  5. Ran /av reload.
  6. Rewards/DirectlyDefined was still empty.
  7. Joined with a test player and ran one forced reward:
    /av User TestPlayerName ForceReward VoteSteak_3_Rewards_Online
  8. That generated:
    Rewards/DirectlyDefined/VoteSteak_3_Rewards_Online_Rewards.yml
  9. Restarted the server.
  10. Startup then logged:
    Found reward file conflict: VoteSteak_3_Rewards_Online_Rewards, recommend deleting or renaming file to prevent issues

So I agree hiding the warning may not be the right fix here if these reward files should not be generated anymore. It looks like the reward is still creating a directly defined file when it runs.

Do you want this PR changed to fix that generation path instead, or would you prefer this be looked at in VotingPlugin specifically? I’m mainly just trying to solve the issue where VotingPlugin shows a lot of startup warnings for these reward files.

@BenCodez
Copy link
Copy Markdown
Owner

BenCodez commented Jun 2, 2026

Can you send your files and logs? I'll take a look at it when I get the chance.

@RapidGravy RapidGravy force-pushed the feature/ignore-generated-direct-reward-conflicts branch from 4281248 to 69311a9 Compare June 2, 2026 23:35
@RapidGravy
Copy link
Copy Markdown
Contributor Author

I did more testing with a new default config and only a small test reward and think I found the cause.

The warning happens when a reward file name already contains Rewards and the file also has a nested Rewards: section.

Example:

Rewards/Test_Rewards_Name.yml

Rewards:
  Messages:
    Player: "&aRewards-name reward"
  Commands:
    Console:
    - "say Rewards-name command ran for %player%"

When that reward is trigger AdvancedCore generates:

Rewards/DirectlyDefined/Test_Rewards_Name_Rewards.yml

I updated the PR to fix that lookup instead of just skipping the warning. It now also checks the sub-reward name so Test_Rewards_Name.Rewards can match Test_Rewards_Name_Rewards.

You can also just test this yourself by using the above reward.

@BenCodez BenCodez merged commit de45690 into BenCodez:master Jun 3, 2026
1 check passed
@BenCodez
Copy link
Copy Markdown
Owner

BenCodez commented Jun 3, 2026

I don't think I ever tested that specific edge case, thanks!

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