booksaw / BetterTeams

Create teams to fight to be the best (Minecraft Plugin)
https://www.spigotmc.org/resources/better-teams.17129/
MIT License
63 stars 43 forks source link

Adds placeholders to get members at a specific rank #542

Closed EarthCow closed 5 months ago

EarthCow commented 5 months ago

Adds placeholders to get the member(s) at a specific rank. If there are multiple with the same rank then they are all returned separated by commas. Closes #537

EarthCow commented 5 months ago

I just realized #537 mentions a list for admins and members as well. I'll add those later.

booksaw commented 5 months ago

Thanks for all the pull requests, it is incredibly helpful. I will have a proper look hopefully tomorrow (and hopefully finally publish the update). One thing I noticed from a quick glance is that you could instead use. It would not have any performance difference as it does the same code in the backend, it just may be worth using the utility method in case for some reason something changes in the future.

 List<TeamPlayer> users = team.getRank(PlayerRank.OWNER);

As seen here: https://github.com/booksaw/BetterTeams/blob/7e507ffce087e64e01c4e03d5b6132e539aa0d26/src/main/java/com/booksaw/betterTeams/commands/team/InfoCommand.java#L86

EarthCow commented 5 months ago

Thanks and sorry as I did not see the method before, but I should have.