diff --git a/src/pocketmine/block/Crops.php b/src/pocketmine/block/Crops.php index 040b245f6..963b107d4 100644 --- a/src/pocketmine/block/Crops.php +++ b/src/pocketmine/block/Crops.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\event\block\BlockGrowEvent; use pocketmine\item\Item; use pocketmine\level\Level; +use pocketmine\math\Vector3; use pocketmine\Player; use pocketmine\Server; @@ -34,8 +35,7 @@ abstract class Crops extends Flowable{ } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ - $down = $this->getSide(0); - if($down->getId() === self::FARMLAND){ + if($block->getSide(Vector3::SIDE_DOWN)->getId() === Block::FARMLAND){ $this->getLevel()->setBlock($block, $this, true, true); return true; @@ -69,7 +69,7 @@ abstract class Crops extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent() === true){ + if($this->getSide(Vector3::SIDE_DOWN)->getId() !== Block::FARMLAND){ $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/Farmland.php b/src/pocketmine/block/Farmland.php index 467e47e19..3acc9b97c 100644 --- a/src/pocketmine/block/Farmland.php +++ b/src/pocketmine/block/Farmland.php @@ -25,7 +25,7 @@ use pocketmine\item\Item; use pocketmine\item\Tool; use pocketmine\math\AxisAlignedBB; -class Farmland extends Solid{ +class Farmland extends Transparent{ protected $id = self::FARMLAND;