|
@@ -1,6 +1,5 @@
|
|
package com.gmail.nossr50.config;
|
|
package com.gmail.nossr50.config;
|
|
|
|
|
|
-import java.util.Iterator;
|
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
@@ -206,22 +205,7 @@ public class Config extends ConfigLoader {
|
|
public boolean getPotatoDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Potato", true); }
|
|
public boolean getPotatoDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Herbalism.Potato", true); }
|
|
|
|
|
|
public boolean herbalismDoubleDropsDisabled() {
|
|
public boolean herbalismDoubleDropsDisabled() {
|
|
- ConfigurationSection section = config.getConfigurationSection("Double_Drops.Herbalism");
|
|
|
|
- Set<String> keys = section.getKeys(false);
|
|
|
|
- Iterator<String> iterator = keys.iterator();
|
|
|
|
-
|
|
|
|
- boolean disabled = true;
|
|
|
|
-
|
|
|
|
- while (iterator.hasNext()) {
|
|
|
|
- String key = iterator.next();
|
|
|
|
-
|
|
|
|
- if (config.getBoolean("Double_Drops.Herbalism." + key)) {
|
|
|
|
- disabled = false;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return disabled;
|
|
|
|
|
|
+ return doubleDropsDisabled("Herbalism");
|
|
}
|
|
}
|
|
|
|
|
|
/* Mining */
|
|
/* Mining */
|
|
@@ -256,22 +240,7 @@ public class Config extends ConfigLoader {
|
|
public boolean getEmeraldDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Emerald", true); }
|
|
public boolean getEmeraldDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Mining.Emerald", true); }
|
|
|
|
|
|
public boolean miningDoubleDropsDisabled() {
|
|
public boolean miningDoubleDropsDisabled() {
|
|
- ConfigurationSection section = config.getConfigurationSection("Double_Drops.Mining");
|
|
|
|
- Set<String> keys = section.getKeys(false);
|
|
|
|
- Iterator<String> iterator = keys.iterator();
|
|
|
|
-
|
|
|
|
- boolean disabled = true;
|
|
|
|
-
|
|
|
|
- while (iterator.hasNext()) {
|
|
|
|
- String key = iterator.next();
|
|
|
|
-
|
|
|
|
- if (config.getBoolean("Double_Drops.Mining." + key)) {
|
|
|
|
- disabled = false;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return disabled;
|
|
|
|
|
|
+ return doubleDropsDisabled("Mining");
|
|
}
|
|
}
|
|
|
|
|
|
public int getDetonatorItemID() { return config.getInt("Skills.Mining.Detonator_ID", 259); }
|
|
public int getDetonatorItemID() { return config.getInt("Skills.Mining.Detonator_ID", 259); }
|
|
@@ -303,22 +272,7 @@ public class Config extends ConfigLoader {
|
|
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
|
|
public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); }
|
|
|
|
|
|
public boolean woodcuttingDoubleDropsDisabled() {
|
|
public boolean woodcuttingDoubleDropsDisabled() {
|
|
- ConfigurationSection section = config.getConfigurationSection("Double_Drops.Woodcutting");
|
|
|
|
- Set<String> keys = section.getKeys(false);
|
|
|
|
- Iterator<String> iterator = keys.iterator();
|
|
|
|
-
|
|
|
|
- boolean disabled = true;
|
|
|
|
-
|
|
|
|
- while (iterator.hasNext()) {
|
|
|
|
- String key = iterator.next();
|
|
|
|
-
|
|
|
|
- if (config.getBoolean("Double_Drops.Woodcutting." + key)) {
|
|
|
|
- disabled = false;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return disabled;
|
|
|
|
|
|
+ return doubleDropsDisabled("Woodcutting");
|
|
}
|
|
}
|
|
|
|
|
|
/* AFK Leveling */
|
|
/* AFK Leveling */
|
|
@@ -466,4 +420,20 @@ public class Config extends ConfigLoader {
|
|
public double getFormulaMultiplierAxes() { return config.getDouble("Experience.Formula.Multiplier.Axes", 1.0); }
|
|
public double getFormulaMultiplierAxes() { return config.getDouble("Experience.Formula.Multiplier.Axes", 1.0); }
|
|
public double getFormulaMultiplierAcrobatics() { return config.getDouble("Experience.Formula.Multiplier.Acrobatics", 1.0); }
|
|
public double getFormulaMultiplierAcrobatics() { return config.getDouble("Experience.Formula.Multiplier.Acrobatics", 1.0); }
|
|
public double getFormulaMultiplierFishing() { return config.getDouble("Experience.Formula.Multiplier.Fishing", 1.0); }
|
|
public double getFormulaMultiplierFishing() { return config.getDouble("Experience.Formula.Multiplier.Fishing", 1.0); }
|
|
|
|
+
|
|
|
|
+ private boolean doubleDropsDisabled(String skillName) {
|
|
|
|
+ ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName);
|
|
|
|
+ Set<String> keys = section.getKeys(false);
|
|
|
|
+
|
|
|
|
+ boolean disabled = true;
|
|
|
|
+
|
|
|
|
+ for (String key : keys) {
|
|
|
|
+ if (config.getBoolean("Double_Drops." + skillName + "." + key)) {
|
|
|
|
+ disabled = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return disabled;
|
|
|
|
+ }
|
|
}
|
|
}
|