Fix the inability to override commands (Backport of https://github.com/CloudburstMC/Nukkit/pull/2196)#311
Conversation
|
I think different judgments need to be made based on usage. |
What? Just try to override a command without this PR, it wont work because this if-block was broken 8 years ago, mismatching "this.commandMap" with "commandMap". With this PR it's once again possible to override a command. However, why should we make some judjements about something THAT simple? Command SHOULD allow changes from foreign command map if:
|
|
Also, registering a command (not overriding it) works fine |
I mean register(null) will return true |
|
Null safety check should fix the problem? |
This PR backports from upstream pull CloudburstMC/Nukkit#2196
tl;dr fixes command overriding which is not possible without this changes
sample code: