@Override
    protected @NonNull IntegerResult<WeightNode> supply() {
        IntegerResult<WeightNode> weight = null;

        for (WeightNode n : this.group.getOwnNodes(NodeType.WEIGHT, QueryOptionsImpl.DEFAULT_NON_CONTEXTUAL)) {
            int value = n.getWeight();
            if (weight == null || value > weight.intResult()) {
                weight = IntegerResult.of(n);
            }
        }

        if (weight == null) {
            Map<String, Integer> configWeights = this.group.getPlugin().getConfiguration().get(ConfigKeys.GROUP_WEIGHTS);
            Integer value = configWeights.get(this.group.getIdentifier().getName().toLowerCase(Locale.ROOT));
            if (value != null) {
                weight = IntegerResult.of(value);
            }
        }

        return weight != null ? weight : IntegerResult.nullResult();
    }
Cache instance to supply the weight of a {@link Group}.
common/src/main/java/me/lucko/luckperms/common/model/WeightCache.java