mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Fixed wrong paths
This commit is contained in:
131
src/pocketmine/command/ConsoleCommandSender.php
Normal file
131
src/pocketmine/command/ConsoleCommandSender.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\command;
|
||||
|
||||
use pocketmine\permission\PermissibleBase;
|
||||
use pocketmine\permission\PermissionAttachment;
|
||||
use pocketmine\plugin\Plugin;
|
||||
use pocketmine\Server;
|
||||
|
||||
class ConsoleCommandSender implements CommandSender{
|
||||
|
||||
private $perm;
|
||||
|
||||
public function __construct(){
|
||||
$this->perm = new PermissibleBase($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \pocketmine\permission\Permission|string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPermissionSet($name){
|
||||
return $this->perm->isPermissionSet($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \pocketmine\permission\Permission|string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPermission($name){
|
||||
return $this->perm->hasPermission($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Plugin $plugin
|
||||
* @param string $name
|
||||
* @param bool $value
|
||||
*
|
||||
* @return \pocketmine\permission\PermissionAttachment
|
||||
*/
|
||||
public function addAttachment(Plugin $plugin, $name = null, $value = null){
|
||||
return $this->perm->addAttachment($plugin, $name, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PermissionAttachment $attachment
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeAttachment(PermissionAttachment $attachment){
|
||||
$this->perm->removeAttachment($attachment);
|
||||
}
|
||||
|
||||
public function recalculatePermissions(){
|
||||
$this->perm->recalculatePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \pocketmine\permission\PermissionAttachmentInfo[]
|
||||
*/
|
||||
public function getEffectivePermissions(){
|
||||
return $this->perm->getEffectivePermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isPlayer(){
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \pocketmine\Server
|
||||
*/
|
||||
public function getServer(){
|
||||
return Server::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public function sendMessage($message){
|
||||
foreach(explode("\n", trim($message)) as $line){
|
||||
$line = trim($line);
|
||||
console($line);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(){
|
||||
return "CONSOLE";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isOp(){
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $value
|
||||
*/
|
||||
public function setOp($value){
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user