Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

New plugin scripting format draft

Comments in 'Plugin Development' started by shoghicp, May 9, 2015.

  1. shoghicp
    Offline

    shoghicp Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    433
    Plugins:
    14
    Minecraft User:
    shoghicp
    Hello plugin developers!

    Some of you will remember the old way of creating plugins on a single file. It might come back... In a different way.

    Sometimes you want to test an idea or just hook into a single event, but you don't so because writing a new plugin is a long and tedious task (lazy guy >.<). Well, we're working on a new single-file plugin format to write simple scripts.

    There are drawbacks, as well. You can't have embedded resources or complex types in the descriptor part (example, arrays for authors). Also, all the code is saved in clear-text, and you won't be able to submit it as a plugin on the repository.

    This is not a replacement for the current format, it's just an addition. You can see the auto-documenting example on a Gist

    Please check it out and give feedback. This is not final in any means, it's just the first draft.

  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Would be good for old API Developers, but not that good for new ones. In my opinion, a nice addition if both ways can be used.
  3. shoghicp
    Offline

    shoghicp Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    433
    Plugins:
    14
    Minecraft User:
    shoghicp
    Remember, you can't release the single-file plugin. This is only for fast server scripting by the end-user or prototyping. So "Old API" developers still need to do the same as on normal plugins (syntax is equal) except that you can do everything on a single file.
    iksaku, hoyinm14mc and 64FF00 like this.
  4. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    So having multiple classes in one file?
    hoyinm14mc and PEMapModder like this.
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Ah, well, I like it:)
  6. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    DunxandMinecraft and 64FF00 like this.
  7. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Me gusta.
    jython234 and iksaku like this.
  8. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    This would be amazing for testing new API methods. Epic.
    iksaku, 64FF00 and Darunia18 like this.
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This thing has nothing to do with the old API at all. The API is just still the new API. It is plainly 1.4+ plugins having all files merged into one with a slightly different manifest format.
  10. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Wow! Good work! :D
  11. sekjun9878
    Offline

    sekjun9878 Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    108
    Plugins:
    1
    Minecraft User:
    sekjun9878
    Well really, all that is needed to implement this, is checking if a class exists before calling the autoloader and checking if the plugin has annotated plugin descriptors. Really with PocketMine's autoloader, there is absolutely no reason to prefer single-file plugins because that would be pretty much concatenating multiple files into one without any meaningful difference in syntax, features or simplicity.

    But if one is so keen on having the plugin in a single file, this seems like a good middle ground!
    Darunia18 and EvolSoft like this.
  12. shoghicp
    Offline

    shoghicp Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    433
    Plugins:
    14
    Minecraft User:
    shoghicp
    @sekjun9878 As specified in the post, this is not for normal plugin development, only fast scripting and/or testing. You won't be able to publish this plugin and it also has some drawbacks that make it non-useful for normal development.
    iksaku, Darunia18, hoyinm14mc and 2 others like this.
  13. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    So will we still need to make phars, or pocketmine would load it just like that?
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Load it like that.
    This is not a way for making proper plugins.
    Plugins will not be accepted if you do that.
  15. Humerus
    Offline

    Humerus Staff Member Plugin Reviewer

    Joined:
    Aug 23, 2013
    Posts:
    114
    Plugins:
    1
    I think a good question would be more around how to select whether or not to enable the system/how to actually use it.
    For example:
    • Would debug have to be enabled for the server in order to use these snippets?
    • Would you just drop the file into the plugins/ folder, or is it a different location?
    Also, what other features could be included with this? (i.e. autoreload on file change?)
    Overall, it would beat having to use DevTools to load a skeleton and modify it :)
    jojoe77777, Falk, PEMapModder and 2 others like this.
  16. shoghicp
    Offline

    shoghicp Staff Member PocketMine Team

    Joined:
    Aug 22, 2013
    Posts:
    433
    Plugins:
    14
    Minecraft User:
    shoghicp
    Setting the debug level is a good idea, I might do that with devtools as well. It would just be dropped in plugins/ as a .php file, so it won't collide with source plugins. Reload is still impossible (can't unload declared classes)
    iksaku likes this.
  17. Humerus
    Offline

    Humerus Staff Member Plugin Reviewer

    Joined:
    Aug 23, 2013
    Posts:
    114
    Plugins:
    1
    By reload i meant restart the server, but i see how that could be undesirable. Other than that, sounds good!
  18. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    It's great when i got an idea i need to make new plugin just to test few line codes and thats so anoying >.<, but this is da perfect solution Huraay.
    iksaku and PEMapModder like this.
  19. ProjectInfinity
    Offline

    ProjectInfinity Active Member Plugin Developer

    Joined:
    Sep 7, 2014
    Posts:
    112
    Plugins:
    3
    Minecraft User:
    ProjectInfinity
    Whatever floats your boat! I guess for testing purposes it's alright. :)
  20. PlayCubePE
    Offline

    PlayCubePE New Member

    Joined:
    Mar 19, 2015
    Posts:
    29
    Minecraft User:
    PlayCubePE
    When will it be released ?

Share This Page

Advertisement