Map Manager

MapManager [API]

Source: https://www.spigotmc.org/resources/api-mapmanager.19198/

This API allows you to display custom images on maps and to send individual maps to players.
Its main feature is the support for rapid map updates (as inย AnimatedFrames), since the map data can be sent to players and you can later change the map displayed in an item frame or in the player’s inventory.

Usage

Code (Java):
tryย {
//Get the MapManager instance
MapManager mapManagerย =ย ((MapManagerPlugin)ย Bukkit.getPluginManager().getPlugin(“MapManager”)).getMapManager();//Wrap the local file “myImage.png”
MapWrapper mapWrapperย =ย mapManager.wrapImage(ImageIO.read(newย File(“myImage.png”)));
MapController mapControllerย =ย mapWrapper.getController();//Add “inventivetalent” as a viewer and send the content
mapController.addViewer(Bukkit.getPlayer(“inventivetalent”));
mapController.sendContent(Bukkit.getPlayer(“inventivetalent”));

//At this point, the player is able to see the image
//So we can show we can show it in ItemFrames
mapController.showInFrame(Bukkit.getPlayer(“inventivetalent”),ย nullย /* <Item Frame Object > */);
//or just as an Item
mapController.showInHand(Bukkit.getPlayer(“inventivetalent”));
}ย catchย (IOExceptionย e)ย {
e.printStackTrace();
}

For more details, check out theย Javadocs.

Depends onย PacketListenerAPI!

 

Commands
/mapmanager reloadย – Reloads the configuration

Permissions
mapmanager.reloadย – Permission to reload the config

Config

Code (YAML):
# If vanilla maps should be allowed to be sent to the players (less efficient, since we need to check the id of every sent map)
allowVanilla:ย true# Change this to a higher number to “preserve” a number of map IDs that won’t be used by MapManager plugins
# Please note that increasing this too much limits the amount of maps that plugins can create
forcedOffset:ย 0# If the plugin checks for duplicate images before creating a new one (Less efficient when first creating a image, but more efficient overall)
checkDuplicates:ย true

# Cache the packet data in the image object (less CPU intensive for a lot of players, but probably a bit more memory intensive depending on the image size)
cacheData:ย true

sender:
# Delay between map packets (ticks)
delay:ย 2

# Maximum amount of map packets sent at once
amount:ย 10

# Allow immediate sending of map data
allowQueueBypass:ย true

# Enable this if you are using PaperSpigot (and/or you get this error: http://paste.inventivetalent.org/damuhonebu)
paperSpigot:ย false

 

Code (spiget-meta (Unknown Language)):
SlZOd2EkUm9kI1J3YW1GeUooVWtXa2QzZFdGPk4rSmFWe
lV3WVZoYWJHUiNSbk5hVnpVdytHMDVlVnAzUCswa0okUk
1NMEp6WkZka2NHSnBPRDBrSiRSalIzZypXakpzZFZ7Vk1Xa
GpSK0ZvWW0xR2JscFkkVzFrYlZaNVl6SnNkbUpxTUcqa2JW
WjVZekpzZG1KcFYrMGtSMlYwSlE9PQ==

Links

Leave a Reply

Your email address will not be published. Required fields are marked *

13 − 9 =

Skip to toolbar