mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
World: added getHighestAdjacentRealBlockSkyLight()
this is the same as its 'non-real' counterpart, but it accounts for time of day.
This commit is contained in:
parent
0b92e96e14
commit
241a50387b
@ -60,7 +60,7 @@ class FrostedIce extends Ice{
|
|||||||
if((!$this->checkAdjacentBlocks(4) or mt_rand(0, 2) === 0) and
|
if((!$this->checkAdjacentBlocks(4) or mt_rand(0, 2) === 0) and
|
||||||
max( //TODO: move this to World
|
max( //TODO: move this to World
|
||||||
$this->pos->getWorld()->getHighestAdjacentBlockLight($this->pos->x, $this->pos->y, $this->pos->z),
|
$this->pos->getWorld()->getHighestAdjacentBlockLight($this->pos->x, $this->pos->y, $this->pos->z),
|
||||||
$this->pos->getWorld()->getHighestAdjacentBlockSkyLight($this->pos->x, $this->pos->y, $this->pos->z) - $this->pos->getWorld()->getSkyLightReduction()
|
$this->pos->getWorld()->getHighestAdjacentRealBlockSkyLight($this->pos->x, $this->pos->y, $this->pos->z)
|
||||||
) >= 12 - $this->age){
|
) >= 12 - $this->age){
|
||||||
if($this->tryMelt()){
|
if($this->tryMelt()){
|
||||||
foreach($this->getAllSides() as $block){
|
foreach($this->getAllSides() as $block){
|
||||||
|
@ -1241,6 +1241,14 @@ class World implements ChunkManager{
|
|||||||
return $max;
|
return $max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the highest block sky light available in the positions adjacent to the given coordinates, adjusted for
|
||||||
|
* the world's current time of day and weather conditions.
|
||||||
|
*/
|
||||||
|
public function getHighestAdjacentRealBlockSkyLight(int $x, int $y, int $z) : int{
|
||||||
|
return $this->getHighestAdjacentBlockSkyLight($x, $y, $z) - $this->skyLightReduction;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the highest block light level available in the positions adjacent to the specified block coordinates.
|
* Returns the highest block light level available in the positions adjacent to the specified block coordinates.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user