Vault ignoring group inheritance in Pex

Discussion in 'Spigot Plugin Development' started by JeffLover, Jul 14, 2018 at 2:23 AM.

  1. The method playerInGroup() gets the player's base group leading all the way down to the last in the inheritance list getting the base group. For example if I had ta list that contains Default, Member, and VIP this for loop would always return the group Default, because the player is technically in the group default, even if their rank is VIP. This is because it inherits the group default and would stop then.
    Code (Java):
    for(String s : groupList) {
        if (VaultApi.getPermissions().playerInGroup(Player, s)){
            System.out.println("Group: " + s);
            return;
        }
    }
    EDIT: My thought, is to set the current group to a string and after the loop is done running, set the player to the group to last one run. This is all I can think of so please tell me if there is another way.
     
  2. Vault has a method that returns all groups of the player, String[] getPlayerGroups(Player/String, OfflinePlayer)

    Try messing around the rank numbers on pex, I think this method returns the array in an order where the highest rank (lowest ladder rank in pex) is first element.

    If that is not the case, pex uses deep-first search through the group tree.
     
    • Useful Useful x 1

Share This Page