Jecon icon indicating copy to clipboard operation
Jecon copied to clipboard

the plugin is not successfully hooked into Vault.

Open Megumiso opened this issue 5 years ago • 2 comments

steps to reproduce: Install Jecon and another plugin that hooks into Vault (iConomy, Essentials, etc...) show balance from these plugins.

expected behavior: show the same amount of money.

actual behavior: showing differently. bbc4e8c0437337d3ad80247fb6a24a81

Megumiso avatar Sep 09 '20 14:09 Megumiso

also, plugins that hooked into Vault cannot modify player's balance.

Megumiso avatar Sep 09 '20 16:09 Megumiso

英語で説明するの面倒なので日本語で書きますね。

これなんですが、おそらくJeconの問題ではなく、VaultやVaultAPIを使用するプラグイン側の仕様的な問題だと思います。

VaultAPIを使用する際にはBukkitのgetRegistrationを使用するのですが、このAPIは複数の経済プラグインが登録されている際にそのうちの1つしか取得できません。 もちろん、登録されている経済プラグインを全て取得するgetRegistrationsもあるにはあるのですが、多くのプラグインでgetRegistration's'ではなくgetRegistrationを使用してます。 そもそも、VaultAPIの例がそのようになっています。(setupEconomy()の部分)

そのため、複数の経済プラグインが登録されていると「そのうちのどれか」という挙動になってしまい、一見すると経済プラグインが正しく動作していないように見えますが、これは"プログラム的"には正しい動作です。("直感的"に正しい動作かはともかくとして……)

複数の経済プラグインを併用すると金額が一致しないのはそのような理由から起こる仕様であり、Jeconのバグではない……と、僕はそう解釈しました。

HimaJyun avatar Sep 26 '20 21:09 HimaJyun