mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
bed will now break from tnt explosion
This commit is contained in:
parent
fc0f3f6bde
commit
7bc97cca37
3 changed files with 41 additions and 14 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue