:shipit: SeriousVote 4.8.4 ―Your one stop Votifier Listener API 5/6/7

Sorry I’ve been a little occupied. I’m taking a look at the config currently. it seems there is a problem with automatically selecting a random number of rewards to give, I will be fixing that later today, for now change the number of rewards from -1 to any number greater than 0 that you would like.

Serious Vote 2.7
This release introduces a fix for the bug with the number of random rewards.
We introduced a work around for switching off of the async thread and running the commands from the main thread to prevent entity issues.

I’m using random vote but when the server say jornbink got {reward} I get to see what i need to get by the next vote, so it 1 in front of voting and not what i get on that vote so is that still a bug or what?

Are you using the random number of rewards?

I set also 2 as min and 3 as max and I only get 1 so I can try to set it back to 1 if that works then

try setting your min to 2 and max to 5.
Could you please also share your config with me. Thanks.

http://pastebin.com/2LT0xNuL this is on this moment the config, I will set the max to 5 now. and I’m using 2.7

Thanks, I think i found the issue and have now updated the code for choosing the number of random rewards (if it’s set to -1). I’m also fixing an issue I missed earlier with the text not updating if the random rewards chooses a 0.

 private int getRewardsNumber(ConfigurationNode node){
    int number = node.getNode("config", "random-rewards-number").getInt();
    if(number < 0 && hasLoot) {
        //Inclusive
        int nextInt;
        int min = node.getNode("config", "rewards-min").getInt();
        if (!(min < 1)) {
            min -= 1;
        }
        //Exclusive
        int max = node.getNode("config", "rewards-max").getInt() + 1;

        if (max > min){
            nextInt =  ThreadLocalRandom.current().nextInt(min,max);
        } else {
            nextInt = 0;
            getLogger().warn("There seems to be an error in your min/max setting in your configs.");
        }

        getLogger().info("Giving out " + nextInt + " random rewards.");
        return nextInt;
    } else if(number < 0){
        return 0;
    }

    return number;
}

Nice that you found the problem and you can solve it! But what do I need to do know? Or are you just going to update the plugin?

Try the settings I gave you and see if that works for you, if not I’ll be updating the plugin shortly.

And were do I need to place that?

What do you mean?

Try the settings I gave you and see if that works for you what do you mean? :smiley:

Change the max to 5, and see if that fixes your issue. If not you can just wait for the update

I changed it to 5 but then I get 4 rewards always

that’s very wierd, I’ll be pushing this update in a few minutes.

I’m looking forward to that and thank you so much!

Geen Problem. Always glad to help.

SeriousVote 2.8
Applied fix for problems with generating random rewards number, and occasional {rewards} showing up.

Now with the new version (2.8) I don’t get rewards at all this is my config on this moment: http://pastebin.com/GSFkd1u1