mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-17 17:04:08 +00:00
Mushroom: check the light for placement, unless placed on mycelium or podzol (#5054)
The previous behaviour was inconsistent with vanilla.
This commit is contained in:
parent
37ec1193ea
commit
22486dd75e
@ -43,7 +43,11 @@ class RedMushroom extends Flowable{
|
|||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||||
$down = $this->getSide(Facing::DOWN);
|
$down = $this->getSide(Facing::DOWN);
|
||||||
if(!$down->isTransparent()){
|
$position = $this->getPosition();
|
||||||
|
$lightLevel = $position->getWorld()->getFullLightAt($position->x, $position->y, $position->z);
|
||||||
|
$downId = $down->getId();
|
||||||
|
//TODO: nylium support
|
||||||
|
if(($lightLevel <= 12 && !$down->isTransparent()) || $downId === BlockLegacyIds::MYCELIUM || $downId === BlockLegacyIds::PODZOL){
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,6 +335,21 @@ parameters:
|
|||||||
count: 3
|
count: 3
|
||||||
path: ../../../src/block/Mycelium.php
|
path: ../../../src/block/Mycelium.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\world\\\\World\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../../src/block/RedMushroom.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$y of method pocketmine\\\\world\\\\World\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../../src/block/RedMushroom.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$z of method pocketmine\\\\world\\\\World\\:\\:getFullLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../../src/block/RedMushroom.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\world\\\\World\\:\\:getBlockLightAt\\(\\) expects int, float\\|int given\\.$#"
|
message: "#^Parameter \\#1 \\$x of method pocketmine\\\\world\\\\World\\:\\:getBlockLightAt\\(\\) expects int, float\\|int given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user