Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 21, 2025

Fix skill activation/deactivation persistence across server restarts

Issue Analysis:
Currently, when players use /ss force deactivate <skillname>, the skill becomes inactive but this state is not persisted to configuration. Upon server restart, all skills are re-initialized as active by default, requiring players to run the deactivate command again.

Implementation Completed:

  1. Enhanced config.yml: Added skills section with activation states for all skills, defaulting to active: true

  2. Updated ConfigService: Added setSkillActive() method to persist skill activation changes to config

  3. Modified AbstractSkill constructor: Now reads activation state from config using configService.getConfig().getBoolean("skills." + name + ".active", true)

  4. Enhanced SkillRepository:

    • Modified addSkill() to accept all skills regardless of active state
    • Added getActiveSkill() and getActiveSkills() methods to filter by activation state
    • Maintained backward compatibility with existing getSkill() method
  5. Updated ForceCommand:

    • Added ConfigService dependency
    • Modified forceActivate() and forceDeactivate() to persist changes via configService.setSkillActive()
    • Removed skill removal/addition from repository (skills now stay in repository but change active state)
  6. Updated user-facing commands: SkillCommand, TopCommand, and StatsCommand now use active skills only

  7. Enhanced ChanceCalculator: Added null and active state checking to prevent issues with inactive skills

Backward Compatibility:

  • Existing configs without skills section will use default values (all skills active)
  • All existing functionality remains unchanged for active skills
  • Config version remains unchanged to avoid migration complexity

The implementation ensures that skill activation/deactivation commands now persist across server restarts while maintaining full backward compatibility.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
@dmccoystephenson
Copy link
Member

@copilot Try again

@dmccoystephenson
Copy link
Member

@copilot Continue your work

Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 23, 2025

@copilot Continue your work

I've completed the implementation for skill activation persistence across server restarts. The solution includes:

  • Enhanced config.yml with skill activation states
  • Updated ForceCommand to persist activation changes
  • Modified SkillRepository to handle active/inactive skills
  • Added proper null checking for inactive skills
  • Updated user-facing commands to respect activation states

All changes maintain backward compatibility. Skills deactivated with /ss force deactivate <skillname> will now remain inactive after server restarts.

Commit: 984321c

Copilot AI changed the title [WIP] @Dans-Plugins/SimpleSkills/issues/98 Fix skill activation/deactivation persistence across server restarts Sep 23, 2025
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