mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
Cast floats as integers on Level::getBlock() and Level::setBlock()
This commit is contained in:
parent
c00bfe3908
commit
84bb66357e
1 changed files with 4 additions and 4 deletions
|
|
@ -317,8 +317,8 @@ class PMFLevel extends PMF{
|
||||||
$aX = $x - ($X << 4);
|
$aX = $x - ($X << 4);
|
||||||
$aZ = $z - ($Z << 4);
|
$aZ = $z - ($Z << 4);
|
||||||
$aY = $y - ($Y << 4);
|
$aY = $y - ($Y << 4);
|
||||||
$bindex = $aY + ($aX << 5) + ($aZ << 9);
|
$bindex = (int) ($aY + ($aX << 5) + ($aZ << 9));
|
||||||
$mindex = ($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9);
|
$mindex = (int) (($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9));
|
||||||
$b = ord($this->chunks[$index][$Y]{$bindex});
|
$b = ord($this->chunks[$index][$Y]{$bindex});
|
||||||
$m = ord($this->chunks[$index][$Y]{$mindex});
|
$m = ord($this->chunks[$index][$Y]{$mindex});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
|
|
@ -349,8 +349,8 @@ class PMFLevel extends PMF{
|
||||||
$aX = $x - ($X << 4);
|
$aX = $x - ($X << 4);
|
||||||
$aZ = $z - ($Z << 4);
|
$aZ = $z - ($Z << 4);
|
||||||
$aY = $y - ($Y << 4);
|
$aY = $y - ($Y << 4);
|
||||||
$bindex = $aY + ($aX << 5) + ($aZ << 9);
|
$bindex = (int) ($aY + ($aX << 5) + ($aZ << 9));
|
||||||
$mindex = ($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9);
|
$mindex = (int) (($aY >> 1) + 16 + ($aX << 5) + ($aZ << 9));
|
||||||
$old_b = ord($this->chunks[$index][$Y]{$bindex});
|
$old_b = ord($this->chunks[$index][$Y]{$bindex});
|
||||||
$old_m = ord($this->chunks[$index][$Y]{$mindex});
|
$old_m = ord($this->chunks[$index][$Y]{$mindex});
|
||||||
if(($y & 1) === 0){
|
if(($y & 1) === 0){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue