Merge branch 'master' into pr

This commit is contained in:
yefengeeeeeeeeeee 2025-05-10 15:47:11 +08:00 • committed by GitHub
commit b003448ac5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 427 additions and 262 deletions

View file

@ -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
}
}
}
}
}