Ore: replaced a sub-optimal multiply()->divide() on Vector2

This commit is contained in:
Dylan K. Taylor 2018-03-18 18:06:04 +00:00
parent 95606b6e04
commit e48ec9fb71

View File

@ -50,7 +50,7 @@ class Ore{
public function placeObject(ChunkManager $level, int $x, int $y, int $z){
$clusterSize = $this->type->clusterSize;
$angle = $this->random->nextFloat() * M_PI;
$offset = VectorMath::getDirection2D($angle)->multiply($clusterSize)->divide(8);
$offset = VectorMath::getDirection2D($angle)->multiply($clusterSize / 8);
$x1 = $x + 8 + $offset->x;
$x2 = $x + 8 - $offset->x;
$z1 = $z + 8 + $offset->y;