Giter Site home page Giter Site logo

Comments (3)

Sleaker avatar Sleaker commented on August 17, 2024

the number of plugins doesn't effect Vault. You shouldn't be checking the economy enabled status unless you're absolutely certain your plugin loads after your economy. I imagine that it's failing because it thinks your econ is disabled when it loads your plugin.

from vault.

zach-all avatar zach-all commented on August 17, 2024

ok thank you very much :)) SOLVED

from vault.

dredhorse avatar dredhorse commented on August 17, 2024

well the problem is that you are just checking for the provider once... it is a little bit more complicated like that (at least for me).

I use a boolean to signal that an economy provider was found and than check in my code if that is set before I do stuff...

if (checkVault != null && !plugin.isEconomyEnabled()) {
            plugin.setVaultFound(true);
            mainLogger.info("Vault detected");
            mainLogger.info("Checking economy providers now!");
        }
        if (plugin.isVaultFound() && !plugin.isEconomyEnabled()) {
            RegisteredServiceProvider<Economy> economyProvider = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
            if (economyProvider != null) {
                plugin.setEconomy(economyProvider.getProvider());
                plugin.setEconomyEnabled(true);
                mainLogger.info("Economy provider found: " + economyProvider.getProvider().getName());
                if (mainConfig.isEnableGetPayed()) {
                    mainConfig.setGetPayedActive(true);
                    mainLogger.info("Activating GetPayed!");
                }

            } else {
                if (missingEconomyWarn) {
                    mainLogger.warning("No economy provider found.");
                    mainLogger.info("Still waiting for economy provider to show up.");
                    missingEconomyWarn = false;
                }
            }
        }

from vault.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.