LOOHP/ImageFrame

[Feature request] Start creating maps from a specific ID

Opened this issue · 4 comments

Hi, after trying your plugin I noticed something that would be really nice to address.

Is it possible to add in the config file something that let you state from what map ID start creating the maps of the plugin?
For example, if you state that you want to start from ID #100000, the plugin will ignore all previous IDs and start creating files in the world folder like map_100000.dat, map_100001.dat, and so on.

This should allow storing those maps on the world folder in a more organized way, instead of having survival / treasure maps combined with custom maps like: "map_1.dat" is a treasure map, "map_2.dat" is a custom map created with the plugin. As is not possible to have the custom maps on a different folder completely separated from the normal maps, this could be the closest solution to this small issue.

LOOHP commented

Right now, the plugin uses the Bukkit API to ask for the next id available and there's no method in the API to jump to a specific ID.
Besides, let's say we start at 1000, when we create 1000 normal vanilla maps, the next one we create will collide with our custom map at id 1000. So it's not as simple as that, will need to think about this further.

How that call to the API works? Like, if you ask the API what is the next ID available, can you specify an ID to check if that one is? Is there any other things there that are related to the map IDs and its management? Maybe you could play with that to achieve this.

And about starting with 1000... I think no one that runs a survival server would put a number that small in the config. Depending on the amount of players, and if they create lots of normal or treasure maps, it makes sense to put an insane number like 10,000,000 or something like that. I don't know what is the current limit for map IDs, but if that limit is the limit of Int32 (2,147,483,647) we have an unrealistic limit of maps to reach (and imagine if that limit is from Int64 instead...). The only thing that could make the server come close to that amount of maps is someone mass-creating them with macros or something to try to damage the server, but server staff should be able to notice if something like that is happening, and also they should not set the per-user limit to unlimited if that actually happening is a possibility for them.

The only thing that would completely fix this is if you could set a different directory as the location to save the maps, and make the server be able to reach that location and load the maps normally, also those using names not depending on IDs, but just saying that out loud sounds impossible. Sadly we can only play with that ID limit, and only having the default world data folder as the place to store the maps.

That's all that I was able to think about this matter. I hope this can help you to decide what to do and how. I just think that this would be a really nice feature to add, and that it could make this already great plugin into a perfect one for all of this.

Also, thanks for responding!

LOOHP commented

Unfortunately, there are no methods in the BukkitAPI to create a new map that isn't the next available ID. So if I were to implement a change like this, it'll be quite complicated. Tho this is a good suggestion, at least in its idea. We'll see what happens.

Maybe you can try negative map id
like this plugin does
https://www.spigotmc.org/resources/syncstaticmapview-archive.96333/