zDevelopers / ImageOnMap

Repo for ImageOnMap, a bukkit plugin created to display any image using a map
https://dev.zcraft.fr/imageonmap
Other
191 stars 101 forks source link

Maps from local files? #78

Open emctague opened 4 years ago

emctague commented 4 years ago

I'm trying to use this plugin from within my own plugin - the idea is my plugin shows discord image links in chat which when clicked give the user the image using /tomap. Trouble is, your command can't download these images, so I have to pre-download them - but it doesn't seem I can trick your plugin into making maps from local files on the server.

This is a feature request for /tomap file://<whatever> to work for certain paths! :)

Vlammar commented 4 years ago

It's already possible, on my local test server i used the folowing command: file:///C:/Users/admin/AppData/Roaming/.minecraft/screenshots/2019-11-24_12.52.08.png That gave me the following result https://i.zcraft.fr/2587751587857263.png You simply have to put file:///PathToImage You missed a /

Vlammar commented 4 years ago

But we may change it to a specific folder, this is not realy cool to be able to access all stored image on a server ;). We may add a specific permission by default for OP only, if the link is not a valid one (no http(s) or ftp://) then we check a folder if the image is stored in it.

emctague commented 4 years ago

Ah, I was only trying relative paths, assuming it'd work relative to the working directory of the server! Thanks for letting me know that it works with full paths... though that really is a bit of a security issue!