mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Entity: replace separate height/width/eyeHeight fields with an EntitySizeInfo structure
this will make it easier to implement stuff like sleeping (properly), swimming and gliding without needing to duplicate all the fields.
This commit is contained in:
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\entity\object;
|
||||
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\EntitySizeInfo;
|
||||
use pocketmine\entity\Human;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\IntTag;
|
||||
@ -78,9 +79,6 @@ class ExperienceOrb extends Entity{
|
||||
return $result;
|
||||
}
|
||||
|
||||
public $height = 0.25;
|
||||
public $width = 0.25;
|
||||
|
||||
public $gravity = 0.04;
|
||||
public $drag = 0.02;
|
||||
|
||||
@ -102,6 +100,8 @@ class ExperienceOrb extends Entity{
|
||||
/** @var int */
|
||||
protected $xpValue = 1;
|
||||
|
||||
protected function getInitialSizeInfo() : EntitySizeInfo{ return new EntitySizeInfo(0.25, 0.25); }
|
||||
|
||||
protected function initEntity(CompoundTag $nbt) : void{
|
||||
parent::initEntity($nbt);
|
||||
|
||||
|
Reference in New Issue
Block a user