i have this function for fill area but when i call it, entire server hangs forever PHP: public function resetFloor(){ $y = $this->data['arena']['floor_y']; $level = $this->plugin->getServer()->getLevelByName($this->data['arena']['arena_world']); for($x = min($this->data['arena']['first_corner_x'], $this->data['arena']['second_corner_x']); $x <= max($this->data['arena']['first_corner_x'], $this->data['arena']['second_corner_x']); $x+2){ for($z = min($this->data['arena']['first_corner_z'], $this->data['arena']['second_corner_z']); $z <= max($this->data['arena']['first_corner_z'], $this->data['arena']['second_corner_z']); $z+2){ $color = rand(0, 15); $block = Block::get($this->plugin->getBlock($this->id), $color); $level->setBlock(new Vector3($x, $y, $z), $block, false, true); $level->setBlock(new Vector3($x, $y, $z+1), $block, false, true); $level->setBlock(new Vector3($x+1, $y, $z), $block, false, true); $level->setBlock(new Vector3($x+1, $y, $z+1), $block, false, true); } } }
no because when i kill server map is not saved. and i looked for infinity loop but i didn“t find anything, so i ask here. and $color is same for all 4 blocks right?
Idk i would test out with PHP: break; on both "for" loops to test infinity loop ! Then see if server still hangs if not check is anything changed at those pos.
why are you using for($value1, $value; ....) is it possible Try with something simple with just 1 color then add colors
you can look here for craftbukkit version https://github.com/instance01/Color...labs/colormatch/modes/ColorMatchx32Glass.java
You really know how for works? http://php.net/manual/en/control-structures.for.php It can't be anything than Infinity loop! I supose Ik it was just an example