Discussion in 'Spigot Plugin Development' started by TheBlackTeddy, May 12, 2016.

    #1 TheBlackTeddy, May 12, 2016
    Last edited: Jan 27, 2021
    • Like Like x 1
  2. 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.
  3. 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.

    EDIT: Sniped :p
  4. 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.
  5. Write a wrapper for Integer or use something else as a key^^

    Edit: @worthless_hobo Now you sniped me :/
  6. 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"?
  7. Why not use something else that is not a map?
  8. 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.
  9. How about a list? Or use the string as a key if you want a map.
  10. Just do what @MrBlobman says above, it is probably the easiest way to do this.