mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 11:16:57 +00:00
Merge pull request #51 from sekjun9878/master
Added chat() function in ChatAPI. Also PlayerAPI Documentation
This commit is contained in:
40
documentation/BlockAPI.txt
Normal file
40
documentation/BlockAPI.txt
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
-
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
/ PocketMine \
|
||||||
|
/ MP \
|
||||||
|
|\ @shoghicp /|
|
||||||
|
|. \ / .|
|
||||||
|
| .. \ / .. |
|
||||||
|
| .. | .. |
|
||||||
|
| .. | .. |
|
||||||
|
\ | /
|
||||||
|
\ | /
|
||||||
|
\ | /
|
||||||
|
\ | /
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
#Authored By: sekjun9878
|
||||||
|
#Author's Email: sekjun9878@gmail.com
|
||||||
|
#
|
||||||
|
#BlokAPI Function Documentation.
|
||||||
|
#
|
||||||
|
#Version Alpha
|
||||||
|
#Revision Alpha
|
||||||
|
|
||||||
|
public function blockBreak($data, $event)
|
||||||
|
Description:
|
||||||
|
Breajs a block on the map.
|
||||||
|
Parameters:
|
||||||
|
$name = Array of
|
||||||
|
$data["x"] = x coordinate
|
||||||
|
$data["y"] = y coordinate
|
||||||
|
$data["z"] = z coordinate
|
||||||
|
$event //
|
||||||
|
Return Values:
|
||||||
|
true = If the block is unbreakable
|
||||||
|
|
92
documentation/PlayerAPI.txt
Normal file
92
documentation/PlayerAPI.txt
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
-
|
||||||
|
/ \
|
||||||
|
/ \
|
||||||
|
/ PocketMine \
|
||||||
|
/ MP \
|
||||||
|
|\ @shoghicp /|
|
||||||
|
|. \ / .|
|
||||||
|
| .. \ / .. |
|
||||||
|
| .. | .. |
|
||||||
|
| .. | .. |
|
||||||
|
\ | /
|
||||||
|
\ | /
|
||||||
|
\ | /
|
||||||
|
\ | /
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
#Authored By: sekjun9878
|
||||||
|
#Author's Email: sekjun9878@gmail.com
|
||||||
|
#
|
||||||
|
#PlayerAPI Function Documentation.
|
||||||
|
#
|
||||||
|
#Version Alpha
|
||||||
|
#Revision Alpha
|
||||||
|
|
||||||
|
public function teleport($name, $target)
|
||||||
|
Description:
|
||||||
|
Teleports a player to another player on the map.
|
||||||
|
Parameters:
|
||||||
|
$name = Name of the player to teleport.
|
||||||
|
$target = Name of the target player.
|
||||||
|
Return Values:
|
||||||
|
true = If teleported successfully
|
||||||
|
false = If teleporting failed.
|
||||||
|
|
||||||
|
tppos//
|
||||||
|
|
||||||
|
public function get($name)
|
||||||
|
Description:
|
||||||
|
Returns data about a player using a player's username.
|
||||||
|
Parameters:
|
||||||
|
$name = Username to return data about.
|
||||||
|
Return Values:
|
||||||
|
An array of data about a particular player.
|
||||||
|
|
||||||
|
public function getAll()
|
||||||
|
Description:
|
||||||
|
Returns an two-dimentional array of data about all player on the server.
|
||||||
|
Parameters:
|
||||||
|
None
|
||||||
|
Return Values:
|
||||||
|
Two Dimentional Array of Data.
|
||||||
|
Examples:
|
||||||
|
foreach($this->api->player->getAll() as $c){
|
||||||
|
//TODO: Do whatever you want with $c
|
||||||
|
//Example: $c->username will give you username of every player on the server.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getByEID($eid)
|
||||||
|
Description:
|
||||||
|
Returns data about a player using a player's EID.
|
||||||
|
Parameters:
|
||||||
|
$eid = EID of a user to return data about.
|
||||||
|
Return Values:
|
||||||
|
An array of data about a particular player.
|
||||||
|
|
||||||
|
public function getByClientID($clientID)
|
||||||
|
Description:
|
||||||
|
Returns data about a player using a player's ClientID.
|
||||||
|
Parameters:
|
||||||
|
$name = clientID of a user to return data about.
|
||||||
|
Return Values:
|
||||||
|
An array of data about a particular player.
|
||||||
|
|
||||||
|
public function online()
|
||||||
|
Description:
|
||||||
|
Returns usernames all player on the server.
|
||||||
|
Parameters:
|
||||||
|
None
|
||||||
|
Return Values:
|
||||||
|
An array of strings containing usernames.
|
||||||
|
|
||||||
|
public function getOffline($name)
|
||||||
|
Description:
|
||||||
|
Returns data about a player's last status before disconnecting using a player's username.
|
||||||
|
Parameters:
|
||||||
|
$name = name of a user to return data about.
|
||||||
|
Return Values:
|
||||||
|
An array of data about a particular player.
|
@ -26,6 +26,17 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class ChatAPI{
|
class ChatAPI{
|
||||||
|
private $server;
|
||||||
|
function __construct(PocketMinecraftServer $server){
|
||||||
|
$this->server = $server;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function init(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function send($a, $b){//a == name of owner. b == message
|
||||||
|
$this->server->chat($a, $b);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user