Plug
Plug
Plug allows you to manage your plugins by enabling, disabling, and reloading them. The plugin is simple, and does not need any configuration since there is no configuration file.
Commands
- /plug list - Shows all plugins and the data folder associated with it.
- /plug help - Shows all commands and help on how they work
- /plug enable <plugin | all> - Enables the selected plugin or "all"
- /plug disable <plugin | all> - Disables the selected plugin or "all"
- /plug reload <plugin | all> - Reload the selected plugin or "all"
- /plug reloadconfig <plugin> - Reloads plugins config file ONLY.
- /plug blacklist - Shows blacklist
- /plug blacklist <add | del> <plugin> - Adds or deletes plugin from blacklist
- /plug blacklist <enable | disable> - Toggles functionality of blacklist
Permissions
Since all functionality is administrative, there is one permission to use any commands in Plug.
- plug.use - Administrative plugin use
- plug.grantpl - For allowing users to use /pl and /plugins
Configuration
Here is an example config file. If you do not want a black list, use blacklist: []
custom: blacklist: [] general: enable-blacklist: true enable-metrics: true enable-debug: true enable-debug-sender: true operation: enable-on-load: true override: restrict-pl-command: false use-pl-list: false
For version 1.3, the following features are planned.
- Groups, are plugins grouped together in the config. For example /plug reload GroupName. This will reload all plugins defined in that group.
- Inline groups such as /plug reload Plugin1,Plugin3,Plugin5. This will reload all three plugins. (no spacing with commas!)
- Update checking for convinience. Can be disabled in config.
- Info command for pulling plugin information
Usage Statistics
Note: Only versions v1.1 and greater will show up on the statistics.
@ThisUsernameIsMine
yes I have looked at the plugins that do this and it seems that they are messing around with class loaders and on registering things which is slightly dangerous in certain ways. The problem with this is that usually it's easy to delete a plugin by simply disabling it. Most of the things that are loaded by the plugin are also unloaded by the plug in when the plugin is disabled. I think that the unknown command is more of a forceful way.
the load command does actually have load a plugin from the plugins folder. Technically in another plugin unloaded the plugin, plugs load ommand might work. I'm still thinking about implementing an unload command but currently I see that this is not needed in many cases.
also about implementing this yourself it's actually pretty easy. Once you learn Java and add your plugin for development, you simply have to create a command. Once you learn how to use the command functionality of bukkit, use
getServer().getpluginManager().loadPlugin(new File("plugins/" + <plugin> + ".jar"));
You will need to surround this with a try and catch thing. Make sure you understand java. Also, the getplugonmanager method actually has a lot of things which are the basis of plug
@cyberpwn
Thanks for the explanation (i <3 TLDR's) xd.
I'm asking this because there are other plugins that are able to do this, thus thought it would be a nice addition to your plugin :-)
Will check out 1.2 soon. Thanks a lot for implementing this! (i can't do it myself, yet... but learning from some YT tutorials).
+Like ;-)
@ThisUsernameIsMine
so I have been looking at this for a good amount of time now. When a plugin is disabled it is able to be deleted, however in the /pl and Bukkit plugin list it is still there however it's marked as deleted. Unloading a plugin simply hides it from the list as it is already disabled. In version 1.2 I am thinking about adding the load and unload commands for installing new plugins. However I think there is only a need for the load command since disabled is basically an unload function.
currently in version 1.0 and version 1.1, to unload a plugin meaning deleting the plugin from the folder simply disable the plug in and delete the jar file. This should remove it from the Bukkit plugin listing. Currently plug cannot load new jar files as plugins because they have not been indexed in the plugin list. Bucket API's offer a load functionality for this issue but they do not supply in unload function because the disable function works as an unload function.
I think version 1.2 will have load and unload functions which will update a custom plugin list in both the plugin commands and the server PL command. This will give you the ability to unload plugins and so they won't show up in a list and load plugins for installing plugins for the first time.
Can you make unloading of plugins possible? (so that you can update or delete the file if no longer needed).