Skip to content

Commit

Permalink
Removed blacklist.yml missing section message.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWoodworth committed May 9, 2016
1 parent db3f080 commit 5f75b10
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/main/java/co/kepler/fastcraftplus/config/BlacklistConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class BlacklistConfig extends ConfigExternal {
private static final String PERM_HASH = PERM + "hash.";
private static final String PERM_RESULT = PERM + "result.";
private static final String PERM_INGREDIENT = PERM + "ingredient.";
private static final String SECT_HASHES = "hashes";
private static final String SECT_RESULTS = "results";
private static final String SECT_INGREDIENTS = "ingredients";

private static final int HASH_RADIX = 24;
private static final int HASH_LENGTH = 7;
Expand Down Expand Up @@ -65,10 +68,8 @@ public void load() {
isBlacklist = !config.getBoolean("use-as-whitelist");

// Load hashes
ConfigurationSection hashSection = config.getConfigurationSection("hashes");
if (hashSection == null) {
FastCraft.err("Missing 'hashes' section in recipes.yml");
} else {
ConfigurationSection hashSection = config.getConfigurationSection(SECT_HASHES);
if (hashSection != null) {
for (String key : hashSection.getKeys(false)) {
try {
hashes.put(getHashInt(hashSection.getString(key)), PERM_HASH + key);
Expand All @@ -79,10 +80,8 @@ public void load() {
}

// Load results
ConfigurationSection resultSection = config.getConfigurationSection("results");
if (resultSection == null) {
FastCraft.err("Missing 'results' section in recipes.yml");
} else {
ConfigurationSection resultSection = config.getConfigurationSection(SECT_RESULTS);
if (resultSection != null) {
for (String key : resultSection.getKeys(false)) {
try {
results.put(new BlacklistItem(resultSection.getStringList(key)), PERM_RESULT + key);
Expand All @@ -93,10 +92,8 @@ public void load() {
}

// Load ingredients
ConfigurationSection ingredientSection = config.getConfigurationSection("ingredients");
if (ingredientSection == null) {
FastCraft.err("Missing 'ingredients' section in recipes.yml");
} else {
ConfigurationSection ingredientSection = config.getConfigurationSection(SECT_INGREDIENTS);
if (ingredientSection != null){
for (String key : ingredientSection.getKeys(false)) {
try {
ingredients.put(new BlacklistItem(ingredientSection.getStringList(key)), PERM_INGREDIENT + key);
Expand Down

0 comments on commit 5f75b10

Please sign in to comment.