MapReflectionAPI An API to view custom images on maps!
What can you do with MapReflectionAPI? This API enables developers to show custom images on maps in an itemframe. It uses packets and cached reflection calls to make sure you get the best performance.
The API is a fork of MapManager. It works with the latest Spigot version and does NOT require any other dependencies.
How to use MapReflectionAPI?
Code (Java):
//Wrap image MapWrapper wrapper
= MapReflectionAPI.
getMapManager().
wrapImage(ImageIO.
read(newFile("image.png")));//The image must be 128x128 in size! MapController controller
= wrapper.
getController();
final Player p
= Bukkit.
getPlayer("SBDeveloper");
//Add viewer try{ controller.
addViewer(p
); }catch(MapLimitExceededException e
){ e.
printStackTrace(); return; } controller.
sendContent(p
);
//Show in frame ItemFrame frame
= ...
;//This is your ItemFrame. controller.
showInFrame(p, frame,
true);
//Or show in hand controller.
showInHand(p,
true);
It's also possible to split one image onto multiple itemframes. For example, using the following code: