Search in sources :

Example 1 with StatRewardBuilder

use of com.archyx.aureliumskills.rewards.builder.StatRewardBuilder in project AureliumSkills by Archy-X.

the class StatRewardParser method parse.

@Override
public Reward parse(Map<?, ?> map) {
    StatRewardBuilder builder = new StatRewardBuilder(plugin);
    String statName = getString(map, "stat");
    Stat stat = plugin.getStatRegistry().getStat(statName);
    if (stat == null) {
        throw new IllegalArgumentException("Unknown stat with name: " + statName);
    }
    builder.stat(stat);
    builder.value(getDouble(map, "value"));
    return builder.build();
}
Also used : StatRewardBuilder(com.archyx.aureliumskills.rewards.builder.StatRewardBuilder) Stat(com.archyx.aureliumskills.stats.Stat)

Aggregations

StatRewardBuilder (com.archyx.aureliumskills.rewards.builder.StatRewardBuilder)1 Stat (com.archyx.aureliumskills.stats.Stat)1