Autorank

Autorank

380k Downloads

Regarding Stats: Votes

HorizontalJon opened this issue ยท 1 comments

commented

I am using Stats to collect Vote data as a requirement for ranking in AutoRank.

It works fine, but if the player has not voted before no 'stat' for votes is set for the player so it throws up an error on /ar check and /ar complete. I can 'fix' it by manually setting a player's vote count to 0 (so they have a record), but this is far from a perfect fix.

So I'm wondering if there's anything you can do to fix this, or is this more of a problem on the side of the Stats plugin itself and I need to ask them?

[13:13:53 INFO]: HorizontalJon issued server command: /ar check

org.bukkit.command.CommandException: Unhandled exception executing command 'ar'
in plugin Autorank v3.7.3
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spi
got-1.9.jar:git-Spigot-d20369f-7fc5cd8]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:14

  1. ~[spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at org.bukkit.craftbukkit.v1_9_R1.CraftServer.dispatchCommand(CraftServe
    r.java:645) ~[spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.PlayerConnection.handleCommand(PlayerCon
    nection.java:1350) [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java
    :1185) [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java
    :45) [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.PacketPlayInChat.a(PacketPlayInChat.java
    :1) [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:1
  2. [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
    ?:1.8.0_73]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_73]
    at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [spigot-1.9
    .jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:7
  3. [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:4
  4. [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:6
  5. [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java
    :559) [spigot-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_73]
    Caused by: java.lang.NullPointerException
    at me.armar.plugins.autorank.hooks.statsapi.StatsAPIHandler.getNormalSta
    t(StatsAPIHandler.java:165) ~[?:?]
    at me.armar.plugins.autorank.statsmanager.handlers.StatsHandler.getNorma
    lStat(StatsHandler.java:62) ~[?:?]
    at me.armar.plugins.autorank.playerchecker.requirement.TotalVotesRequire
    ment.meetsRequirement(TotalVotesRequirement.java:41) ~[?:?]
    at me.armar.plugins.autorank.rankbuilder.holders.RequirementsHolder.meet
    sRequirement(RequirementsHolder.java:76) ~[?:?]
    at me.armar.plugins.autorank.commands.CheckCommand.check(CheckCommand.ja
    va:141) ~[?:?]
    at me.armar.plugins.autorank.commands.CheckCommand.onCommand(CheckComman
    d.java:294) ~[?:?]
    at me.armar.plugins.autorank.commands.manager.CommandsManager.onCommand(
    CommandsManager.java:159) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spi
    got-1.9.jar:git-Spigot-d20369f-7fc5cd8]
    ... 15 more
commented

I was able to find a 'fix' of sorts. If you set the first rank to not require a vote but something else (I used an economy requirement) you can set the the rewards command to include a stat set for votes to 0.