Fixed Tree spawning

This commit is contained in:
Shoghi Cervantes Pueyo 2013-01-15 18:21:55 +01:00
parent d147caa913
commit 475419b693
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class PineTreeObject extends TreeObject{
public function canPlaceObject(LevelAPI $level, $x, $y, $z){ public function canPlaceObject(LevelAPI $level, $x, $y, $z){
$this->findRandomLeavesSize(); $this->findRandomLeavesSize();
$checkRadius = 0; $checkRadius = 0;
for($yy = 0; $yy < ($this->totalHeight + 2); ++$yy) { for($yy = 0; $yy < $this->totalHeight; ++$yy) {
if($yy === $this->leavesSizeY) { if($yy === $this->leavesSizeY) {
$checkRadius = $this->leavesAbsoluteMaxRadius; $checkRadius = $this->leavesAbsoluteMaxRadius;
} }

View File

@ -36,7 +36,7 @@ class TreeObject{
public static function growTree(LevelAPI $level, $block, $type){ public static function growTree(LevelAPI $level, $block, $type){
switch($type){ switch($type){
case Sapling::SPRUCE: case Sapling::SPRUCE:
if(mt_rand(0,1) == 2){ if(mt_rand(0,1) == 1){
$tree = new SpruceTreeObject(); $tree = new SpruceTreeObject();
}else{ }else{
$tree = new PineTreeObject(); $tree = new PineTreeObject();