mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
World: don't assume that random Vector3 are int vectors
we can safely assume this for blocks (though the type info doesn't reflect it) but this is not safe to assume for random APIs that might be used by plugins.
This commit is contained in:
@ -1670,7 +1670,10 @@ class World implements ChunkManager{
|
||||
* time of day.
|
||||
*/
|
||||
public function getFullLight(Vector3 $pos) : int{
|
||||
return $this->getFullLightAt($pos->x, $pos->y, $pos->z);
|
||||
$floorX = $pos->getFloorX();
|
||||
$floorY = $pos->getFloorY();
|
||||
$floorZ = $pos->getFloorZ();
|
||||
return $this->getFullLightAt($floorX, $floorY, $floorZ);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1699,7 +1702,10 @@ class World implements ChunkManager{
|
||||
* This is not affected by weather or time of day.
|
||||
*/
|
||||
public function getPotentialLight(Vector3 $pos) : int{
|
||||
return $this->getPotentialLightAt($pos->x, $pos->y, $pos->z);
|
||||
$floorX = $pos->getFloorX();
|
||||
$floorY = $pos->getFloorY();
|
||||
$floorZ = $pos->getFloorZ();
|
||||
return $this->getPotentialLightAt($floorX, $floorY, $floorZ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user