gabrielecabrini / EconomyPlus

Minecraft plugin (Economy) for 1.8 to 1.18
https://www.spigotmc.org/resources/economyplus.92975/
GNU General Public License v3.0
10 stars 14 forks source link

[BUG] Economy provider returning incorrect balance if the player name is provided. #47

Closed pollitoyeye closed 2 years ago

pollitoyeye commented 2 years ago

Using the following code to check a player's balance while also having Vault in the server:

Player p;

RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
    return false;
}
econ = rsp.getProvider();

double currentMoney = econ.getBalance(p.getName());

It seems to be returning incorrect values even if the player has money in his wallet.

jakepronger commented 2 years ago

Thank you for the bug report. Can you please elaborate on logs or if anything else occurs? What type of invalid balances did you receive? Please take screenshots or send logs or feedback as to what you receive when you try to get the balance.

I personally will try reproducing this error and work on it later.

DaRacci commented 2 years ago

The issue is that the provider is gotten before EconomyPlus has registered its own, EconomyPlus must add a loadBefore for this plugin or that plugin must add a softDepend on EconomyPlus