This commit is contained in:
Shoghi Cervantes
2014-01-28 11:36:18 +01:00
parent 763adb0360
commit 4002d3013d
8 changed files with 21 additions and 26 deletions

View File

@ -64,17 +64,17 @@ class PineTreeObject extends TreeObject{
$firstMaxedRadius = false;
for($leavesY = 0; $leavesY <= $leavesBottomY; ++$leavesY) {
$yy = $this->totalHeight - $leavesY;
for ($xx = -$leavesRadius; $xx <= $leavesRadius; ++$xx) {
for ($zz = -$leavesRadius; $zz <= $leavesRadius; ++$zz) {
if (abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
for($xx = -$leavesRadius; $xx <= $leavesRadius; ++$xx) {
for($zz = -$leavesRadius; $zz <= $leavesRadius; ++$zz) {
if(abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
$level->setBlockRaw(new Vector3($pos->x + $xx, $pos->y + $yy, $pos->z + $zz), new LeavesBlock($this->type));
}
}
}
if ($leavesRadius >= $leavesMaxRadius) {
if($leavesRadius >= $leavesMaxRadius) {
$leavesRadius = $firstMaxedRadius ? 1 : 0;
$firstMaxedRadius = true;
if (++$leavesMaxRadius > $this->leavesAbsoluteMaxRadius) {
if(++$leavesMaxRadius > $this->leavesAbsoluteMaxRadius) {
$leavesMaxRadius = $this->leavesAbsoluteMaxRadius;
}
}else{

View File

@ -36,7 +36,7 @@ class SmallTreeObject extends TreeObject{
public function canPlaceObject(Level $level, Vector3 $pos, Random $random){
$radiusToCheck = 0;
for ($yy = 0; $yy < $this->trunkHeight + 3; ++$yy) {
if ($yy == 1 or $yy === $this->trunkHeight) {
if($yy == 1 or $yy === $this->trunkHeight) {
++$radiusToCheck;
}
for($xx = -$radiusToCheck; $xx < ($radiusToCheck + 1); ++$xx){

View File

@ -62,7 +62,7 @@ class SpruceTreeObject extends TreeObject{
for($yy = $this->totalHeight; $yy >= $this->leavesBottomY; --$yy){
for($xx = -$leavesRadius; $xx <= $leavesRadius; ++$xx) {
for($zz = -$leavesRadius; $zz <= $leavesRadius; ++$zz) {
if (abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
if(abs($xx) != $leavesRadius or abs($zz) != $leavesRadius or $leavesRadius <= 0) {
$level->setBlockRaw(new Vector3($pos->x + $xx, $pos->y + $yy, $pos->z + $zz), new LeavesBlock($this->type));
}
}