PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
ConsoleCommandSender.php
1 <?php
2 
3 /*
4  *
5  * ____ _ _ __ __ _ __ __ ____
6  * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7  * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8  * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9  * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10  *
11  * This program is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * @author PocketMine Team
17  * @link http://www.pocketmine.net/
18  *
19  *
20 */
21 
22 namespace pocketmine\command;
23 
29 
31 
32  private $perm;
33 
34  public function __construct(){
35  $this->perm = new PermissibleBase($this);
36  }
37 
43  public function isPermissionSet($name){
44  return $this->perm->isPermissionSet($name);
45  }
46 
52  public function hasPermission($name){
53  return $this->perm->hasPermission($name);
54  }
55 
63  public function addAttachment(Plugin $plugin, $name = null, $value = null){
64  return $this->perm->addAttachment($plugin, $name, $value);
65  }
66 
72  public function removeAttachment(PermissionAttachment $attachment){
73  $this->perm->removeAttachment($attachment);
74  }
75 
76  public function recalculatePermissions(){
77  $this->perm->recalculatePermissions();
78  }
79 
83  public function getEffectivePermissions(){
84  return $this->perm->getEffectivePermissions();
85  }
86 
90  public function isPlayer(){
91  return false;
92  }
93 
97  public function getServer(){
98  return Server::getInstance();
99  }
100 
104  public function sendMessage($message){
105  foreach(explode("\n", trim($message)) as $line){
106  MainLogger::getLogger()->info($line);
107  }
108  }
109 
113  public function getName(){
114  return "CONSOLE";
115  }
116 
120  public function isOp(){
121  return true;
122  }
123 
127  public function setOp($value){
128 
129  }
130 
131 }
static getInstance()
Definition: Server.php:1444
removeAttachment(PermissionAttachment $attachment)
addAttachment(Plugin $plugin, $name=null, $value=null)