-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,14 @@ public function onRun(){ | |
} | ||
$sum = []; | ||
$id = array_keys(unserialize($this->ratioData)); | ||
for($i = 0; $i < count($id); $i++){ | ||
$blockId = explode(":", $id[$i]); | ||
if(!isset($blockId[1])){ | ||
$blockId[1] = 0; | ||
} | ||
$id[$i] = $blockId; | ||
} | ||
|
||
$m = array_values(unserialize($this->ratioData)); | ||
$sum[0] = $m[0]; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
falkirks
Author
Owner
|
||
for ($l = 1; $l < count($m); $l++) $sum[$l] = $sum[$l - 1] + $m[$l]; | ||
|
@@ -48,7 +56,9 @@ public function onRun(){ | |
for ($l = 0; $l < count($sum); $l++) { | ||
if ($a <= $sum[$l]) { | ||
$hash = Level::chunkHash($x >> 4, $z >> 4); | ||
if(isset($chunks[$hash])) $chunks[$hash]->setBlock($x & 0x0f, $y & 0x7f, $z & 0x0f, $id[$l] & 0xff, 0); | ||
if(isset($chunks[$hash])){ | ||
$chunks[$hash]->setBlock($x & 0x0f, $y & 0x7f, $z & 0x0f, $id[$l][0] & 0xff, $id[$l][1] & 0xff); | ||
} | ||
$l = count($sum); | ||
} | ||
} | ||
|
Could you please explain what is going on in this method (specifically, at this line and further)? The code is quite not self-explanatory. :)