rutgerkok / Pokkit

Nukkit plugin that is able to load Bukkit plugins. Bring your Bukkit plugins to Minecraft PE!
Other
79 stars 27 forks source link

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

Open twixi opened 7 years ago

twixi commented 7 years ago

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

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

rutgerkok commented 7 years ago

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 commented 7 years ago

`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 commented 7 years ago

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!

twixi commented 7 years ago

You can make this plugin to work?

rutgerkok commented 7 years ago

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.