Skip to content

Instantly share code, notes, and snippets.

@inxomnyaa
Created March 10, 2020 15:21
Show Gist options
  • Save inxomnyaa/e55cd4edcdefa819971d977f8910116c to your computer and use it in GitHub Desktop.
Save inxomnyaa/e55cd4edcdefa819971d977f8910116c to your computer and use it in GitHub Desktop.
My folder structure:
PM
- virions
-- virion.phar
- pmmp
-- <minecraft_version> i.e. 1.14
--- pmmp.phar
I added the folders "1.14" and "virions" to "External Libraries" on the bottom of the "Project" list/sidebar
right click "PHP" and choose "Include path"
it is also good to select "CLI Interpreter" in the UI that will open, there is a button [...] on the right, click that, give it any name and as "PHP Executable" select the php.exe in pocketmine /bin/php folder
oh and i suggest you download phpstorm-stubs repo somewhere and click "PHP Runtime" tab in that UI and then on bottom choose "Default stubs path", there select path to phpstorm-stubs repo
then click "Sync Extensions with Interpreter" and hit apply
---
I also added a build configuration so i can click "Run" and it creates a .phar of my project (of current file opened) in my /plugins folder, i like it better than having the plugin source code in /plugins, because if you want to remove the plugin from the server, you just delete the phar, and do not have to move the whole PHPStorm project somewhere
---
PHAR build
---
in the top bar there is "Run" -> "Edit configurations"
Add a PHP script on the left, name it something,
File: Z:\PocketMine\PocketMine-MP_2020\plugins\DevTools.phar
(use your path to devtools)
Arguments: --make "$ContentRoot$" --out "Z:\PocketMine\PocketMine-MP_2020\plugins\$ModuleName$.phar"
make sure to change the path accordingly :P (output and devtools path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment