Ignore generated direct reward files in conflict check#268
Conversation
|
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. |
|
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:
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. |
|
Can you send your files and logs? I'll take a look at it when I get the chance. |
4281248 to
69311a9
Compare
|
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 Example:
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. |
|
I don't think I ever tested that specific edge case, thanks! |
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: