mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2025-03-02 10:42:01 +01:00
Further document methods.
This commit is contained in:
parent
509ee4b842
commit
86ecb3ede4
@ -15,6 +15,21 @@ DefaultParser - Tested on mc-central, should work decent globally
|
||||
|
||||
|
||||
def DefaultParser(data):
|
||||
"""The default Player chat packet parser, designed to make chat human readable.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
data : Chat Packet
|
||||
The chat packet to be parsed.
|
||||
|
||||
Returns
|
||||
-------
|
||||
message : str
|
||||
The chat message in human readable form
|
||||
False : bool
|
||||
If the parser encounters an error during parsing
|
||||
|
||||
"""
|
||||
try:
|
||||
# Convert to valid python dict
|
||||
data = json.loads(data)
|
||||
|
@ -22,7 +22,8 @@ class Player:
|
||||
--------
|
||||
This class explicitly expects a username & password, then expects to
|
||||
be able to connect to a server in online mode.
|
||||
If you wish to add different functionality please
|
||||
If you wish to add different functionality please view the example
|
||||
headless client `start.py` for how to implement it.
|
||||
"""
|
||||
|
||||
def __init__(self, username, password, *, admins=None):
|
||||
|
Loading…
Reference in New Issue
Block a user