Map İmage

Discussion in 'Plugin Help' started by ByAlperenS, Oct 16, 2020 at 9:40 AM.

  1. ByAlperenS

    ByAlperenS Spider Jockey

    Messages:
    26
    GitHub:
    ByAlperenS
    I put a picture on the map but when in game the map invisible

    Code:
    Code:
            
            $r = 0;
            $g = 0;
            $b = 0;
            $ancho = 128;
            $altura = 128;
            $map = Item::get(Item::FILLED_MAP);
            $map->setCount(1);
            $imagen = imagescale($imagen, $ancho, $altura, IMG_NEAREST_NEIGHBOUR);
            imagepng($imagen, $folder."map-new.png");
            for($y = 0; $y < $altura; ++$y){
                for($x = 0; $x < $ancho; ++$x){
                    $color = imagecolorsforindex($imagen, imagecolorat($imagen, $x, $y));
                    $r = $color["red"];
                    $g = $color["green"];
                    $b = $color["blue"];
                    $colores[$y][$x] = new Color($r, $g, $b);
                }
            }
            $key = 18293883;
            $tag = new CompoundTag("", []);
            $tag->setTag(new StringTag("map_uuid", $key));
            $map->setCompoundTag($tag);
            $p->getInventory()->setItem(6, $map);
            $pk = new ClientboundMapItemDataPacket();
            $pk->mapId = $key;
            $pk->type = ClientboundMapItemDataPacket::BITFLAG_TEXTURE_UPDATE;
            $pk->height = 128;
            $pk->width = 128;
            $pk->scale = 1;
            $pk->colors = $colores;
            $p->dataPacket($pk);
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    494
    map_uuid is a LongTag not StringTag
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.