mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Entity: Require declaration of gravity and drag via abstract methods
this guarantees that subclasses will actually declare them. [bc break]
This commit is contained in:
@ -76,9 +76,6 @@ use const M_PI;
|
||||
abstract class Living extends Entity{
|
||||
protected const DEFAULT_BREATH_TICKS = 300;
|
||||
|
||||
protected $gravity = 0.08;
|
||||
protected $drag = 0.02;
|
||||
|
||||
/** @var int */
|
||||
protected $attackTime = 0;
|
||||
|
||||
@ -121,6 +118,10 @@ abstract class Living extends Entity{
|
||||
/** @var bool */
|
||||
protected $swimming = false;
|
||||
|
||||
protected function getInitialDragMultiplier() : float{ return 0.02; }
|
||||
|
||||
protected function getInitialGravity() : float{ return 0.08; }
|
||||
|
||||
abstract public function getName() : string;
|
||||
|
||||
protected function initEntity(CompoundTag $nbt) : void{
|
||||
|
Reference in New Issue
Block a user