Support for latest Gringotts
LemADEC opened this issue ยท 6 comments
As previously reported in #690 , Gringotts changed its API sometime back and broke compatibility with Vault.
Any chance we get a fix for that?
Vault 1.4.1 and 1.6.1 are reproducing the issue with Gringotts 2.9 and 2.10.
Here's a sample log when used from Booscooldown and Vault 1.4.1:
[17:21:15 ERROR]: Could not pass event PlayerCommandPreprocessEvent to boosCooldowns v3.8.5
org.bukkit.event.EventException
> at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:338) ~[JavaPluginLoader$1.class:1.7.10-1614.57]
> at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[RegisteredListener.class:1.7.10-1614.57]
> at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:507) [SimplePluginManager.class:1.7.10-1614.57]
> at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:492) [SimplePluginManager.class:1.7.10-1614.57]
> at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:1348) [nh.class:?]
> at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:1107) [nh.class:?]
> at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(C01PacketChatMessage.java:38) [ir.class:?]
> at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(C01PacketChatMessage.java:53) [ir.class:?]
> at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:245) [ej.class:?]
> at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:181) [nc.class:?]
> at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:1023) [MinecraftServer.class:?]
> at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432) [lt.class:?]
> at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:841) [MinecraftServer.class:?]
> at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:693) [MinecraftServer.class:?]
> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]
Caused by: java.lang.NoSuchFieldError: accountHolderFactory
> at net.milkbowl.vault.economy.plugins.Economy_Gringotts.getBalance(Economy_Gringotts.java:135) ~[Vault-1.4.1.jar:?]
> at net.milkbowl.vault.economy.plugins.Economy_Gringotts.has(Economy_Gringotts.java:145) ~[Vault-1.4.1.jar:?]
> at net.milkbowl.vault.economy.AbstractEconomy.has(AbstractEconomy.java:30) ~[Vault-1.4.1.jar:?]
> at cz.boosik.boosCooldown.BoosPriceManager.has(BoosPriceManager.java:113) ~[boosCooldowns-3.8.5.jar:?]
> at cz.boosik.boosCooldown.BoosCoolDownListener.checkRestrictions(BoosCoolDownListener.java:76) ~[boosCooldowns-3.8.5.jar:?]
> at cz.boosik.boosCooldown.BoosCoolDownListener.onPlayerCommandPreprocess(BoosCoolDownListener.java:241) ~[boosCooldowns-3.8.5.jar:?]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_141]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_141]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_141]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_141]
> at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:334) ~[JavaPluginLoader$1.class:1.7.10-1614.57]
> ... 14 more
I don't see the problem here. Gringott's hasn't changed the existence of the method in the error you're detailing: https://github.com/MinecraftWars/Gringotts/blob/master/src/main/java/org/gestern/gringotts/Gringotts.java#L55
Are you using the official version? If this is the actual case, gringotts may need to support vault methods themselves if they are changing the API around.
Also can't really help for old versions of Vault.
The version included in Vault lib is anterior to the relocation of the class AccountHolderFactory.
In that old version, it's org.gestern.gringotts.AccountHolderFactory
while in official Gringotts 2.9, it's org.gestern.gringotts.accountholder.AccountHolderFactory
Would that explain the issue?
Looks like a nested dependency is scanning all jars and fails to handle filenames with a '+' sign in it, this causes an exception. The is poorly handled, and 'hides' a permission issue in the direct dependency. The latest was preventing Gringotts to finish its initialization and register with Vault.
Vault detected Gringotts with no registered hook, defaulting to its legacy/broken handling of Gringotts.
At least it's fixed now, thanks for the help!
@LemADEC it does. but this is a breaking change for future versions and shouldn't have been moved. This is an issue that will now need to be fixed on gringotts end by supplying their own working handler from now-on for people that want to use gringotts + Vault.
If it was moved because of an API change then it's all the more reason why i wont be supporting it and they can commit to providing support themselves. if there was no functional reason why it was moved, then it should be moved back to be compatible.