PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
BroadcastLoggerForwarder.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
22declare(strict_types=1);
23
24namespace pocketmine\utils;
25
30use pocketmine\permission\PermissibleDelegateTrait;
32use const PHP_INT_MAX;
33
42 use PermissibleDelegateTrait;
43
44 public function __construct(
45 private Server $server, //annoying useless dependency
46 private \Logger $logger,
47 private Language $language
48 ){
49 //this doesn't need any permissions
50 $this->perm = new PermissibleBase([]);
51 }
52
53 public function getLanguage() : Language{
54 return $this->language;
55 }
56
57 public function sendMessage(Translatable|string $message) : void{
58 if($message instanceof Translatable){
59 $this->logger->info($this->language->translate($message));
60 }else{
61 $this->logger->info($message);
62 }
63 }
64
65 public function getServer() : Server{
66 return $this->server;
67 }
68
69 public function getName() : string{
70 return "Broadcast Logger Forwarder";
71 }
72
73 public function getScreenLineHeight() : int{
74 return PHP_INT_MAX;
75 }
76
77 public function setScreenLineHeight(?int $height) : void{
78 //NOOP
79 }
80}