ImgMap
ImgMap: Render any image on an in-game map!
By Evangon, Maximvdw, and JohnnyBlu
Originally coming from a picture of a troll face by md_5, this plugin allows a user with a map in hand (obviously with the proper permissions) to essentially put an image onto the map. The image could be anything: Instructions, rules, messages, warnings, a very nice picture of a cat, whatever you want! All images are resized to the proper dimension of 128x128. The image is then sent over to a rendering process (Devs: Check the source on how it's done if you want), which then the map renders the image for that map. Anyone with a map with the same ID (Typically, it says when you hover over it, e.g "Map #0") to see the same image too! The only downside to all of this is that due to the nature of Minecraft maps, they do not support full color. This is due to a limitation on the clients themselves.
Installation
Just drop it into the /plugins/ folder! No special configuration needed!
How to use
- Give yourself a map with a specific ID. This ID can be anything, but remember, once you draw an image on it, it will pertain only to that specific ID!
- Get the URL of the desired image! This is where some people mess up. In order for the plugin to successfully render it, it has to be a direct link to the image. Simply right click on the image and hit "Copy Image Location".
- Hold the map with the super specific ID and type in "/drawimage" and paste it! For most users, to paste, you do "CTRL+V".
- Wait a bit; rendering can take a bit. You'll notice several segments appear on the map; this it indicating that it's loading. If nothing happens, you're either met with a message that says something along the lines of "Server Internal Error" or you're staring a blank map. If you get kicked with the message with "Server Internal Error", simply type, in console, "fixmap <your super specific id>". This basically fixes the map with the old over world rendering. Try again; if it doesn't work, report it in the comments! However, if you are getting nothing, be sure the image is accessible directly from your browser (clear your cache before you do so!) Sometimes, what happens is that the owner of the website has set privileges denying anyone from accessing the image directly. A bit bothersome, but you can probably save the image and upload it somewhere else. However, when doing so, please follow the copyright usage on said images!
- Viola! Your map now has that pretty picture of a kitty or something!
Commands
- /drawimage <image url> Draws the specified image to the map you're holding. If you want to "save" the picture to the map, you add "-s" to the end of the command. The reason why "save" is written in quotations is because it doesn't actually save the map's picture; it simply saves the URL and it's corresponding ID to a flatfile and is loaded on start up.
- /drawanimatedimage <gif url> Attempts to draw an animated gif image. A little buggy here and there, but it works for the most part! Please be warned that this takes up a lot of bandwith (You're sending anywhere between 0 to 16kilobytes nearly every second!) and that it also is resource intensive!
- /drawytvideo <yt-ID> Experimental. Downloads a video and converts it to a GIF format. See /drawanimatedimage for more information as the same process is used.
- /emulategb <rom name> Highly experimental. Emulates a GameBoy (only GameBoy, not GameBoy Advanced or GameBoy Color) game on a map. Fully integrated, no client mods needed! Click on the chat messages given in chat to control the emulator.
- /emuaction <save|load|a|b|left|right|up|down|holdinput> Simulates input for emulated GameBoy games on a map. Used by the gamepad, you can also use it as a command if you wish. Note that "save" and "load" do not work as of current. Any input button just simulates input. "holdinput" makes the emulator act as if the person is holding down a directional button and directional only.
- /clearmap With a map in hand, this command wipes the image off of it and puts the old Minecraft map rendering back.
- /fixmap <id> A debug command, Caused an issue with a map that psudo-bans them? No worries! Simply get the ID of the problematic map, and type this command in, replacing <id> with the map's id. It's like /clearmap, only this time, you can target maps!
- /getmap <id> More of a debug command, but can be helpful for some, it allows you to get a map by almost any ID. The reason why this is "almost" is because if you try to get a map that is above the number that exists, it merely just goes over and gets the next ID, rather than the one you want. This is something that's within Minecraft that I cannot fix.
Permissions
- imgmap.*: Grants almost all rights to ImgMap. This does not include debug commands.
- imgmap.debug: Grants debugging rights to ImgMap. Does not include drawing or restoring capabilities.
- imgmap.drawimage: Allows you to draw an image to a map.
- imgmap.drawanimatedimage: Allows you to draw an animated image to a map.
- imgmap.clearmap: Allows you to clear a map and restores the overworld rendering.
- imgmap.debug.fixmap: Debug command. Allows you to remove all renderers on a given map ID.
- imgmap.debug.getmap: Debug command. Allows you to get a map by any ID.
Source for Developers/Contributors
Found a bug that you want to squash yourself? Go ahead and fork me! (Please don't actually stab me with a fork!) https://github.com/CirnoTheGenius/ImgMap-LosingPixels
Examples
@CaptainJohnnyBlu
Why do you say that?
Hmmm 1.5 is strange..
oooooooooops, 192 not available on 1.5 :(
@Hockeymikey /map perm renders a blank map for me too. I second this, a fix would be greatly appreciated!
Would it be unreasonable to make it so that when a map is permanent, instead of storing the URL to the remote-hosted image you actually kept a copy of the image itself in a file in the plugin directory? You wouldn't even need a lookup to go from map name to URL because you could just use the map name as the filename of the image file. I think this would be a lot more permanent than just keeping the URL. Under the current system, the permanent map images are only as permanent as the remote hosts' URLs are. Some hosts make guarantees about their links being permanent, but not all do.
(Or better yet, store the images *after* they have been converted into the map palette colors and the 128x128 resolution, to save the server from having to do that effort again later.)
Great plugin, but the client occasionally forgets the map data in the middle of a running session and won't contact the server to reload it - so you get a blank map that had previously been working that session. Logging off the client from the server and then logging back in again seems to fix it though (provided MapsDefaultPermanent is true, of course).
@ov3rk1ll
I should try to do it :)
@poiNt3D
The MapData.list is just ID > URL. The problem is, that there is no way to reload the data from this file without restarting the server.
Maybe a better decision would be to make a human readable/editable text file with map numbers and urls. But it's not necessary, just please please fix the bug!
Awesome plugin. There is only one thing I'm missing. Could you add a command to either change to url like /map <ID> <URL> or to reload the data from MapData.list (or both).
I love the plugin, I just wish the maps stayed after reboots, I dont like using this on to many things because it sucks having to render them each time i restart the server :(
Thanks for the plugin though :)
@CollinDesigns
True Dat. Unfortunately.
@Qwahchees
Doesn't work upon reboot map are default again.
@Hockeymikey
To fix this, go into the config file and change MapsDefaultPermament: false to true, while the server is off. Start it, set your maps with the regular /map command and you're good!
/map perm renders a blank map. can we get a fix for this?
Everytime i shut down the image disapears on the map :(
One way to get lots of people on your server...... PUT THE AWESOME FACE ON THE MAP AND PUT IT IN AN ITEM FRAME LOL
HOLY OMG
@dev7kasper
got the same bug 2, player dots appear after restarting the server.
Hi! Great plugin you have here!
When we tested it, it worked fine with "/map URL" command. We had problems using "/map perm URL". It didn't say anything to chat or console, but it tried to render. Unfortunately it rendered blank (a.k.a. nothing). We are using almost latest Spigot build #511 (bukkit modification) and FreeBSD as operating system.
My friend had same issues with the permanent saving. He uses windows 7 and latest bukkit build.
Hopefully you can repeat the issue and find what's the problem.