Added MemoryManager, new memory properties, improved performance, updated RakLib, fixed misc. bugs

This commit is contained in:
Shoghi Cervantes
2015-04-18 20:13:52 +02:00
parent ddc152ae0a
commit b2c25eaf36
32 changed files with 652 additions and 164 deletions

View File

@ -87,13 +87,13 @@ abstract class BaseFullChunk implements FullChunk{
$this->x = (int) $x;
$this->z = (int) $z;
$this->blocks = $blocks;
$this->data = $data;
$this->skyLight = $skyLight;
$this->blockLight = $blockLight;
$this->blocks =& $blocks;
$this->data =& $data;
$this->skyLight =& $skyLight;
$this->blockLight =& $blockLight;
if(strlen($biomeIds) === 256){
$this->biomeIds = $biomeIds;
$this->biomeIds =& $biomeIds;
}else{
$this->biomeIds = str_repeat("\x01", 256);
}
@ -321,31 +321,31 @@ abstract class BaseFullChunk implements FullChunk{
return true;
}
public function getBlockIdArray(){
public function &getBlockIdArray(){
return $this->blocks;
}
public function getBlockDataArray(){
public function &getBlockDataArray(){
return $this->data;
}
public function getBlockSkyLightArray(){
public function &getBlockSkyLightArray(){
return $this->skyLight;
}
public function getBlockLightArray(){
public function &getBlockLightArray(){
return $this->blockLight;
}
public function getBiomeIdArray(){
public function &getBiomeIdArray(){
return $this->biomeIds;
}
public function getBiomeColorArray(){
public function &getBiomeColorArray(){
return $this->biomeColors;
}
public function getHeightMapArray(){
public function &getHeightMapArray(){
return $this->heightMap;
}
@ -357,11 +357,11 @@ abstract class BaseFullChunk implements FullChunk{
$this->hasChanged = (bool) $changed;
}
public static function fromFastBinary($data, LevelProvider $provider = null){
public static function &fromFastBinary(&$data, LevelProvider $provider = null){
static::fromBinary($data, $provider);
}
public function toFastBinary(){
public function &toFastBinary(){
return $this->toBinary();
}