mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Merge branch 'master' into pr
This commit is contained in:
commit
b003448ac5
16 changed files with 427 additions and 262 deletions
|
|
@ -27,6 +27,18 @@ class FallingSand extends Entity{
|
|||
$this->close();
|
||||
return;
|
||||
}
|
||||
//$level->fastSetBlockUpdate($x, $y, $z, 0, 0, true);
|
||||
if($this->fallTime == 0){
|
||||
$x = floor($this->x);
|
||||
$y = floor($this->y);
|
||||
$z = floor($this->z);
|
||||
if($this->level->level->getBlockID($x, $y, $z) != $this->data["Tile"]){
|
||||
$this->close();
|
||||
return;
|
||||
}
|
||||
$this->level->fastSetBlockUpdate($x, $y, $z, 0, 0, true);
|
||||
}
|
||||
|
||||
$this->lastX = $this->x;
|
||||
$this->lastY = $this->y;
|
||||
$this->lastZ = $this->z;
|
||||
|
|
@ -41,6 +53,15 @@ class FallingSand extends Entity{
|
|||
$x = floor($this->x);
|
||||
$y = floor($this->y);
|
||||
$z = floor($this->z);
|
||||
|
||||
if(($blockAt = $this->level->level->getBlockID($x, $y, $z)) != 0){
|
||||
//TODO vanilla-like checking?
|
||||
if(StaticBlock::getIsTransparent($blockAt) && !StaticBlock::getIsLiquid($blockAt)){
|
||||
$this->close();
|
||||
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->data["Tile"], 0, 1)); //TODO add metadata
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if($this->onGround){
|
||||
$this->speedX *= 0.7;
|
||||
|
|
@ -49,12 +70,6 @@ class FallingSand extends Entity{
|
|||
$this->close();
|
||||
//TODO vanilla-like checking?
|
||||
$this->level->fastSetBlockUpdate($x, $y, $z, $this->data["Tile"], 0, true); //TODO add metadata
|
||||
}elseif(($blockAt = $this->level->level->getBlockID($x, $y, $z)) != 0){
|
||||
//TODO vanilla-like checking?
|
||||
if(StaticBlock::getIsTransparent($blockAt) && !StaticBlock::getIsLiquid($blockAt)){
|
||||
$this->close();
|
||||
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->data["Tile"], 0, 1)); //TODO add metadata
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue