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
22
declare(strict_types=1);
23
24
namespace
pocketmine\utils
;
25
26
use
pocketmine\command\CommandSender
;
27
use
pocketmine\lang\Language
;
28
use
pocketmine\lang\Translatable
;
29
use
pocketmine\permission\PermissibleBase
;
30
use pocketmine\permission\PermissibleDelegateTrait;
31
use
pocketmine\Server
;
32
use
const
PHP_INT_MAX;
33
41
final
class
BroadcastLoggerForwarder
implements
CommandSender
{
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
}
pocketmine\Server
Definition
src/Server.php:179
pocketmine\lang\Language
Definition
Language.php:47
pocketmine\lang\Translatable
Definition
Translatable.php:26
pocketmine\permission\PermissibleBase
Definition
PermissibleBase.php:26
pocketmine\utils\BroadcastLoggerForwarder
Definition
BroadcastLoggerForwarder.php:41
pocketmine\utils\BroadcastLoggerForwarder\setScreenLineHeight
setScreenLineHeight(?int $height)
Definition
BroadcastLoggerForwarder.php:77
pocketmine\utils\BroadcastLoggerForwarder\getScreenLineHeight
getScreenLineHeight()
Definition
BroadcastLoggerForwarder.php:73
Logger
Definition
Logger.php:18
pocketmine\command\CommandSender
Definition
CommandSender.php:31
pocketmine\utils
Definition
AssumptionFailedError.php:24
src
utils
BroadcastLoggerForwarder.php
Generated by
1.12.0