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
@matthiasvd2
Currently right now, no. I have no control over paintings or anything beyond maps due to the already preset restrictions with Minecraft. I'm hoping in 1.4 they would do something similar like this to another item or the Item Container.
Great plugin, But one question. Can you do the same with Paintings? And if you right click on a wall he would get the size of the image?
I hope you can make this that would be so cool!
Matthiasvd2
Okay, apparently no one minds if I use MCStats... Therefore, I will. Nevermind, too difficult...
@hawkfalcon
You love drooling?
<3
@FrauKoujiro
Sure! I'd love to help. :)
I'm fairly new to the world of programming, but I programmed an alarm system from scratch a few days ago in C without too much trouble.
@Maximvdw
Should I just make you a Ticket manager or something, you seem to help everyone here a lot... xD
Anyways, I added the AsyncDelayedTask, however it's under a LosingPixels (experimental) build since I have no idea in what instances it will error. I also added the slideshow function as per your request; however, I am working on actually saving the URL's for the slideshows. Currently, though, it saves the URL's for the images in the latest regular stable build. And yes, they do stay on the whole time, unless you, obviously, change the image.
edit: CaptainJohnnyBlu should be one too, I dunno, I want a response first before I go ahead with this.
@seiterseiter
map_1,map_2... are just map ID's like you would create a new map on a crafting bench. It replaces the map image of the map you are holding with a custom image
@FrauKoujiro
But this only has to be done once:
1) Edit your plugin so it can store Img URL's 2) Make it so that at onEnable() it reloads those URLS 3) I added notes where you have to put an AsyncDelayedTask, this will allow you to render X images in the (same) time. It will be much much faster.
Once the images are loaded (startup) they stay on it whole the time.
NOTE: 1.4 Maps in image display wont render unless the same map is in a players hand
gr, Maxim
@Maximvdw
@CaptainJohnnyBlu
The thing is; It still both needs to use bandwith to get the image and render it.
@JM120897
You can already show off custom art using server texture packs. It can send your players a file containing some alternate painting images. ;)
How big will the frames be by the way? I heard they were 1x1, could be wrong.
@seiterseiter
What are you talking about? An image can be rendered onto a certain map (map_4 for example) and anyone on the server with that map in hand will see that image! It's a fantastic 2 command plugin;
/map http://some.website.com/sexyimage.jpg renders an image onto currently held map..
/restoremap gets rid of the image on the currently held map and restores the usual minecraft map renderer..
Does this make worlds for the maps or just makes a map an image.
This is going to be incredibly amazing when minecraft 1.4 item frames are released, You'll be able to make REAL ART museums, and a lot of many different things, congratulations for this plugin, and keep this amazing work to last for a lot of updates! thank you!
@Maximvdw
Okay I've downloaded the source and I managed to get it into eclipse. I modified the map list file location (no idea if it will work after this though). And now I'm recompiling it. I had some errors concerning duplicate entries or something but I think I've figured that out.
I even made a variable to put the location of the file list because it as referenced multiple times!! String MapsListFileName = "/maps.list";
Swapping the actual map item in a players would be a good way to save bandwidth i guess, but then you could only have one slideshow going at once.. I'm going to attempt doing what the image map renderer thingy does but in some sort of loop initiated and stopped by a command if I can ;D
@FrauKoujiro
Its possible, but not the way You see it ;)
Try to render all the images on a diffrent map (map_1,2 ,...)
then switch the Item in the players inv with another, you get a slidshow effect
Another idea: try to create multiple images into an animated give and render that
(I thought that was possible SOMEHOW)
@FrauKoujiro
Yeah but I'm a noob and I don't know how to recompile.. ;P
@CaptainJohnnyBlu
I probably messed up, it might be because of the backslash, not a forwardslash. The source is at https://github.com/CirnoTheGenius/ImgMap, you don't need to decompile..
Ahh problem, i'm getting this error:
01.10 22:14:27 [Server] SEVERE java.io.FileNotFoundException: /home/minecraft/multicraft/servers/titsmc/plugins/ImgMap\MapData.list (No such file or directory)
I'm guessing it's something to do with the file separator char being different on Windows and Unix based operating systems. Windows accepts \ and / as acceptable chars while Unix based OS's only accept /. Interestingly, a file called "\MapData.list" was generated...
I'm gunna try and modify the jar and see if i can verify this.. i'm a java noob though ;D
@FrauKoujiro
Ahh awesome dude!!! So the map data list can be modified to source images automatically ;D
I reckon the slideshow idea is so awesome, and the images are so low res anyway, bandwidth shouldn't be an issue. I dunno though, you're the expert. ;)
Released 1.7, allows permanent maps. The map images can be altered in the MapData.list file.