Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

plugin.getCommand(...) returns null for aliases #78

Open
twixi opened this issue Mar 22, 2017 · 5 comments
Open

plugin.getCommand(...) returns null for aliases #78

twixi opened this issue Mar 22, 2017 · 5 comments

Comments

@twixi
Copy link

twixi commented Mar 22, 2017

https://dev.bukkit.org/projects/random-spawn?gameCategorySlug=bukkit-plugins&projectID=31459

https://github.com/Josvth/Random-Spawn
please create support this plugin!

@rutgerkok
Copy link
Owner

I need a more specific error. What exactly is not working?

(I'm closing this issue for now, but I can always reopen it if needed. You can also still comment while it's closed.)

@twixi
Copy link
Author

twixi commented Apr 3, 2017

`2017-4-3 20:43:02 [ERROR] [Pokkit] Error occurred while enabling Random_Spawn v2.6 (Is it up to date?)
java.lang.NullPointerException
at me.josvth.randomspawn.handlers.CommandHandler.(CommandHandler.java:25)
at me.josvth.randomspawn.RandomSpawn.onEnable(RandomSpawn.java:38)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:292)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337)
at nl.rutgerkok.pokkit.plugin.PokkitPluginLoader.enablePlugin(PokkitPluginLoader.java:69)
at cn.nukkit.plugin.PluginManager.enablePlugin(PluginManager.java:446)
at cn.nukkit.Server.enablePlugin(Server.java:634)
at cn.nukkit.Server.enablePlugins(Server.java:623)
at cn.nukkit.Server.(Server.java:470)
at cn.nukkit.Nukkit.main(Nukkit.java:68)

`
https://dev.bukkit.org/projects/random-spawn/files/696056

@rutgerkok
Copy link
Owner

This the offending source code:

    this.plugin.getCommand("randomspawn").setExecutor(this);
    this.plugin.getCommand("rs").setExecutor(this); // error occured on this line

So the error is that plugin.getCommand(...) does not work on aliases. Thanks, that should be enough info for fixing it!

@rutgerkok rutgerkok reopened this Apr 4, 2017
@rutgerkok rutgerkok changed the title Random spawn support plugin.getCommand(...) returns null for aliases Apr 4, 2017
@twixi
Copy link
Author

twixi commented Apr 4, 2017

You can make this plugin to work?

@rutgerkok
Copy link
Owner

rutgerkok commented Apr 4, 2017

I probably could if I put enough time in it, however, please see this section of the README:

In general, I will only fix a bug for you if happens to also affect me. Pokkit is a personal project that I uploaded in the hope that it will be useful to others, but I'm not willing to spend the time to create a complete, bug-free implementation of the Spigot API. See my reasoning in the introduction.

Still, I will leave open all valid bug reports, so that anyone interested in improving Pokkit can have a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants