mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
void should work correctly now
This commit is contained in:
parent
394ede50e9
commit
c29d8dab9d
2 changed files with 86 additions and 56 deletions
|
|
@ -5,7 +5,11 @@ move methods
|
|||
*/
|
||||
abstract class Creature extends Living{
|
||||
const CLASS_TYPE = ENTITY_MOB;
|
||||
|
||||
public $inPanic;
|
||||
|
||||
public function __construct(Level $level, $eid, $class, $type = 0, $data = []){
|
||||
$this->inPanic = true;
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 1, "generic");
|
||||
//$this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
||||
|
|
@ -15,6 +19,10 @@ abstract class Creature extends Living{
|
|||
}
|
||||
}
|
||||
|
||||
public function getSpeedModifer(){
|
||||
return $this->speedModifer * ($this->inPanic ? 1.4 : 0.7);
|
||||
}
|
||||
|
||||
public function spawn($player){
|
||||
if(!($player instanceof Player)){
|
||||
$player = $this->server->api->player->get($player);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue