mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Fixed some doc problems
This commit is contained in:
parent
c0377fc63a
commit
a365c831a8
@ -291,7 +291,7 @@ namespace pocketmine {
|
||||
/**
|
||||
* @param string $offset In the format of +09:00, +02:00, -04:00 etc.
|
||||
*
|
||||
* @return string
|
||||
* @return string|bool
|
||||
*/
|
||||
function parse_offset($offset){
|
||||
//Make signed offsets unsigned for date_parse
|
||||
|
@ -680,7 +680,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
* @param Vector3 $pos1
|
||||
* @param Vector3 $pos2
|
||||
*
|
||||
* @return MovingObjectPosition
|
||||
* @return MovingObjectPosition|null
|
||||
*/
|
||||
public function calculateIntercept(Vector3 $pos1, Vector3 $pos2){
|
||||
$bb = $this->getBoundingBox();
|
||||
|
@ -139,7 +139,7 @@ abstract class Command{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPermission(){
|
||||
return $this->commandData["pocketminePermission"] ?? null;
|
||||
|
@ -160,7 +160,7 @@ class CommandReader extends Thread{
|
||||
*/
|
||||
public function getLine(){
|
||||
if($this->buffer->count() !== 0){
|
||||
return $this->buffer->shift();
|
||||
return (string) $this->buffer->shift();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -133,7 +133,7 @@ class ParticleCommand extends VanillaCommand{
|
||||
* @param float $zd
|
||||
* @param int|null $data
|
||||
*
|
||||
* @return Particle
|
||||
* @return Particle|null
|
||||
*/
|
||||
private function getParticle($name, Vector3 $pos, $xd, $yd, $zd, $data){
|
||||
switch($name){
|
||||
|
@ -698,7 +698,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
* @param CompoundTag $nbt
|
||||
* @param $args
|
||||
*
|
||||
* @return Entity
|
||||
* @return Entity|null
|
||||
*/
|
||||
public static function createEntity($type, Level $level, CompoundTag $nbt, ...$args){
|
||||
if(isset(self::$knownEntities[$type])){
|
||||
@ -1897,7 +1897,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
/**
|
||||
* @param int $id
|
||||
*
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getDataPropertyType($id){
|
||||
return isset($this->dataProperties[$id]) ? $this->dataProperties[$id][0] : null;
|
||||
|
@ -328,7 +328,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
* @param int $maxDistance
|
||||
* @param array $transparent
|
||||
*
|
||||
* @return Block
|
||||
* @return Block|null
|
||||
*/
|
||||
public function getTargetBlock($maxDistance, array $transparent = []){
|
||||
try{
|
||||
|
@ -36,7 +36,9 @@ abstract class Event{
|
||||
* Not doing so will deny the proper event initialization
|
||||
*/
|
||||
|
||||
/** @var string|null */
|
||||
protected $eventName = null;
|
||||
/** @var bool */
|
||||
private $isCancelled = false;
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ class TranslationContainer extends TextContainer{
|
||||
/**
|
||||
* @param int $i
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getParameter($i){
|
||||
return isset($this->params[$i]) ? $this->params[$i] : null;
|
||||
|
@ -36,6 +36,7 @@ use pocketmine\entity\Vehicle;
|
||||
class EntityDespawnEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
|
||||
/** @var int */
|
||||
private $entityType;
|
||||
|
||||
/**
|
||||
|
@ -36,6 +36,7 @@ use pocketmine\entity\Vehicle;
|
||||
class EntitySpawnEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
|
||||
/** @var int */
|
||||
private $entityType;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,9 @@ use pocketmine\utils\Utils;
|
||||
class LowMemoryEvent extends ServerEvent{
|
||||
public static $handlerList = null;
|
||||
|
||||
/** @var int */
|
||||
private $memory;
|
||||
/** @var int */
|
||||
private $memoryLimit;
|
||||
private $triggerCount;
|
||||
private $global;
|
||||
@ -60,7 +62,7 @@ class LowMemoryEvent extends ServerEvent{
|
||||
* @return int
|
||||
*/
|
||||
public function getMemoryLimit(){
|
||||
return $this->memory;
|
||||
return $this->memoryLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -151,7 +151,7 @@ class CraftingManager{
|
||||
|
||||
/**
|
||||
* @param UUID $id
|
||||
* @return Recipe
|
||||
* @return Recipe|null
|
||||
*/
|
||||
public function getRecipe(UUID $id){
|
||||
$index = $id->toBinary();
|
||||
@ -175,7 +175,7 @@ class CraftingManager{
|
||||
/**
|
||||
* @param Item $input
|
||||
*
|
||||
* @return FurnaceRecipe
|
||||
* @return FurnaceRecipe|null
|
||||
*/
|
||||
public function matchFurnaceRecipe(Item $input){
|
||||
if(isset($this->furnaceRecipes[$input->getId() . ":" . $input->getDamage()])){
|
||||
|
@ -51,7 +51,7 @@ class InventoryType{
|
||||
/**
|
||||
* @param $index
|
||||
*
|
||||
* @return InventoryType
|
||||
* @return InventoryType|null
|
||||
*/
|
||||
public static function get($index){
|
||||
return static::$default[$index] ?? null;
|
||||
|
@ -294,7 +294,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
/**
|
||||
* @param $index
|
||||
*
|
||||
* @return Item
|
||||
* @return Item|null
|
||||
*/
|
||||
public static function getCreativeItem(int $index){
|
||||
return Item::$creative[$index] ?? null;
|
||||
|
@ -1848,7 +1848,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
/**
|
||||
* @param int $entityId
|
||||
*
|
||||
* @return Entity
|
||||
* @return Entity|null
|
||||
*/
|
||||
public function getEntity(int $entityId){
|
||||
return $this->entities[$entityId] ?? null;
|
||||
@ -1935,7 +1935,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
/**
|
||||
* @param $tileId
|
||||
*
|
||||
* @return Tile
|
||||
* @return Tile|null
|
||||
*/
|
||||
public function getTileById(int $tileId){
|
||||
return $this->tiles[$tileId] ?? null;
|
||||
@ -1962,7 +1962,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
*
|
||||
* @param Vector3 $pos
|
||||
*
|
||||
* @return Tile
|
||||
* @return Tile|null
|
||||
*/
|
||||
public function getTile(Vector3 $pos){
|
||||
$chunk = $this->getChunk($pos->x >> 4, $pos->z >> 4, false);
|
||||
@ -2196,7 +2196,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @param int $z
|
||||
* @param bool $create Whether to generate the chunk if it does not exist
|
||||
*
|
||||
* @return Chunk
|
||||
* @return Chunk|null
|
||||
*/
|
||||
public function getChunk(int $x, int $z, bool $create = false){
|
||||
if(isset($this->chunks[$index = Level::chunkHash($x, $z)])){
|
||||
|
@ -33,6 +33,12 @@ class SimpleChunkManager implements ChunkManager{
|
||||
protected $seed;
|
||||
protected $worldHeight;
|
||||
|
||||
/**
|
||||
* SimpleChunkManager constructor.
|
||||
*
|
||||
* @param int $seed
|
||||
* @param int $worldHeight
|
||||
*/
|
||||
public function __construct($seed, int $worldHeight = Level::Y_MAX){
|
||||
$this->seed = $seed;
|
||||
$this->worldHeight = $worldHeight;
|
||||
|
@ -67,12 +67,13 @@ class Chunk{
|
||||
/** @var Entity[] */
|
||||
protected $entities = [];
|
||||
|
||||
/** @var int[256] */
|
||||
/** @var int[] */
|
||||
protected $heightMap = [];
|
||||
|
||||
/** @var string */
|
||||
protected $biomeIds;
|
||||
|
||||
/** @var int[] */
|
||||
protected $extraData = [];
|
||||
|
||||
/** @var CompoundTag[] */
|
||||
|
@ -430,7 +430,7 @@ class McRegion extends BaseLevelProvider{
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @return RegionLoader
|
||||
* @return RegionLoader|null
|
||||
*/
|
||||
protected function getRegion(int $x, int $z){
|
||||
return $this->regions[Level::chunkHash($x, $z)] ?? null;
|
||||
|
@ -245,7 +245,7 @@ class Vector3{
|
||||
* @param Vector3 $v
|
||||
* @param float $x
|
||||
*
|
||||
* @return Vector3
|
||||
* @return Vector3|null
|
||||
*/
|
||||
public function getIntermediateWithXValue(Vector3 $v, $x){
|
||||
$xDiff = $v->x - $this->x;
|
||||
@ -272,7 +272,7 @@ class Vector3{
|
||||
* @param Vector3 $v
|
||||
* @param float $y
|
||||
*
|
||||
* @return Vector3
|
||||
* @return Vector3|null
|
||||
*/
|
||||
public function getIntermediateWithYValue(Vector3 $v, $y){
|
||||
$xDiff = $v->x - $this->x;
|
||||
@ -299,7 +299,7 @@ class Vector3{
|
||||
* @param Vector3 $v
|
||||
* @param float $z
|
||||
*
|
||||
* @return Vector3
|
||||
* @return Vector3|null
|
||||
*/
|
||||
public function getIntermediateWithZValue(Vector3 $v, $z){
|
||||
$xDiff = $v->x - $this->x;
|
||||
|
@ -104,9 +104,9 @@ class BanEntry{
|
||||
/**
|
||||
* @param string $str
|
||||
*
|
||||
* @return BanEntry
|
||||
* @return BanEntry|null
|
||||
*/
|
||||
public static function fromString($str){
|
||||
public static function fromString(string $str){
|
||||
if(strlen($str) < 2){
|
||||
return null;
|
||||
}else{
|
||||
|
@ -47,7 +47,7 @@ class PharPluginLoader implements PluginLoader{
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return Plugin
|
||||
* @return Plugin|null
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
@ -80,7 +80,7 @@ class PharPluginLoader implements PluginLoader{
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return PluginDescription
|
||||
* @return PluginDescription|null
|
||||
*/
|
||||
public function getPluginDescription($file){
|
||||
$phar = new \Phar($file);
|
||||
|
@ -45,6 +45,9 @@ interface Plugin extends CommandExecutor{
|
||||
*/
|
||||
public function onEnable();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isEnabled();
|
||||
|
||||
/**
|
||||
|
@ -137,7 +137,7 @@ abstract class PluginBase implements Plugin{
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return Command|PluginIdentifiableCommand
|
||||
* @return Command|PluginIdentifiableCommand|null
|
||||
*/
|
||||
public function getCommand($name){
|
||||
$command = $this->getServer()->getPluginCommand($name);
|
||||
@ -177,7 +177,7 @@ abstract class PluginBase implements Plugin{
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return resource Resource data, or null
|
||||
* @return resource|null Resource data, or null
|
||||
*/
|
||||
public function getResource($filename){
|
||||
$filename = rtrim(str_replace("\\", "/", $filename), "/");
|
||||
|
@ -48,7 +48,7 @@ class ScriptPluginLoader implements PluginLoader{
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return Plugin
|
||||
* @return Plugin|null
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
@ -82,7 +82,7 @@ class ScriptPluginLoader implements PluginLoader{
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return PluginDescription
|
||||
* @return PluginDescription|null
|
||||
*/
|
||||
public function getPluginDescription($file){
|
||||
$content = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
@ -225,7 +225,7 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Chest
|
||||
* @return Chest|null
|
||||
*/
|
||||
public function getPair(){
|
||||
if($this->isPaired()){
|
||||
|
@ -82,7 +82,7 @@ abstract class Tile extends Position{
|
||||
* @param CompoundTag $nbt
|
||||
* @param $args
|
||||
*
|
||||
* @return Tile
|
||||
* @return Tile|null
|
||||
*/
|
||||
public static function createTile($type, Level $level, CompoundTag $nbt, ...$args){
|
||||
if(isset(self::$knownTiles[$type])){
|
||||
|
@ -36,6 +36,7 @@ class Utils{
|
||||
public static $online = true;
|
||||
public static $ip = false;
|
||||
public static $os;
|
||||
/** @var UUID|null */
|
||||
private static $serverUniqueId = null;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user