3.7 add prestige-based requirements

This commit is contained in:
okx-code
2020-04-13 14:24:31 +01:00
parent fe01ce1c4f
commit b7dfd5d9e3
92 changed files with 5908 additions and 5906 deletions
@@ -1,22 +1,22 @@
package sh.okx.rankup.prestige;
import org.bukkit.configuration.file.FileConfiguration;
import sh.okx.rankup.RankList;
import sh.okx.rankup.RankupPlugin;
public class Prestiges extends RankList<Prestige> {
public Prestiges(RankupPlugin plugin, FileConfiguration config) {
super(config, section -> Prestige.deserialize(plugin, section));
}
@Override
public Prestige getFirst() {
for (Prestige prestige : ranks) {
if (prestige.getRank() == null) {
return prestige;
}
}
throw new IllegalStateException("No prestige found for first prestige (first prestige is counted as a prestige without a rank set). " +
"Disable prestiges in config.yml if you don't want any.");
}
}
package sh.okx.rankup.prestige;
import org.bukkit.configuration.file.FileConfiguration;
import sh.okx.rankup.RankList;
import sh.okx.rankup.RankupPlugin;
public class Prestiges extends RankList<Prestige> {
public Prestiges(RankupPlugin plugin, FileConfiguration config) {
super(config, section -> Prestige.deserialize(plugin, section));
}
@Override
public Prestige getFirst() {
for (Prestige prestige : ranks) {
if (prestige.getRank() == null) {
return prestige;
}
}
throw new IllegalStateException("No prestige found for first prestige (first prestige is counted as a prestige without a rank set). " +
"Disable prestiges in config.yml if you don't want any.");
}
}