AppleDash / SaneEconomy

Finally, a sane economy plugin for Bukkit.
https://www.spigotmc.org/resources/saneeconomy-simple-but-featureful-economy.26223/
GNU General Public License v3.0
19 stars 24 forks source link

SaneEconomy 0.8.2 throwing exception with GameRanks #19

Closed foosratt closed 8 years ago

foosratt commented 8 years ago

We are using GameRanks with 0.7.1 SaneEconomy. I have updated to the latest SaneEconomy and now when a player tried to /rankup I am getting the following exception....

org.bukkit.command.CommandException: Unhandled exception executing command 'rankup' in plugin GameRanks v1.0.9 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:647) ~[spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1351) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1186) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_51] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_51] at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:732) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:668) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:567) [spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] at java.lang.Thread.run(Unknown Source) [?:1.8.0_51] Caused by: java.lang.IllegalArgumentException: Cannot transact a zero or negative amount! at org.appledash.saneeconomy.economy.transaction.Transaction.(Transaction.java:17) ~[?:?] at org.appledash.saneeconomy.vault.EconomySaneEconomy.withdrawPlayer(EconomySaneEconomy.java:159) ~[?:?] at io.voidpowered.gameranks.GRCommands.handleRankUpCommand(GRCommands.java:288) ~[?:?] at io.voidpowered.gameranks.GRCommands.onCommand(GRCommands.java:40) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.10.2.jar:git-Spigot-f9671b8-4d87c34] ... 15 more

Please note that the first rank up costs nothing and it looks like Sane Economy isn't able to handle this....

Caused by: java.lang.IllegalArgumentException: Cannot transact a zero or negative amount!

AppleDash commented 8 years ago

That seems to be the case - Technically this is a problem with GameRanks, but I will modify the plugin to be able to handle zero amounts. Expect a fix tonightish.

AppleDash commented 8 years ago

Since you seem competent enough to use Maven, can you please pull from git, build the latest version, and tell me if that works for you?

foosratt commented 8 years ago

We are no longer seeing exceptions being thrown. GameRanks still will not rank up with "You do not have enough funds" but I will look at the GameRanks source to see why this might be.