Well \pocketmine\level\Level::setBiomeColor() does not change the biome/chunk color to something else ON GRASS. I'm trying to set the biome/chunk color upon joining the server, I don't know if that has to do with anything. I made sure with debugging that red, blue, or green is not greater than 256 or less than 0. Does anybody know a fix for this? My code: PHP: /*** Paints rgb of an image on a chunk** @param Player $player** @param integer[][] $rgb*/public function paint(Player $player, array $rgb){ $r = count($rgb['r']); for($i = 0; $i < $r; ++$i) { $red = $rgb['r'][$i]; $green = $rgb['g'][$i]; $blue = $rgb['b'][$i]; echo $red . '/' . $green . '/' . $blue . "\n"; #DEBUG $player->level->unloadChunk($player->x >> 4, $player->z >> 4); $player->level->setBiomeColor($player->x >> 4, $player->z >> 4, $red, $green, $blue); $player->level->loadChunk($player->x >> 4, $player->z >> 4); }}
Ok, I tested now but still won't work. I changed the function: PHP: /** * Paints rgb of an image on a chunk * * @param Player $player * * @param integer[][] $rgb */ public function paint(Player $player, array $rgb){ $r = count($rgb['r']); $player->level->unloadChunk($player->x >> 4, $player->z >> 4); for($i = 0; $i < $r; ++$i) { $red = $rgb['r'][$i]; $green = $rgb['g'][$i]; $blue = $rgb['b'][$i]; echo $red . '/' . $green . '/' . $blue . "\n"; #DEBUG $player->level->setBiomeColor($player->x + $i, $player->z + $i, $red, $green, $blue); } $player->level->loadChunk($player->x >> 4, $player->z >> 4); }
Just a heads up: this disappeared in API 3.0.0-ALPHA1 due to client changes (client doesn't support custom biome colours anymore).