ArcanePlugins / Treasury

🏦 A powerful multi-platform library for next-level plugin integrations.
https://hangar.papermc.io/ArcanePlugins/Treasury
Other
56 stars 13 forks source link

EconomyProvider Registry not being Detected #209

Closed gmitch215 closed 1 year ago

gmitch215 commented 1 year ago

Expected behavior

EconomyProvider is registered correctly and viewed

Observed behavior

Linked to Issue #33 on Novaconomy:

@GamerCoder215 I tried to start it up with plugmanX not installed and no change still cannot use commands I took a look in the latest log but I do not see any specific errors I will also note that treasury does not register novaconomy as an economy with this issue as well latest.log image

Reproduction steps

  1. Load Novaconomy Plugin with Treasury Installed
  2. Novaconomy recognizes Treasury installed, uses Treasury API to register its EconomyProvider
  3. Treasury should work as usual, however no EconomyProvider is shown.

image

Stack trace or error log

https://gist.github.com/GamerCoder215/48345f47695e259c3403241d7d80bf18

Treasury information

Unknown

Additional information

Code Used:

// TreasuryRegistry implements EconomyProvider
    public TreasuryRegistry(Novaconomy plugin) {
        // this.plugin = plugin;

        ConfigurationSerialization.registerClass(TreasuryAccount.class);
        TreasuryAccount.global = NovaConfig.getGlobalStorage();
        TreasuryAccount.treasuryAccounts = TreasuryAccount.global.isConfigurationSection(TREASURY_ACCOUNTS) ? TreasuryAccount.global.getConfigurationSection(TREASURY_ACCOUNTS) : TreasuryAccount.global.createSection(TREASURY_ACCOUNTS);

        ServiceRegistry r = ServiceRegistry.INSTANCE;
        if (!r.serviceFor(EconomyProvider.class).isPresent()) {
            r.registerService(EconomyProvider.class, this, plugin.getName(), ServicePriority.HIGH);
            plugin.getLogger().info("Injected Novaconomy EconomyProvider into Treasury");
        }
    }

More code is available on the Novaconomy Repository.

gmitch215 commented 1 year ago

Update: Treasury is crossing out the Novaconomy EconomyProvider. image

lokka30 commented 1 year ago

The crossing out is a visual bug on server consoles where the strikethrough on the arrow seems to continue forwards 😃

I also recommend registering the economy provider regardless if one is present or not - this is why we are using priorities.

Is the issue resolved?

gmitch215 commented 1 year ago

The crossing out is a visual bug on server consoles where the strikethrough on the arrow seems to continue forwards 😃

I also recommend registering the economy provider regardless if one is present or not - this is why we are using priorities.

Is the issue resolved?

I usually check that to make sure I don't register it multiple times (unless that's automatically checked)

His response was:

okay update i figured out why treasury crossed out novaconomy I had treasury (as well on the servers) in bungee but novaconomy only on one server, which wasnt needed so you dont need to look into that

I'll close this as nothing related to Treasury needs further investigation, thanks for the information though.