Minecart is in separated class

This commit is contained in:
GameHerobrine 2022-08-02 17:20:54 +03:00
parent 5596f58a0a
commit a75e286337
11 changed files with 515 additions and 32 deletions

View file

@ -59,7 +59,8 @@ class EntityAPI{
$this->server->api->console->register("spawnmob", "<mob>", [$this, "commandHandler"]);
$this->server->api->console->register("despawn", "", [$this, "CommandHandler"]);
}
public function commandHandler($cmd, $args, $issuer, $alias){
$output = "";
switch($cmd){

View file

@ -62,7 +62,7 @@ class LevelAPI{
$e = $this->server->api->entity->add($this->levels[$name], ENTITY_FALLING, $entity["id"], $entity);
$e->setPosition(new Vector3($entity["Pos"][0], $entity["Pos"][1], $entity["Pos"][2]), $entity["Rotation"][0], $entity["Rotation"][1]);
$e->setHealth($entity["Health"]);
}elseif($entity["id"] === OBJECT_PAINTING or $entity["id"] === OBJECT_ARROW){ //Painting
}elseif(Utils::getEntityTypeByID($entity["id"]) === ENTITY_OBJECT){ //Object
$e = $this->server->api->entity->add($this->levels[$name], ENTITY_OBJECT, $entity["id"], $entity);
$e->setPosition(new Vector3($entity["Pos"][0], $entity["Pos"][1], $entity["Pos"][2]), $entity["Rotation"][0], $entity["Rotation"][1]);
$e->setHealth(1);