Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force close #3

Closed
XanderID opened this issue Jan 7, 2022 · 5 comments
Closed

force close #3

XanderID opened this issue Jan 7, 2022 · 5 comments

Comments

@XanderID
Copy link

XanderID commented Jan 7, 2022

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
Copy link
Contributor

VixikHD commented Jan 7, 2022

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
Copy link
Author

XanderID commented Jan 8, 2022

test

@XanderID
Copy link
Author

XanderID commented Jan 8, 2022

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
Copy link
Author

XanderID commented Jan 8, 2022

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 XanderID closed this as completed Jan 8, 2022
@XanderID
Copy link
Author

XanderID commented Jan 8, 2022

the problem is finished

@VixikHD VixikHD reopened this Jan 8, 2022
@VixikHD VixikHD closed this as completed May 26, 2022
@xFungal xFungal mentioned this issue Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants