Fixed PMFLevel::getBlock() not converting to int

This commit is contained in:
Shoghi Cervantes Pueyo 2013-05-17 15:08:56 +02:00
parent d71a088460
commit 3bb7114e7c

View File

@ -338,17 +338,17 @@ class PMFLevel extends PMF{
$aY = $y - ($Y << 4);
$bindex = $aY + ($aX << 5) + ($aZ << 9);
$mindex = ($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9);
$old_b = $this->chunks[$index][$Y]{$bindex};
$old_m = $this->chunks[$index][$Y]{$mindex};
$old_b = ord($this->chunks[$index][$Y]{$bindex});
$old_m = ord($this->chunks[$index][$Y]{$mindex});
if(($y & 1) === 0){
$old_m = $old_m & 0x0F;
$m = ($old_m << 4) | ($meta & 0x0F);
$o_m = $old_m & 0x0F;
$m = ($o_m << 4) | $meta;
}else{
$old_m = $old_m >> 4;
$m = (($meta << 4) & 0xF0) | $old_m;
$o_m = $old_m >> 4;
$m = ($meta << 4) | $o_m;
}
if($old_b !== $block or $old_m !== $meta){
$this->chunks[$index][$Y]{$bindex} = chr($block & 0xFF);
if($old_b !== $block or $old_m !== $m){
$this->chunks[$index][$Y]{$bindex} = chr($block);
$this->chunks[$index][$Y]{$mindex} = chr($m);
if(!isset($this->chunkChange[$index][$Y])){
$this->chunkChange[$index][$Y] = 1;