mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Added capability to get/set screen height in lines for each CommandSender to alter page sizes of command output such as /help (#1144)
This commit is contained in:
@ -31,11 +31,15 @@ use pocketmine\permission\PermissionAttachmentInfo;
|
||||
use pocketmine\plugin\Plugin;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\utils\MainLogger;
|
||||
use pocketmine\utils\Terminal;
|
||||
|
||||
class ConsoleCommandSender implements CommandSender{
|
||||
|
||||
private $perm;
|
||||
|
||||
/** @var int|null */
|
||||
protected $lineHeight = null;
|
||||
|
||||
public function __construct(){
|
||||
$this->perm = new PermissibleBase($this);
|
||||
}
|
||||
@ -139,4 +143,15 @@ class ConsoleCommandSender implements CommandSender{
|
||||
|
||||
}
|
||||
|
||||
public function getScreenLineHeight() : int{
|
||||
return $this->lineHeight ?? PHP_INT_MAX;
|
||||
}
|
||||
|
||||
public function setScreenLineHeight(int $height = null){
|
||||
if($height !== null and $height < 1){
|
||||
throw new \InvalidArgumentException("Line height must be at least 1");
|
||||
}
|
||||
$this->lineHeight = $height;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user