bed will now break from tnt explosion

This commit is contained in:
GameHerobrine 2024-05-29 06:30:02 +03:00
parent fc0f3f6bde
commit 7bc97cca37
3 changed files with 41 additions and 14 deletions

View file

@ -248,15 +248,15 @@ class EntityAPI{
$e->setHealth($e->getHealth() - $attack, $cause, $force);
}
public function dropRawPos(Position $pos, $item, $speedX, $speedY, $speedZ){
public function dropRawPos(Level $level, $x, $y, $z, $item, $speedX, $speedY, $speedZ){
if($item->getID() === AIR or $item->count <= 0){
return;
}
$data = [
"x" => $pos->x,
"y" => $pos->y,
"z" => $pos->z,
"level" => $pos->level,
"x" => $x,
"y" => $y,
"z" => $z,
"level" => $level,
"speedX" => $speedX,
"speedY" => $speedY,
"speedZ" => $speedZ,
@ -268,7 +268,7 @@ class EntityAPI{
for($count = $item->count; $count > 0;){
$item->count = min($item->getMaxStackSize(), $count);
$count -= $item->count;
$e = $this->add($pos->level, ENTITY_ITEM, ENTITY_ITEM_TYPE, $data);
$e = $this->add($level, ENTITY_ITEM, ENTITY_ITEM_TYPE, $data);
$this->spawnToAll($e);
$this->server->api->handle("entity.motion", $e);
}