Added trees to teh SuperflatGenerator

This commit is contained in:
Shoghi Cervantes Pueyo
2013-05-18 11:02:00 +02:00
parent 3c4d4f5cff
commit e81d68c8d0
8 changed files with 46 additions and 30 deletions

View File

@ -33,8 +33,8 @@ class TreeObject{
17 => true,
18 => true,
);
public static function growTree(Level $level, Block $block){
switch($block->getMetadata() & 0x03){
public static function growTree(Level $level, Vector3 $pos, $type = 0){
switch($type & 0x03){
case SaplingBlock::SPRUCE:
if(mt_rand(0,1) == 1){
$tree = new SpruceTreeObject();
@ -55,8 +55,8 @@ class TreeObject{
}
break;
}
if($tree->canPlaceObject($level, $block->x, $block->y, $block->z)){
$tree->placeObject($level, $block->x, $block->y, $block->z);
if($tree->canPlaceObject($level, $pos)){
$tree->placeObject($level, $pos);
}
}
}