I would like to show different players different versions of the same map and am a bit confused on how I would go about doing this. Thanks EDIT: This is about the map item, sorry for the confusion.
Nogtail Be prepared for something really tricky! Use protocolLib, else you won't survive. Basically you need to modify the outgoing packets, or send new ones when the player joins. The first option is the less-laggy one client side but needs your plugin to depend on ProtocolLib. Here is a list of all possible Packets: http://wiki.vg/Protocol#Multi_Block_Change http://wiki.vg/Protocol#Chunk_Data http://wiki.vg/Protocol#Block_Change http://wiki.vg/Protocol#Map_Chunk_Bulk <- This is the one you will probably need. Since I have never worked with those packets I will try to explain how to do it but if it doesn't work then I won't be able to help :/ If you take a look at how orebfuscator does this you see it listens for the outgoing Packets.MAP_CHUNK and Packets.MAP_CHUNK_BULK. (https://github.com/lishid/Orebfusca...lishid/orebfuscator/hook/ProtocolLibHook.java) You will have to do the same. Then it looks like it uses a the Calculations class to obfuscate the chunk. (https://github.com/lishid/Orebfusca...id/orebfuscator/obfuscation/Calculations.java) As you probably see it's pretty "advanced" stuff. I would send the author if he can help you with this since I'm not very common with this kind of packet manipulation. Taking a good look at orebfuscator will be a good to learn more about the map format/packet manipulation.
Sorry, I ment as in the map item, I should have been more clear. The resources you have linked have given me a bit of info (http://wiki.vg/Protocol#Maps) but wondering if you know anything about this, thanks
Nogtail Oh thats a good thing, it's way easier to render diffrent stuff on a map using the build in map api: http://wiki.sk89q.com/wiki/Bukkit_map_API
You can do this with the Bukkit Map API, no need for any NMS hackery. Basically, when you construct your custom map renderer, pass true to the superclass constructor, e.g. PHP: public class MyRenderer { public MyRenderer() { super(true); } public void render(MapView map, MapCanvas canvas, Player player) { // ...map rendering code here... } } That super(true) indicates that you want a per-player rendering context, i.e. a separate MapCanvas object will be maintained by CraftBukkit for each player. This means every player can see a different image on the same map.
Will this work if the map is on an item frame? Haven't looked at the code for item frames so not sure how they handle maps.
Nogtail Indeed it does! I've personally verified that per-player context works too: http://dev.bukkit.org/bukkit-plugins/scrollingmenusign/pages/view-types/map-views/#w-framed-maps
Sorry to post here but I figure it is kind of related, how would you go about spawning maps inside item frames and keep track of what map it is so you can write image data to it?
Nogtail to keep track of which map you're using, you could persist its ID, either in your main config.yml, or perhaps in another file. This (untested code) example just uses the main plugin config. PHP: short mapId = plugin.getConfig().getShort("mapId", -1);MapView view;if (mapId == -1) { view = Bukkit.createMap(world); plugin.getConfig().set("mapId", view.getId()); plugin.saveConfig();} else { view = Bukkit.getMap(mapId); // ...you should really check for null here and get a new map if so...}ItemStack mapItem = new ItemStack(Material.MAP, 1, view.getId());frame.setItem(mapItem);