Class MapImageManager
java.lang.Object
studio.magemonkey.codex.mccore.gui.MapImageManager
Manages loading images for all plugins to prevent duplicate loading
of the same image and keeps everything in one place.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MapImageManager
public MapImageManager()
-
-
Method Details
-
getImage
Retrieves an image from the specified path. The path starts from the root of the server, so if you're getting an image from your plugin's data folder, you need to include "plugins/MyPlugin" before it. This will load the image if it hasn't been loaded already.- Parameters:
path- path to the image- Returns:
- loaded image
-
copyImageResource
public static boolean copyImageResource(org.bukkit.plugin.java.JavaPlugin plugin, String name, String path) Copies an embedded image resource from the plugin to the given path. The path is from the root of the server so to place it within your plugin's data folder, preceed the path with "plugins/MyPlugin".- Parameters:
plugin- plugin to get the resource fromname- name of the resource image (including extension)path- path to the destination- Returns:
- true if copied successfully, false otherwise
-