LOOHP / ImageFrame

Put images on maps and walls!
https://www.spigotmc.org/resources/106031/
GNU General Public License v3.0
40 stars 12 forks source link

[Feature Request] Allow Console to execute Refresh Command #16

Closed Bluejeanx closed 1 year ago

Bluejeanx commented 1 year ago

I encountered a roadblock to the development of a feature where it would require regular updates of the maps. The command works perfectly when I run in the game but I cannot always manually update it. I understand that console should not be able to execute creation commands but I think it is reasonable to have the console allowed to run the refresh command which would allow cool implementations of dynamic displays. Hope you consider this suggestion. Thanks!

Bluejeanx commented 1 year ago

Hi, thank you for making time for considering this request and adding it in. However, I have encountered the same problem with the plugin sending back that it cannot be run by console even using the latest development build. This is shown below.

ver ImageFrame
[16:05:40 INFO]: ImageFrame version 1.7.4.2
[16:05:40 INFO]: Put images on maps and walls!
[16:05:40 INFO]: Author: LOOHP
imageframe refresh coolantfanStatus https://i.ibb.co/XzvwLJH/TBD.png
[16:05:51 INFO]: This command can only be ran by players!

I am not at all experienced with plugin development but I looked at your commit and noticed these lines still have the "No Console" message. Those would be lines 642 through 645. Perhaps that may help but again, I am no expert.

if (imageMap == null) {
                        if (!(sender instanceof Player)) {
                            sender.sendMessage(ImageFrame.messageNoConsole);
                            return;

I apologize for the hazzle.

LOOHP commented 1 year ago

You need to specify which player from the console. So if I create a map called "picture", from the console I have to put in "LOOHP: picture".

Bluejeanx commented 1 year ago

Thank you for the clarification! It works great now.

For anyone wondering about the command; "imageframe refresh (playername):(mapname) (URL)"