1 | package sh.okx.rankup.prestige; | |
2 | ||
3 | import java.util.ArrayList; | |
4 | import java.util.List; | |
5 | import java.util.Map; | |
6 | import org.bukkit.configuration.ConfigurationSection; | |
7 | import org.bukkit.configuration.file.FileConfiguration; | |
8 | import sh.okx.rankup.RankupPlugin; | |
9 | import sh.okx.rankup.ranks.RankElement; | |
10 | import sh.okx.rankup.ranks.RankList; | |
11 | ||
12 | public class Prestiges extends RankList<Prestige> { | |
13 | public Prestiges(RankupPlugin plugin, FileConfiguration config) { | |
14 | super(plugin, convert(plugin, config)); | |
15 | } | |
16 | ||
17 | private static List<Prestige> convert(RankupPlugin plugin, FileConfiguration config) { | |
18 | Map<String, Object> values = config.getValues(false); | |
19 | List<Prestige> prestiges = new ArrayList<>(values.size()); | |
20 | for (Map.Entry<String, Object> entry : values.entrySet()) { | |
21 | prestiges.add(Prestige.deserialize(plugin, (ConfigurationSection) entry.getValue())); | |
22 | } | |
23 |
1
1. convert : replaced return value with Collections.emptyList for sh/okx/rankup/prestige/Prestiges::convert → KILLED |
return prestiges; |
24 | } | |
25 | ||
26 | @Override | |
27 | protected void addLastRank(RankupPlugin plugin) { | |
28 | RankElement<Prestige> last = getTree().last(); | |
29 |
1
1. addLastRank : removed call to sh/okx/rankup/ranks/RankElement::setNext → SURVIVED |
last.setNext(new RankElement<>(new LastPrestige(plugin, last.getRank().getNext()), null)); |
30 | } | |
31 | ||
32 | } | |
Mutations | ||
23 |
1.1 |
|
29 |
1.1 |