mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Update Entity.php
Now seeds will drop if u fall on farmland(buggy with $z)
This commit is contained in:
parent
1a884f6d2a
commit
5a240c7e0f
1 changed files with 5 additions and 4 deletions
|
|
@ -552,13 +552,14 @@ class Entity extends Position{
|
|||
}
|
||||
}elseif($this->fallY !== false){ //Fall damage!
|
||||
if($y < $this->fallY){
|
||||
$blockToFallOn = $this->level->getBlock(new Vector3($x, $y, $z));
|
||||
if($blockToFallOn->getID() === FARMLAND){
|
||||
$this->level->setBlock($blockToFallOn, new DirtBlock(), true, false, true);
|
||||
}
|
||||
|
||||
$d = $this->level->getBlock(new Vector3($x, $y + 1, $z));
|
||||
$d2 = $this->level->getBlock(new Vector3($x, $y + 2, $z));
|
||||
$blockToFallOn = $this->level->getBlock(new Vector3(floor($x), floor($y), floor($z)));
|
||||
$dmg = ($this->fallY - $y) - 3;
|
||||
if($blockToFallOn->getID() === FARMLAND){
|
||||
$this->level->setBlockRaw($blockToFallOn,new DirtBlock());
|
||||
}
|
||||
if($dmg > 0 and !($d instanceof LiquidBlock) and $d->getID() !== LADDER and $d->getID() !== COBWEB and !($d2 instanceof LiquidBlock) and $d2->getID() !== LADDER and $d2->getID() !== COBWEB){
|
||||
$this->harm($dmg, "fall");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue