Cleanup readme add writing plugins section

This commit is contained in:
Ammar Askar committed 2012-12-19 18:56:55 +05:00
1 parent 93055664fd
commit a6bc0b722d
1 file changed
+16 -7
+16 -7
View File
@@ -12,13 +12,22 @@ When running start.py, make sure you duck.
If you use Python 2.7 with win32 you're in luck, theres an installer right [here](http://www.secker.nl/wp-content/uploads/2012/03/pycrypto-2.5.win32-py2.7.exe) for pyCrypto 2.5 If you use Python 2.7 with win32 you're in luck, theres an installer right [here](http://www.secker.nl/wp-content/uploads/2012/03/pycrypto-2.5.win32-py2.7.exe) for pyCrypto 2.5
otherwise you're gonna need to compile it, followed by some fancy instructions on how to install pyCrypto over [here](http://www.secker.nl/2012/03/08/building-pycrypto-2-5-using-mingw-and-python-2-7-on-windows-xp/) otherwise you're gonna need to compile it, followed by some fancy instructions on how to install pyCrypto over [here](http://www.secker.nl/2012/03/08/building-pycrypto-2-5-using-mingw-and-python-2-7-on-windows-xp/)
Basically, run `pip install -r requirements.txt`, which should pull everything in. You need a compiler. ----------
Eventually we'll put some run instructions here. On linux you'll need the `build-essential` and `python-dev` packages after which running `pip install -r requirements.txt`, should pull everything in.
#Closing remarks Eventually we'll put some run instructions here but `start.py --help` should cover everything for now
Have fun!
#TODO #Writing Plugins for pyCraft
- Overhaul GUI pyCraft has some basic plugin support, as a developer making plugins is a simple process. In the plugins folder, simply create a .py file with your plugin's name as the file name.
(in case you haven't figured out already, I suck at GUIs in python. If you know what you're doing and wanna contribute, I'd appreciate some help :3) In your plugin.py file define a single class with the exact same spellings as your plugin file name. Now within your plugin class you'll be notified using certain methods when
things happen in the minecraft world. See the [PacketDumper plugin](https://github.com/ammaraskar/pyCraft/blob/master/plugins/PacketDumper.py) as an example. Currently these methods are
used:
```onEnable(self, parser)``` This fires when your plugin is loaded and passes the option parser as an argument allowing you to add custom command line options
```onDisable(self)``` This fires when pyCraft is exited cleanly, use it for cleaning up
```optionsParsed(self, parsedOptions)``` This fires when command line options have been parsed allowing you to get information from any parameters you may have added in onEnable
```packetReceive(self, packetID, receivedPacket)``` This fires when pyCraft's networking core receives a packet