mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 06:09:57 +00:00
Fixed farmland appearing black on clients (farmland is transparent in PE)
This commit is contained in:
parent
b7b7a93e4e
commit
6828ce66b6
@ -24,6 +24,7 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\event\block\BlockGrowEvent;
|
use pocketmine\event\block\BlockGrowEvent;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
use pocketmine\Server;
|
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){
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
$down = $this->getSide(0);
|
if($block->getSide(Vector3::SIDE_DOWN)->getId() === Block::FARMLAND){
|
||||||
if($down->getId() === self::FARMLAND){
|
|
||||||
$this->getLevel()->setBlock($block, $this, true, true);
|
$this->getLevel()->setBlock($block, $this, true, true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -69,7 +69,7 @@ abstract class Crops extends Flowable{
|
|||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
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);
|
$this->getLevel()->useBreakOn($this);
|
||||||
return Level::BLOCK_UPDATE_NORMAL;
|
return Level::BLOCK_UPDATE_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ use pocketmine\item\Item;
|
|||||||
use pocketmine\item\Tool;
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
|
|
||||||
class Farmland extends Solid{
|
class Farmland extends Transparent{
|
||||||
|
|
||||||
protected $id = self::FARMLAND;
|
protected $id = self::FARMLAND;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user