I am trying to solve this for a while, confusing myself more everytime. i have a custom inv with nothing in it, when the player interacts with an item i can open the gui. I am trying to go through all of the players permissions and only add items based on permissions the player has.
Code: ItemStack pvp = new ItemStack(Material.DIAMOND_SWORD); if (p.getInventory().getItemInMainHand().getType() == Material.BOOK) { if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (p.hasPermission("tkits.pvp")) { kitinv.setItem(0, pvp); } else { return; } p.openInventory(kitinv); return; } else { return; } } return; } } @timtower is there a faster way to go through all the perms? or would an else if statement fit this better
@TerroDoor hasPermission is as fast as it will get probably, with this you at least have a set order.