Updated Levels :D

This commit is contained in:
Shoghi Cervantes
2014-06-09 11:35:52 +02:00
parent 920e2a7c7e
commit 115b4cf4ac
41 changed files with 1492 additions and 270 deletions

View File

@ -22,6 +22,7 @@
namespace pocketmine\level\generator\object;
use pocketmine\block\Sapling;
use pocketmine\level\ChunkManager;
use pocketmine\level\Level;
use pocketmine\math\Vector3 as Vector3;
use pocketmine\utils\Random;
@ -36,7 +37,7 @@ class Tree{
18 => true,
);
public static function growTree(Level $level, Vector3 $pos, Random $random, $type = 0){
public static function growTree(ChunkManager $level, $x, $y, $z, Random $random, $type = 0){
switch($type & 0x03){
case Sapling::SPRUCE:
if($random->nextRange(0, 1) === 1){
@ -62,8 +63,8 @@ class Tree{
//}
break;
}
if($tree->canPlaceObject($level, $pos, $random)){
$tree->placeObject($level, $pos, $random);
if($tree->canPlaceObject($level, $x, $y, $z, $random)){
$tree->placeObject($level, $x, $y, $z, $random);
}
}
}