isBaby changed to IsBaby, methods for animals were added

This commit is contained in:
GameHerobrine 2022-06-07 21:39:23 +03:00
parent 327e74e7aa
commit eb1f1e3d02
9 changed files with 88 additions and 79 deletions

View file

@ -133,7 +133,7 @@ class EntityAPI{
$isBaby = 0;
if(strtolower($args[2]) == 'baby'){//summon <mob> [amount] [baby]
if($type > 13){
$output .= "Baby can be only animals!";
$output .= "This mob cant be baby!";
break;
}
$isBaby = 1;
@ -150,7 +150,7 @@ class EntityAPI{
"y" => $spawnY,
"z" => $spawnZ,
"Health" => $this->hp[$type],
"isBaby" => $isBaby,
"IsBaby" => $isBaby,
));
$this->spawnToAll($entityit, $level);
}
@ -272,8 +272,8 @@ class EntityAPI{
$eid = $this->eCnt++;
$efl = EntityRegistry::$entityList->getEntityFromType($type);
if($efl instanceof PropertyEntity){
console(json_encode($data));
$class = $efl->getEntityName();
console("yey");
$this->entities[$eid] = new $class($level, $eid, $efl->getEntityClass(), $efl->getEntityType(), $data);
}else{
$this->entities[$eid] = new Entity($level, $eid, $class, $type, $data);