Feature Description
Implement a dynamic feature flag system within the FoliaCore plugin that supports in-game enabling and disabling of specific features without requiring a server restart. The system should include commands like /foliacore enable <feature> and /foliacore disable <feature>, as well as a /foliacore reload to reload configuration changes. Each listener or feature module, such as DoggySteakListener, will check the flag status before executing logic—skipping or cancelling behavior if the feature is disabled.
Why This Feature Should Be Added
This system would make managing and testing features significantly more efficient. Server administrators would gain real-time control over specific functionalities, allowing quick hotfixes, testing, and feature rollouts without interrupting gameplay. It would also help in debugging and isolating problem areas by disabling individual components safely during runtime.
Potential Implementation Details
- Create a central
FeatureFlagManager in FoliaCore that loads flags from a YAML or JSON config.
- Provide getter methods like
isFeatureEnabled("doggy-steak") for use in listeners.
- Add commands:
/foliacore enable <flag>
/foliacore disable <flag>
/foliacore reload to re-read the config and apply changes.
- In listeners like
DoggySteakListener, check the flag before proceeding:
if (!FeatureFlagManager.isEnabled("doggy-steak")) {
event.setCancelled(true);
return;
}
Feature Description
Implement a dynamic feature flag system within the FoliaCore plugin that supports in-game enabling and disabling of specific features without requiring a server restart. The system should include commands like
/foliacore enable <feature>and/foliacore disable <feature>, as well as a/foliacore reloadto reload configuration changes. Each listener or feature module, such asDoggySteakListener, will check the flag status before executing logic—skipping or cancelling behavior if the feature is disabled.Why This Feature Should Be Added
This system would make managing and testing features significantly more efficient. Server administrators would gain real-time control over specific functionalities, allowing quick hotfixes, testing, and feature rollouts without interrupting gameplay. It would also help in debugging and isolating problem areas by disabling individual components safely during runtime.
Potential Implementation Details
FeatureFlagManagerin FoliaCore that loads flags from a YAML or JSON config.isFeatureEnabled("doggy-steak")for use in listeners./foliacore enable <flag>/foliacore disable <flag>/foliacore reloadto re-read the config and apply changes.DoggySteakListener, check the flag before proceeding: