mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
farm -> dirt on player fall, how works better
This commit is contained in:
parent
1baafb8b26
commit
8e5d2bb1c7
8 changed files with 34 additions and 22 deletions
|
|
@ -16,6 +16,14 @@ class FarmlandBlock extends TransparentBlock{
|
|||
return $b->isTransparent && $b->id != 0;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
public static function onRandomTick(Level $level, $x, $y, $z){
|
||||
$meta = $level->level->getBlockDamage($x, $y, $z);
|
||||
$b = $level->level->getBlockID($x, $y + 1, $z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue