mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-01 20:15:28 +02:00
Second Smelt makes use of its own section in Bonus Drops in config.yml
Co-authored-by: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -18,16 +18,16 @@ import java.util.Map;
|
||||
public class PotionConfig extends ConfigLoader {
|
||||
private static PotionConfig instance;
|
||||
|
||||
private final List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierTwo = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierThree = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierFour = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierFive = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierSix = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierSeven = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierEight = new ArrayList<ItemStack>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierOne = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierTwo = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierThree = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierFour = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierFive = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierSix = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierSeven = new ArrayList<>();
|
||||
private final List<ItemStack> concoctionsIngredientsTierEight = new ArrayList<>();
|
||||
|
||||
private final Map<String, AlchemyPotion> potionMap = new HashMap<String, AlchemyPotion>();
|
||||
private final Map<String, AlchemyPotion> potionMap = new HashMap<>();
|
||||
|
||||
private PotionConfig() {
|
||||
super("potions.yml");
|
||||
@@ -137,14 +137,14 @@ public class PotionConfig extends ConfigLoader {
|
||||
material = Material.valueOf(mat);
|
||||
}
|
||||
|
||||
List<String> lore = new ArrayList<String>();
|
||||
List<String> lore = new ArrayList<>();
|
||||
if (potion_section.contains("Lore")) {
|
||||
for (String line : potion_section.getStringList("Lore")) {
|
||||
lore.add(ChatColor.translateAlternateColorCodes('&', line));
|
||||
}
|
||||
}
|
||||
|
||||
List<PotionEffect> effects = new ArrayList<PotionEffect>();
|
||||
List<PotionEffect> effects = new ArrayList<>();
|
||||
if (potion_section.contains("Effects")) {
|
||||
for (String effect : potion_section.getStringList("Effects")) {
|
||||
String[] parts = effect.split(" ");
|
||||
@@ -162,7 +162,7 @@ public class PotionConfig extends ConfigLoader {
|
||||
}
|
||||
}
|
||||
|
||||
Color color = null;
|
||||
Color color;
|
||||
if (potion_section.contains("Color")) {
|
||||
color = Color.fromRGB(potion_section.getInt("Color"));
|
||||
}
|
||||
@@ -170,7 +170,7 @@ public class PotionConfig extends ConfigLoader {
|
||||
color = this.generateColor(effects);
|
||||
}
|
||||
|
||||
Map<ItemStack, String> children = new HashMap<ItemStack, String>();
|
||||
Map<ItemStack, String> children = new HashMap<>();
|
||||
if (potion_section.contains("Children")) {
|
||||
for (String child : potion_section.getConfigurationSection("Children").getKeys(false)) {
|
||||
ItemStack ingredient = loadIngredient(child);
|
||||
@@ -255,7 +255,7 @@ public class PotionConfig extends ConfigLoader {
|
||||
|
||||
public Color generateColor(List<PotionEffect> effects) {
|
||||
if (effects != null && !effects.isEmpty()) {
|
||||
List<Color> colors = new ArrayList<Color>();
|
||||
List<Color> colors = new ArrayList<>();
|
||||
for (PotionEffect effect : effects) {
|
||||
if (effect.getType().getColor() != null) {
|
||||
colors.add(effect.getType().getColor());
|
||||
|
@@ -25,7 +25,7 @@ public class RepairConfig extends ConfigLoader {
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
repairables = new ArrayList<Repairable>();
|
||||
repairables = new ArrayList<>();
|
||||
|
||||
if (!config.isConfigurationSection("Repairables")) {
|
||||
mcMMO.p.getLogger().severe("Could not find Repairables section in " + fileName);
|
||||
@@ -42,7 +42,7 @@ public class RepairConfig extends ConfigLoader {
|
||||
}
|
||||
|
||||
// Validate all the things!
|
||||
List<String> reason = new ArrayList<String>();
|
||||
List<String> reason = new ArrayList<>();
|
||||
|
||||
// Item Material
|
||||
Material itemMaterial = Material.matchMaterial(key);
|
||||
@@ -177,7 +177,7 @@ public class RepairConfig extends ConfigLoader {
|
||||
}
|
||||
|
||||
protected List<Repairable> getLoadedRepairables() {
|
||||
return repairables == null ? new ArrayList<Repairable>() : repairables;
|
||||
return repairables == null ? new ArrayList<>() : repairables;
|
||||
}
|
||||
|
||||
private boolean noErrorsInRepairable(List<String> issues) {
|
||||
|
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class RepairConfigManager {
|
||||
private final List<Repairable> repairables = new ArrayList<Repairable>();
|
||||
private final List<Repairable> repairables = new ArrayList<>();
|
||||
|
||||
public RepairConfigManager(mcMMO plugin) {
|
||||
Pattern pattern = Pattern.compile("repair\\.(?:.+)\\.yml");
|
||||
|
@@ -28,7 +28,7 @@ public class SalvageConfig extends ConfigLoader {
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
salvageables = new ArrayList<Salvageable>();
|
||||
salvageables = new ArrayList<>();
|
||||
|
||||
if (!config.isConfigurationSection("Salvageables")) {
|
||||
mcMMO.p.getLogger().severe("Could not find Salvageables section in " + fileName);
|
||||
@@ -59,7 +59,7 @@ public class SalvageConfig extends ConfigLoader {
|
||||
|
||||
for (String key : keys) {
|
||||
// Validate all the things!
|
||||
List<String> reason = new ArrayList<String>();
|
||||
List<String> reason = new ArrayList<>();
|
||||
|
||||
// Item Material
|
||||
Material itemMaterial = Material.matchMaterial(key);
|
||||
@@ -195,7 +195,7 @@ public class SalvageConfig extends ConfigLoader {
|
||||
}
|
||||
|
||||
protected List<Salvageable> getLoadedSalvageables() {
|
||||
return salvageables == null ? new ArrayList<Salvageable>() : salvageables;
|
||||
return salvageables == null ? new ArrayList<>() : salvageables;
|
||||
}
|
||||
|
||||
private boolean noErrorsInSalvageable(List<String> issues) {
|
||||
|
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class SalvageConfigManager {
|
||||
private final List<Salvageable> salvageables = new ArrayList<Salvageable>();
|
||||
private final List<Salvageable> salvageables = new ArrayList<>();
|
||||
|
||||
public SalvageConfigManager(mcMMO plugin) {
|
||||
Pattern pattern = Pattern.compile("salvage\\.(?:.+)\\.yml");
|
||||
|
Reference in New Issue
Block a user