brcdev-minecraft / shopgui-api

Public API for ShopGUI+ plugin
MIT License
9 stars 6 forks source link

Null Pointer with method registerEconomyProvider #11

Closed TheCoolestPaul closed 4 years ago

TheCoolestPaul commented 4 years ago

With my Tokens plugin I have implemented your API to ShopGUI+, I will paste my code and the error below.

My EconomyProvider The error in console

brcdev commented 4 years ago

When exactly is the TokenShopGUIPlus constructor (in particular the ShopGuiPlusApi.registerEconomyProvider(this); line) called in your plugin?

TheCoolestPaul commented 4 years ago

It is ran inside of the onEnable method of my Tokens plugin.

TheCoolestPaul commented 4 years ago

Via this code if(Bukkit.getPluginManager().getPlugin("ShopGUIPlus")!=null){ tokenShopGUIPlus = new TokenShopGUIPlus(this); this.getLogger().info("Successfully registered Tokens as ShopGUI+ economy"); }

brcdev commented 4 years ago

What versions of Tokens and ShopGUI+ were you trying it with? I've grabbed this build of Token and ShopGUI+ 1.42.0 and it it seems to be working perfectly fine:

[14:37:18] [Server thread/INFO]: [ShopGUIPlus] Registered custom economy provider 'Tokens'.
[14:37:18] [Server thread/INFO]: [Tokens] Successfully registered Tokens as ShopGUI+ economy
TheCoolestPaul commented 4 years ago

As in the error message dump it says ShopGUIPlus (1.41.0), Tokens (3.9.7) Might that be the error?

brcdev commented 4 years ago

It's rather unlikely but worth trying anyway.

brcdev commented 4 years ago

@TheCoolestPaul did updating resolve your issue?

TheCoolestPaul commented 4 years ago

I'm kind of the middle man on this issue. I am the developer of Tokens and I used your API (Hopefully correctly) and a user of Tokens had this error and I was passing it on in an attempt to help them.. I assume it's fixed because they haven't responded. Thank you for the support!