Tree growing!

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-27 01:08:26 +01:00
parent 8f6ed22158
commit 2353457b5b
10 changed files with 163 additions and 5 deletions

View File

@ -176,6 +176,10 @@ class BlockAPI{
if(isset(Material::$activable[$target[0]])){
switch($target[0]){
case 6:
if($data["block"] === 351 and $data["meta"] === 0x0F){ //Bonemeal
Sapling::growTree($this->server->api->level, $target, $target[1] & 0x03);
$cancelPlace = true;
}
break;
case 2:
case 3:

View File

@ -153,7 +153,7 @@ class ServerAPI extends stdClass{ //Yay! I can add anything to this class in run
if($this->getProperty("generator") !== false and class_exists($this->getProperty("generator"))){
$generator = $this->getProperty("generator");
}
$this->gen = new Generator($generator, $this->server->seed);
$this->gen = new WorldGenerator($generator, $this->server->seed);
if($this->getProperty("generator-settings") !== false and trim($this->getProperty("generator-settings")) != ""){
$this->gen->set("preset", $this->getProperty("generator-settings"));
}

View File

@ -25,8 +25,7 @@ the Free Software Foundation, either version 3 of the License, or
*/
class Generator{
class WorldGenerator{
private $gen, $seed, $raw;
public function __construct($genName, $seed){
$this->seed = (int) $seed;

View File

@ -35,7 +35,7 @@ define("BIG_ENDIAN", 0x00);
define("LITTLE_ENDIAN", 0x01);
define("ENDIANNESS", (pack("d", 1) === "\77\360\0\0\0\0\0\0" ? BIG_ENDIAN:LITTLE_ENDIAN));
class Utils{
abstract class Utils{
public static function getOS(){
$uname = strtoupper(php_uname("s"));