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?
//Wrap image
MapWrapper wrapper = MapReflectionAPI.getMapManager().wrapImage(ImageIO.read(new File("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:
//--- Wrap image (into 2 rows and 2 columns) ---
MultiMapWrapper wrapper = MapReflectionAPI.getMapManager().wrapMultiImage(ImageIO.read(new File("image.png")), 2, 2);
MultiMapController 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 frames ---
//These are your itemframes
ItemFrame leftTopFrame = ...;
ItemFrame leftBottomFrame = ...;
ItemFrame rightTopFrame = ...;
ItemFrame rightBottomFrame = ...;
ItemFrame[][] frames = {
{leftTopFrame, rightTopFrame},
{leftBottomFrame, rightBottomFrame}
};
controller.showInFrames(p, frames, true);
-------------------
Attention! This plugin is owned by SBDeveloper and may not be resold or posted anywhere else.
Ideas, tips, bugs, ...? Send a private message to SBDeveloper or react in the Discussion!
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta