MapReflectionAPI (1.12-1.21) icon

MapReflectionAPI (1.12-1.21) -----

API to view custom images on maps



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 ( 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:
Code (Java):
//--- 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!
Resource Information
Author:
----------
Total Downloads: 994
First Release: Jun 30, 2022
Last Update: Jun 30, 2024
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings