LOOHP/ImageFrame

[Feature Request] Allow Console to execute Refresh Command

Closed this issue · 3 comments

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!

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

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".

Thank you for the clarification! It works great now.

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