Skip to content

Commit

Permalink
Support for PocketMine versions without publishProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
falkirks committed May 5, 2017
1 parent 6eee7bd commit da74393
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/falkirks/minereset/task/ResetTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public function onRun(){
$chunks[$hash]->setBlock($x & 0x0f, $y & 0x7f, $z & 0x0f, $id[$l][0] & 0xff, $id[$l][1] & 0xff);
$currentBlocks++;
if($lastUpdate + $interval <= $currentBlocks){
$this->publishProgress(round(($currentBlocks / $totalBlocks)*100) . "%");
if(method_exists($this, 'publishProgress')) {
$this->publishProgress(round(($currentBlocks / $totalBlocks) * 100) . "%");
}
$lastUpdate = $currentBlocks;
}

Expand Down

0 comments on commit da74393

Please sign in to comment.