mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Revert "Added coordinates command. Displays your coordinates"
This reverts commit 4434fe2a5b
.
This commit is contained in:
@ -34,8 +34,6 @@ class ChatAPI{
|
|||||||
public function init(){
|
public function init(){
|
||||||
$this->server->api->console->register("tell", "<player> <private message ...>", array($this, "commandHandler"));
|
$this->server->api->console->register("tell", "<player> <private message ...>", array($this, "commandHandler"));
|
||||||
$this->server->api->console->register("me", "<action ...>", array($this, "commandHandler"));
|
$this->server->api->console->register("me", "<action ...>", array($this, "commandHandler"));
|
||||||
$this->server->api->console->register("coordinates", "", array($this, "commandHandler"));
|
|
||||||
$this->server->api->ban->cmdWhitelist("coordinates");
|
|
||||||
$this->server->api->ban->cmdWhitelist("tell");
|
$this->server->api->ban->cmdWhitelist("tell");
|
||||||
$this->server->api->ban->cmdWhitelist("me");
|
$this->server->api->ban->cmdWhitelist("me");
|
||||||
}
|
}
|
||||||
@ -43,22 +41,6 @@ class ChatAPI{
|
|||||||
public function commandHandler($cmd, $params, $issuer, $alias){
|
public function commandHandler($cmd, $params, $issuer, $alias){
|
||||||
$output = "";
|
$output = "";
|
||||||
switch($cmd){
|
switch($cmd){
|
||||||
case "coordinates":
|
|
||||||
if(!($issuer instanceof Player))
|
|
||||||
{//Console with player not specified
|
|
||||||
$output .= "[ERROR] Console cannot get his own position";//Print Error
|
|
||||||
}
|
|
||||||
else if($issuer instanceof Player)
|
|
||||||
{
|
|
||||||
$sender = $issuer->username;//Issued by player
|
|
||||||
$msg = "Your location is x=".$issuer->entity->x." y=".$issuer->entity->y." z=".$issuer->entity->z;
|
|
||||||
$this->sendTo(false, $msg, $sender);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$output .= "[ERROR] Command: Coordiates. Unknown sender.";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "me":
|
case "me":
|
||||||
if(!($issuer instanceof Player)){
|
if(!($issuer instanceof Player)){
|
||||||
$sender = "Console";
|
$sender = "Console";
|
||||||
@ -124,4 +106,4 @@ class ChatAPI{
|
|||||||
}
|
}
|
||||||
$this->server->handle("server.chat", new Container($message, $whitelist, $blacklist));
|
$this->server->handle("server.chat", new Container($message, $whitelist, $blacklist));
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user