mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Really minor changes.
This commit is contained in:
@@ -85,7 +85,10 @@ class PocketMinecraftServer{
|
||||
$this->load();
|
||||
}
|
||||
|
||||
public function getTPS(){
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getTPS(){
|
||||
$v = array_values($this->tickMeasure);
|
||||
$tps = 40 / ($v[39] - $v[0]);
|
||||
return round($tps, 4);
|
||||
@@ -179,7 +182,10 @@ class PocketMinecraftServer{
|
||||
return $info;
|
||||
}
|
||||
|
||||
public function close($reason = "server stop"){
|
||||
/**
|
||||
* @param string $reason
|
||||
*/
|
||||
public function close($reason = "server stop"){
|
||||
if($this->stop !== true){
|
||||
if(is_int($reason)){
|
||||
$reason = "signal stop";
|
||||
@@ -271,7 +277,14 @@ class PocketMinecraftServer{
|
||||
}
|
||||
}
|
||||
|
||||
public function addHandler($event,callable $callable, $priority = 5){
|
||||
/**
|
||||
* @param string $event
|
||||
* @param callable $callable
|
||||
* @param integer $priority
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function addHandler($event,callable $callable, $priority = 5){
|
||||
if(!is_callable($callable)){
|
||||
return false;
|
||||
}elseif(isset(Deprecation::$events[$event])){
|
||||
@@ -339,7 +352,10 @@ class PocketMinecraftServer{
|
||||
}
|
||||
}
|
||||
|
||||
public function getGamemode(){
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getGamemode(){
|
||||
switch($this->gamemode){
|
||||
case SURVIVAL:
|
||||
return "survival";
|
||||
|
Reference in New Issue
Block a user