Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by TheBlackTeddy, May 12, 2016.
Are some of the values not added due to the same keys? I think compareTo is used which will return 0 if the integers have the same value.
There can only be one of each Key, you have four Keys that are 5, so each time it adds the 5 again it overrights the previous one.
You would have to use some other Key, you could use the player's name or UUID? but I'm not sure how you are getting them from the SQL so that might not work for you if the names just display "Removed name due privacy" when you get them.
Write a wrapper for Integer or use something else as a key^^
Edit: @worthless_hobo Now you sniped me :/
It doesn't matter the method you use to get them, just what it returns for the string.
When is it changed to "Removed name due privacy"?
Why not use something else that is not a map?
Then there is no need for a map. Just make an object and implement comparable so that it only takes into account the field with the number of boxes and put them in a list.
How about a list? Or use the string as a key if you want a map.
Just do what @MrBlobman says above, it is probably the easiest way to do this.