CzechPMDevs / ImageOnMap

🖼️ Easy to use PocketMine plugin, which allows loading images on maps
GNU General Public License v3.0
16 stars 8 forks source link

force close #3

Closed XanderID closed 2 years ago

XanderID commented 2 years ago

Code:

$file = $this->getDataFolder() . "test.png";
$mapid = ImageOnMap::getInstance()->getImageFromFile($file, 1, 1, 0, 0);
/** @var FilledMap $map */
$map = (FilledMap::get())->setMapId($mapid);

$player->getInventory()->setItemInHand($map);

Why my Minecraft force close? the code is correct right?

VixikHD commented 2 years ago

Yep, you used the api right way. Seems like the problem is on Mojang's side. However, could you please send me "test.png" file?

XanderID commented 2 years ago

test

XanderID commented 2 years ago

Is it because of the size of the image? Image size is 60x60, and when I try not to use api, but use /image obtain

the map is empty, there are no pictures:

Screenshot_20220108-083415

XanderID commented 2 years ago

I have found the problem from the bug, You cannot set FilledMap items in hand or slot held items, because the Map must be loaded first

Thx for making this plugins

XanderID commented 2 years ago

the problem is finished