mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Changes in item spawning
This commit is contained in:
parent
862947ab6b
commit
da2b800ea8
@ -245,6 +245,9 @@ class BlockAPI{
|
|||||||
$data["stack"] = min(64, $count);
|
$data["stack"] = min(64, $count);
|
||||||
$count -= $data["stack"];
|
$count -= $data["stack"];
|
||||||
$e = $this->server->api->entity->add(ENTITY_ITEM, $block, $data);
|
$e = $this->server->api->entity->add(ENTITY_ITEM, $block, $data);
|
||||||
|
//$e->speedX = mt_rand(-10, 10) / 100;
|
||||||
|
//$e->speedY = mt_rand(0, 5) / 100;
|
||||||
|
//$e->speedZ = mt_rand(-10, 10) / 100;
|
||||||
$this->server->api->entity->spawnToAll($e->eid);
|
$this->server->api->entity->spawnToAll($e->eid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,11 +246,13 @@ class Entity extends stdClass{
|
|||||||
$b = $this->server->api->level->getBlock($x, $y, $z);
|
$b = $this->server->api->level->getBlock($x, $y, $z);
|
||||||
if(isset(Material::$transparent[$b[0]])){
|
if(isset(Material::$transparent[$b[0]])){
|
||||||
$this->speedY -= 0.04 * 4;
|
$this->speedY -= 0.04 * 4;
|
||||||
$this->server->api->dhandle("entity.motion", $this);
|
$this->server->api->handle("entity.motion", $this);
|
||||||
}elseif($this->speedY < 0){
|
}elseif($this->speedY < 0){
|
||||||
$this->y = $y + 1;
|
$this->y = $y + 1;
|
||||||
|
$this->speedX = 0;
|
||||||
$this->speedY = 0;
|
$this->speedY = 0;
|
||||||
$this->server->api->dhandle("entity.motion", $this);
|
$this->speedZ = 0;
|
||||||
|
$this->server->api->handle("entity.motion", $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user