Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor 2020-01-09 17:17:42 +00:00
commit cda1143a79
32 changed files with 96 additions and 2 deletions

View File

@ -82,8 +82,11 @@ class CrashDump{
/** @var Server */
private $server;
/** @var resource */
private $fp;
/** @var int */
private $time;
/** @var mixed[] */
private $data = [];
/** @var string */
private $encodedData = "";

View File

@ -55,7 +55,9 @@ class CommandReader extends Thread{
/** @var \Threaded */
protected $buffer;
/** @var bool */
private $shutdown = false;
/** @var int */
private $type = self::TYPE_STREAM;
/** @var SleeperNotifier|null */

View File

@ -32,6 +32,7 @@ use function strpos;
use function substr;
class FormattedCommandAlias extends Command{
/** @var string[] */
private $formatStrings = [];
/**

View File

@ -39,6 +39,7 @@ class MultiRecipe{
public const TYPE_FIREWORKS = "00000000-0000-0000-0000-000000000002";
public const TYPE_MAP_LOCKING_CARTOGRAPHY = "602234E4-CAC1-4353-8BB7-B1EBFF70024B";
/** @var UUID */
private $uuid;
public function __construct(UUID $uuid){

View File

@ -47,13 +47,20 @@ class Attribute{
public const HORSE_JUMP_STRENGTH = self::MC_PREFIX . "horse.jump_strength";
public const ZOMBIE_SPAWN_REINFORCEMENTS = self::MC_PREFIX . "zombie.spawn_reinforcements";
/** @var string */
protected $id;
/** @var float */
protected $minValue;
/** @var float */
protected $maxValue;
/** @var float */
protected $defaultValue;
/** @var float */
protected $currentValue;
/** @var bool */
protected $shouldSend;
/** @var bool */
protected $desynchronized = true;
/** @var Attribute[] */

View File

@ -71,6 +71,7 @@ abstract class Living extends Entity{
protected $gravity = 0.08;
protected $drag = 0.02;
/** @var int */
protected $attackTime = 0;
/** @var int */
@ -78,6 +79,7 @@ abstract class Living extends Entity{
/** @var int */
protected $maxDeadTicks = 25;
/** @var float */
protected $jumpVelocity = 0.42;
/** @var EffectManager */

View File

@ -43,8 +43,10 @@ class Squid extends WaterAnimal{
/** @var Vector3|null */
public $swimDirection = null;
/** @var float */
public $swimSpeed = 0.1;
/** @var int */
private $switchDirectionTicker = 0;
public function initEntity(CompoundTag $nbt) : void{

View File

@ -46,6 +46,7 @@ class PrimedTNT extends Entity implements Explosive{
protected $gravity = 0.04;
protected $drag = 0.02;
/** @var int */
protected $fuse;
public $canCollide = false;

View File

@ -30,6 +30,7 @@ use pocketmine\event\CancellableTrait;
class EntityCombustEvent extends EntityEvent implements Cancellable{
use CancellableTrait;
/** @var int */
protected $duration;
/**

View File

@ -40,6 +40,7 @@ class PlayerDeathEvent extends EntityDeathEvent{
/** @var TextContainer|string */
private $deathMessage;
/** @var bool */
private $keepInventory = false;
/**

View File

@ -54,6 +54,7 @@ use function spl_object_id;
* @see InventoryAction
*/
class InventoryTransaction{
/** @var bool */
protected $hasExecuted = false;
/** @var Player */
protected $source;

View File

@ -62,12 +62,18 @@ class AddPlayerPacket extends DataPacket implements ClientboundPacket{
public $metadata = [];
//TODO: adventure settings stuff
/** @var int */
public $uvarint1 = 0;
/** @var int */
public $uvarint2 = 0;
/** @var int */
public $uvarint3 = 0;
/** @var int */
public $uvarint4 = 0;
/** @var int */
public $uvarint5 = 0;
/** @var int */
public $long1 = 0;
/** @var EntityLink[] */

View File

@ -63,6 +63,7 @@ class CraftingDataPacket extends DataPacket implements ClientboundPacket{
/** @var bool */
public $cleanRecipes = false;
/** @var mixed[][] */
public $decodedEntries = [];
protected function decodePayload() : void{

View File

@ -36,6 +36,7 @@ class Permission{
public const DEFAULT_TRUE = "true";
public const DEFAULT_FALSE = "false";
/** @var string */
public static $DEFAULT_PERMISSION = self::DEFAULT_OP;
/** @var string */

View File

@ -31,7 +31,9 @@ class AsyncWorker extends Worker{
/** @var mixed[] */
private static $store = [];
/** @var \ThreadedLogger */
private $logger;
/** @var int */
private $id;
/** @var int */

View File

@ -34,6 +34,7 @@ use function unserialize;
* The result of this AsyncTask is an array of arrays (returned from {@link Internet::simpleCurl}) or InternetException objects.
*/
class BulkCurlTask extends AsyncTask{
/** @var string */
private $operations;
/**

View File

@ -47,7 +47,9 @@ class SendUsageTask extends AsyncTask{
public const TYPE_STATUS = 2;
public const TYPE_CLOSE = 3;
/** @var string */
public $endpoint;
/** @var string */
public $data;
/**

View File

@ -32,6 +32,7 @@ trait CommonThreadPartsTrait{
/** @var string|null */
protected $composerAutoloaderPath;
/** @var bool */
protected $isKilled = false;
public function getClassLoader(){

View File

@ -71,6 +71,7 @@ class Config{
/** @var array */
private $config = [];
/** @var mixed[] */
private $nestedCache = [];
/** @var string */
@ -83,6 +84,7 @@ class Config{
/** @var bool */
private $changed = false;
/** @var int[] */
public static $formats = [
"properties" => Config::PROPERTIES,
"cnf" => Config::CNF,

View File

@ -62,7 +62,9 @@ use const SOCK_DGRAM;
use const SOL_UDP;
class Internet{
/** @var string|false */
public static $ip = false;
/** @var bool */
public static $online = true;
/**

View File

@ -29,6 +29,7 @@ use function time;
class ServerKiller extends Thread{
/** @var int */
public $time;
/** @var bool */

View File

@ -32,29 +32,51 @@ use function stream_isatty;
use const PHP_EOL;
abstract class Terminal{
/** @var string */
public static $FORMAT_BOLD = "";
/** @var string */
public static $FORMAT_OBFUSCATED = "";
/** @var string */
public static $FORMAT_ITALIC = "";
/** @var string */
public static $FORMAT_UNDERLINE = "";
/** @var string */
public static $FORMAT_STRIKETHROUGH = "";
/** @var string */
public static $FORMAT_RESET = "";
/** @var string */
public static $COLOR_BLACK = "";
/** @var string */
public static $COLOR_DARK_BLUE = "";
/** @var string */
public static $COLOR_DARK_GREEN = "";
/** @var string */
public static $COLOR_DARK_AQUA = "";
/** @var string */
public static $COLOR_DARK_RED = "";
/** @var string */
public static $COLOR_PURPLE = "";
/** @var string */
public static $COLOR_GOLD = "";
/** @var string */
public static $COLOR_GRAY = "";
/** @var string */
public static $COLOR_DARK_GRAY = "";
/** @var string */
public static $COLOR_BLUE = "";
/** @var string */
public static $COLOR_GREEN = "";
/** @var string */
public static $COLOR_AQUA = "";
/** @var string */
public static $COLOR_RED = "";
/** @var string */
public static $COLOR_LIGHT_PURPLE = "";
/** @var string */
public static $COLOR_YELLOW = "";
/** @var string */
public static $COLOR_WHITE = "";
/** @var bool|null */

View File

@ -87,7 +87,7 @@ use const STR_PAD_RIGHT;
* Big collection of functions
*/
class Utils{
/** @var string */
/** @var string|null */
private static $os;
/** @var UUID|null */
private static $serverUniqueId = null;

View File

@ -108,6 +108,7 @@ use const PHP_INT_MIN;
class World implements ChunkManager{
/** @var int */
private static $worldIdCounter = 1;
public const Y_MASK = 0xFF;

View File

@ -59,6 +59,7 @@ class RegionLoader{
private const FIRST_SECTOR = 2; //location table occupies 0 and 1
/** @var int */
public static $COMPRESSION_LEVEL = 7;
/** @var string */

View File

@ -32,10 +32,15 @@ use function unserialize;
class GeneratorRegisterTask extends AsyncTask{
/** @var string */
public $generatorClass;
/** @var string */
public $settings;
/** @var int */
public $seed;
/** @var int */
public $worldId;
/** @var int */
public $worldHeight = World::Y_MAX;
public function __construct(World $world, string $generatorClass, array $generatorSettings = []){

View File

@ -28,6 +28,7 @@ use pocketmine\world\World;
class GeneratorUnregisterTask extends AsyncTask{
/** @var int */
public $worldId;
public function __construct(World $world){

View File

@ -32,18 +32,31 @@ use pocketmine\world\World;
class PopulationTask extends AsyncTask{
private const TLS_KEY_WORLD = "world";
/** @var bool */
public $state;
/** @var int */
public $worldId;
/** @var string */
public $chunk;
/** @var string */
public $chunk0;
/** @var string */
public $chunk1;
/** @var string */
public $chunk2;
/** @var string */
public $chunk3;
//center chunk
/** @var string */
public $chunk5;
/** @var string */
public $chunk6;
/** @var string */
public $chunk7;
/** @var string */
public $chunk8;
public function __construct(World $world, Chunk $chunk){

View File

@ -52,7 +52,9 @@ class Normal extends Generator{
/** @var BiomeSelector */
private $selector;
/** @var float[][]|null */
private static $GAUSSIAN_KERNEL = null;
/** @var int */
private static $SMOOTH_SIZE = 2;
/**

View File

@ -31,7 +31,9 @@ use pocketmine\world\ChunkManager;
class TallGrass extends Populator{
/** @var ChunkManager */
private $world;
/** @var int */
private $randomAmount = 1;
/** @var int */
private $baseAmount = 0;
public function setRandomAmount(int $amount) : void{

View File

@ -32,7 +32,9 @@ use pocketmine\world\generator\object\Tree as ObjectTree;
class Tree extends Populator{
/** @var ChunkManager */
private $world;
/** @var int */
private $randomAmount = 1;
/** @var int */
private $baseAmount = 0;
/** @var TreeType */

View File

@ -42,9 +42,13 @@ use function str_repeat;
class FloatingTextParticle implements Particle{
//TODO: HACK!
/** @var string */
protected $text;
/** @var string */
protected $title;
protected $entityId;
/** @var int|null */
protected $entityId = null;
/** @var bool */
protected $invisible = false;
/**