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

[NewAPI] [TUTORIAL] How to make .phar plugins

Comments in 'Plugin Development' started by iksaku, May 13, 2014.

?

Does this method work for you?

  1. Yes, thank you!

    100.0%
  2. No, maybe it's my fault...

    0 vote(s)
    0.0%
  1. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Hey coders!

    As many of you already know, a new version of Minecraft PE is coming with a lot of new and exciting features; to support it, the PocketMine Team is developing a brand new version of our favorite server software: PocketMine-MP 1.4!

    This new version of PocketMine-MP also require a complete re-write of our plugins, that means a new API to learn, this is the "API 1.0.0" (not "API 14" :p)

    A lot of you are already learning the new API and testing your plugins with DevTools, but some get stuck while converting it to a .phar file, but don't worry, here is the solution:

    How to convert your plugins to a .phar file:

    1.- Your plugin need to work with the new API 1.0.0
    2.- In your PocketMine directory go to /bin/php/
    3.- Open the file php.ini
    4.- Search for the [Phar] category and you will see something like:

    5.- Delete the ; at the start of the line and change the On value to Off
    6.- Save the file
    7.- Start your server, send the /makeplugin <plugin> command and you're done!

    This should work, if not... Then your plugin is not compatible or doesn't work with the new API.

    The .phar plugin can be found in the
    /plugins/DevTools directory.

    Thanks for reading!
    (Sorry for my bad english :p)
    Last edited: May 13, 2014
    Andrey Nazarchuk and Darunia18 like this.
  2. SirBlaze
    Offline

    SirBlaze Active Member

    Joined:
    Feb 1, 2014
    Posts:
    35
    Minecraft User:
    Franks12345
    Thanks im going to try this now :)
    iksaku likes this.
  3. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    iksaku and 64FF00 like this.
  4. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    how do you open a phar file?
  5. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    754
    Plugins:
    2
    Minecraft User:
    Darunia18
    You don't. A phar archive is kind of like a folder on your computer full of files, except you can't access them (as far as I know) without unzipping it. Then, you'll find lots of php, and maybe some yml files in it. Of course, I think the New-API DevTools lets you zip and unzip phar archives.
    Andrey Nazarchuk likes this.
  6. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    .phar is just a zip file with a manifest if I am not mistaken :)
    Last edited: May 19, 2014
    Andrey Nazarchuk, Darunia18 and bahaa like this.
  7. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    oh ok thanks
    was thinking of making a doorlocking plugin with @Wantedkillerss in API 1.0.0
  8. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    BTW do you know how to unzip it?
    Can I just extract it with WinRar?
  9. BlinkSun
    Offline

    BlinkSun Active Member Plugin Developer

    Joined:
    Mar 26, 2014
    Posts:
    128
    Plugins:
    4
    Minecraft User:
    BlinkSun
    API 1.0.0 or API #13 ?
  10. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    13

Share This Page

Advertisement