62 for($a = 0; $a < 6; $a++){
64 if(is_numeric($args[$a]) and is_integer($args[$a] + 0)){
66 if($item instanceof ItemBlock){
67 $xmin = min($args[0] + 0, $args[3] + 0);
68 $xmax = max($args[0] + 0, $args[3] + 0);
69 $ymin = min($args[1] + 0, $args[4] + 0);
70 $ymax = max($args[1] + 0, $args[4] + 0);
71 $zmin = min($args[2] + 0, $args[5] + 0);
72 $zmax = max($args[2] + 0, $args[5] + 0);
73 $level = ($sender instanceof Player) ? $sender->getLevel() : $sender->getServer()->getDefaultLevel();
75 $nmax = ($xmax - $xmin + 1) * ($ymax - $ymin + 1) * ($zmax - $zmin + 1);
76 for($x = $xmin; $x <= $xmax; $x++){
77 for($y = $ymin; $y <= $ymax; $y++){
78 for($z = $zmin; $z <= $zmax; $z++){
79 if($this->setBlock(
new Vector3($x, $y, $z), $level, $item, isset($args[7]) ? $args[7] : 0)){
81 if(is_int($n / 10000)){
82 $sender->sendMessage(
new TranslationContainer(
"$n out of $nmax blocks filled, now at $x $y $z", []));
85 $sender->sendMessage(
TextFormat::RED .
new TranslationContainer(
"Error after filling $n out of $nmax blocks.", []));
91 $sender->sendMessage(
new TranslationContainer(
"Total of $n blocks filled.", []));
94 $sender->sendMessage(
TextFormat::RED .
new TranslationContainer($args[6] .
" is not a valid block.", []));
97 $sender->sendMessage(
TextFormat::RED .
new TranslationContainer($args[$a] .
" is not a valid coordinate.", []));
98 $sender->sendMessage(
new TranslationContainer(
"commands.generic.usage", [$this->usageMessage]));
101 $sender->sendMessage(
TextFormat::RED .
new TranslationContainer(
"pocketmine.command.fill.missingParameter", []));
102 $sender->sendMessage(
new TranslationContainer(
"commands.generic.usage", [$this->usageMessage]));