PocketMine-MP icon indicating copy to clipboard operation
PocketMine-MP copied to clipboard

Allow script plugins without metadata

Open SOF3 opened this issue 6 years ago • 3 comments

Script plugins are designed to allow developers to test something with a plugin context very quickly. Typing the metadata is a waste of time and a big distraction.

It is proposed that PocketMine automatically detects the namespace and main class name of a script plugin (by scanning extends PluginBase from the lexer function token_get_all()) and generate a name automatically according to the script name (e.g. fooBar.php -> fooBar_Script). Version can be auto-generated, and API can be automatically matched, since this is not the main point of a script plugin.

On the other hand, to prevent abuse of script plugins, PocketMine may show a big warning/notice about the script plugin being loaded.

SOF3 avatar Mar 14 '19 13:03 SOF3

Would it be preferable to only allow script plugins to run when pocketmine::IS_DEVELOPMENT_BUILD === true?

95CivicSi avatar Mar 14 '19 15:03 95CivicSi

I don't think so. The stated purpose of script plugins is to allow plugin developers to quickly test features. Restricting them to dev builds would be unnecessary and remove what little convenience they have already.

dktapps avatar Mar 14 '19 15:03 dktapps

More precisely, pocketmine::IS_DEVELOPMENT_BUILD only implies the core is indev, while we are targeting plugin developers not core developers here.

SOF3 avatar Mar 14 '19 15:03 SOF3

This was partially implemented in #6889. I don't think allowing the metadata to be fully omitted makes sense though, given the complexity imposed and the potential for abuse.

dktapps avatar Dec 18 '25 13:12 dktapps