3.7 add prestige-based requirements
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user