mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +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:
@ -325,6 +325,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
/** @var PermissibleBase */
|
||||
private $perm = null;
|
||||
|
||||
/** @var int|null */
|
||||
protected $lineHeight = null;
|
||||
|
||||
public function getLeaveMessage(){
|
||||
return new TranslationContainer(TextFormat::YELLOW . "%multiplayer.player.left", [
|
||||
$this->getDisplayName()
|
||||
@ -461,6 +464,17 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->removeFormat = (bool) $remove;
|
||||
}
|
||||
|
||||
public function getScreenLineHeight() : int{
|
||||
return $this->lineHeight ?? 7;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Player $player
|
||||
*
|
||||
|
Reference in New Issue
Block a user