mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Farmland now can dry & wet, grass and dirt fix
This commit is contained in:
parent
ca2bf73e06
commit
caaa29388f
4 changed files with 133 additions and 33 deletions
|
|
@ -28,6 +28,7 @@ class DirtBlock extends SolidBlock{
|
|||
|
||||
public function onActivate(Item $item, Player $player){
|
||||
if($item->isHoe()){
|
||||
if($this->getSide(1)->isTransparent === false) return false;
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
$item->useOn($this);
|
||||
}
|
||||
|
|
@ -41,7 +42,7 @@ class DirtBlock extends SolidBlock{
|
|||
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
||||
if($type === BLOCK_UPDATE_RANDOM){
|
||||
if(mt_rand(0, 3) == 0){
|
||||
if($this->getSide(1)->isTransparent === false) return false;
|
||||
if(($this->getSide(1)->isTransparent === false) or ($this->getSide(1)->getID()->isLiquid) or ($this->getSide(1)->getID() == 60)) return false;
|
||||
if($this->getGrassInRadius() == true){
|
||||
$this->level->setBlock($this, BlockAPI::get(GRASS, 0), true, false, true);
|
||||
return BLOCK_UPDATE_RANDOM;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue