fixed farmland not becoming dirt when player jumping

This commit is contained in:
GameHerobrine 2024-03-05 04:57:39 +03:00
parent f3a0705c66
commit 5364718d13
2 changed files with 3 additions and 4 deletions

View file

@ -850,13 +850,13 @@ class Entity extends Position
if($this->isPlayer()){
$x = floor($this->x);
$y = floor($this->y - 0.2);
$y = floor($this->y - 1); //TODO not 1
$z = floor($this->z);
$bid = $this->level->level->getBlockID($x, $y, $z);
console($this->y.":".$y);
if($bid > 0){
$clz = StaticBlock::getBlock($bid);
$clz::fallOn($this->level, $x, $y, $z, $this, floor($this->fallStart - $this->y));
$clz::fallOn($this->level, $x, $y, $z, $this, ceil($this->fallStart - $this->y));
}
$dmg = ceil($this->fallStart - $this->y - 3);

View file

@ -22,7 +22,6 @@ class FarmlandBlock extends TransparentBlock{
public static function fallOn(Level $level, $x, $y, $z, Entity $entity, $fallDistance){
$rv = lcg_value();
console("rv: $rv, fd: ".($fallDistance - 0.5));
if($rv < ($fallDistance - 0.5)){
$level->fastSetBlockUpdate($x, $y, $z, DIRT, 0);
}