Closed caelunshun closed 4 years ago
@caelunshun thanks for the report. Im aware of this issue, it was mostly a design decision aimed at making things easier on the development side. Since a command sender isnt a player, you get that exception.
I plan on updating the command system eventually to support commands from the console.
In case anyone is interested in working on this and submitting a PR, the issue here is with how we use ACF (Annotation Command Framework). All of our methods that have the ACF annotations on them take GPlayer
as a parameter. On line 136 in GlobalWarming.java
, we register an issuer context using the CommandSender
as a Player
which is what is necessary to convert a command sender to a GPlayer
.
However, we wish to add some support for just CommandSender
s to issue commands. So we might want to replace GPlayer
with CommandSender
in all of our method signatures and instead include logic as needed to convert the command sender to a GPlayer
when necessary and display error messages as needed.
When running one of the plugin commands from the console, a NullPointerException occurs.
To Reproduce
Expected behavior Instead of throwing an exception, a message would be sent saying that a player needs to execute the command.
Exception: