diff --git a/README.md b/README.md index 41e6404..8af0649 100644 --- a/README.md +++ b/README.md @@ -4,38 +4,111 @@ This plugin allows you to control which plugins have to be enabled for the server continues running. -Inspired by [this](https://github.com/PaperMC/Paper/issues/8859#issuecomment-1435905791) and [this](https://github.com/PaperMC/Paper/pull/8108#issuecomment-1419304955) comment and myself having the same problem. +Inspired by [this](https://github.com/PaperMC/Paper/issues/8859#issuecomment-1435905791) +and [this](https://github.com/PaperMC/Paper/pull/8108#issuecomment-1419304955) comment and myself having the same +problem. ## Installation -1. Download the plugin from [here](https://github.com/SrBedrock/PluginControl/releases/). -2. Put the plugin in the `plugins` folder of your server. -3. Restart the server. -4. Add plugins to the list with `/plugincontrol add `. -5. Enable the plugin with `/plugincontrol enable`. +1. Download the PluginControl plugin from [here](https://github.com/SrBedrock/PluginControl/releases/). +2. Place the downloaded plugin file in the `plugins` folder of your server. +3. Restart the server to load the PluginControl plugin. +4. Use the command `/plugincontrol action ` to set the action to be taken if any of the listed plugins are not + enabled. See the [Actions](#actions) section for available actions. +5. Add plugins to the list using the command `/plugincontrol add `. +6. Enable the PluginControl plugin by running the command `/plugincontrol enable`. +7. Reload the PluginControl plugin configuration and language files with the command `/plugincontrol reload`. + +Please note that the `` and `` placeholders should be replaced with the specific action and plugin +names as needed. ## Configuration -| Option | Description | -|-----------|-------------------------------------------------------| -| `enabled` | Whether the plugin is enabled or not. | -| `plugins` | List of plugins to be enabled when the server starts. | +| Option | Description | +|----------------|--------------------------------------------------------------------------------| +| `enabled` | Whether the plugin is enabled or not. | +| `action` | [Action to take if all listed plugins are not enabled.](#actions) | +| `kick-message` | Message sent to the player when the `disallow-player-login` action is enabled. | +| `plugins` | List of plugins to be enabled when the server starts. | + +### Actions + +| Action Type | Description | +|-------------------------|---------------------------------------------------------------------------------------| +| `log-to-console` | Sends a warning (`log-to-console` inside lang.yaml) in the console. | +| `disallow-player-login` | Block player from enter the server with a message (`kick-message` inside config.yml). | +| `shutdown-server` | Shutdown the server with a warning (`disabling-server` inside lang.yml). | + +## Messages + +Change the message formatting using [MiniMessage](https://webui.advntr.dev/) + +### Placeholders + +| Placeholder | Usage | +|------------------|-----------------------------------------------------------------------------------------------------------| +| `` | Plugin prefix - all messages accept this placeholder | +| `` | Plugin action used in `command.action-type` | +| `` | List of actions used in `command.action-list` | +| `` | Command used in `command.command-not-found`, `command.plugin-add-error` and `command.plugin-remove-error` | +| `` | Kick message used in `command.kick-message` and `command.kick-message-set` | +| `` | Plugin name used in `command.plugin-added`, `command.plugin-not-found` and `command.plugin-removed` | +| `` | List of plugins used in `console.disabling-server` and `command.plugin-list` | + +### Default + +```yaml +prefix: '[PluginControl]' +console: + checking-plugins: ' Checking plugins...' + disabling-server: ' Disabling server because was not found or enabled successfully!' + finished-checking: ' Plugins successfully verified!' + log-to-console: ' Plugin not found or enabled successfully...' +command: + action-list: ' Actions available: ' + action-set: ' Action set to !' + action-type: ' Action type: !' + command-not-found: 'Usage: / | ' + kick-message: ' Kick message: ' + kick-message-set: ' Kick message set to !' + no-permission-error: ' You do not have permission to use this command' + plugin-add-error: 'Usage: / add [plugin-name]' + plugin-added: ' Plugin added successfully!' + plugin-already-added: ' Plugin already added!' + plugin-disabled: ' Deactivating plugin features...' + plugin-enabled: ' Activating plugin features...' + plugin-list: ' Plugins added: ' + plugin-list-empty: ' No plugins added!' + plugin-not-found: ' Plugin not found in the list!' + plugin-reload: ' Config and Language reloaded!' + plugin-remove-error: 'Usage: / remove ' + plugin-removed: ' Plugin removed!' +``` ## Commands -Main command aliases: `/pc` and `/pcontrol`. +Main Command `/plugincontrol` - Aliases: `/pc` and `/pcontrol` + +| Command | Sub Command | Description | +|------------------|--------------------------|----------------------------------------------| +| `/plugincontrol` | `add ` | Add a plugin to the list. | +| `/plugincontrol` | `remove ` | Remove a plugin from the list. | +| `/plugincontrol` | `action` | Check the current action. | +| `/plugincontrol` | `action ` | [Set the action to take.](#actions) | +| `/plugincontrol` | `kick-message` | Check the current kick message. | +| `/plugincontrol` | `kick-message ` | Set the kick message. | +| `/plugincontrol` | `enable \| on` | Enable PluginControl. | +| `/plugincontrol` | `disable \| off` | Disable PluginControl. | +| `/plugincontrol` | `toggle` | Toggle PluginControl on or off. | +| `/plugincontrol` | `list` | List all plugins in the list. | +| `/plugincontrol` | `reload` | Reload the configuration and language files. | -| Command | Sub Command | Description | -|-------------------|-------------------|----------------------------------| -| `/plugincontrol` | `add ` | Add a plugin to the list. | -| `/plugincontrol` | `remove ` | Remove a plugin from the list. | -| `/plugincontrol` | `enable \| on` | Enable PluginControl. | -| `/plugincontrol` | `disable \| off` | Disable PluginControl. | -| `/plugincontrol` | `toggle` | Enable or disable PluginControl. | -| `/plugincontrol` | `list` | List all plugins in the list. | +Please note that the ``, `` and `` placeholders should be replaced with the specific +plugin name and kick message, respectively, as required. ## Permissions -| Permissions | Description | -|----------------------|---------------------------------------------| -| `plugincontrol.use` | Permission to use all [commands](#commands) | +| Permissions | Description | +|------------------------|------------------------------------------------| +| `plugincontrol.use` | Permission to use all [commands](#commands) | +| `plugincontrol.bypass` | Bypass the `disallow-player-login` in `action` | diff --git a/src/main/resources/lang.yml b/src/main/resources/lang.yml index 452b907..5901246 100644 --- a/src/main/resources/lang.yml +++ b/src/main/resources/lang.yml @@ -1,18 +1,18 @@ prefix: '[PluginControl]' console: checking-plugins: ' Checking plugins...' - disabling-server: ' Disabling server because was not found or enabled successful!' + disabling-server: ' Disabling server because was not found or enabled successfully!' finished-checking: ' Plugins successfully verified!' - log-to-console: ' Plugin not found or enabled successful...' + log-to-console: ' Plugin not found or enabled successfully...' command: action-list: ' Actions available: ' action-set: ' Action set to !' action-type: ' Action type: !' - command-not-found: 'Use / | ' + command-not-found: 'Usage: / | ' kick-message: ' Kick message: ' kick-message-set: ' Kick message set to !' no-permission-error: ' You do not have permission to use this command' - plugin-add-error: 'Use / add [plugin-name]' + plugin-add-error: 'Usage: / add [plugin-name]' plugin-added: ' Plugin added successfully!' plugin-already-added: ' Plugin already added!' plugin-disabled: ' Deactivating plugin features...' @@ -21,5 +21,5 @@ command: plugin-list-empty: ' No plugins added!' plugin-not-found: ' Plugin not found in the list!' plugin-reload: ' Config and Language reloaded!' - plugin-remove-error: 'Use / remove ' - plugin-removed: ' Plugin removed!' + plugin-remove-error: 'Usage: / remove ' + plugin-removed: ' Plugin removed!' \ No newline at end of file