mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Modify custom items loading to permit registering of repairables from these configs.
Move loading of the main repairables to below the custom items so that repair.*.yml will over-write any custom items when the list is processed and repairables registered.
This commit is contained in:
@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.mods.CustomItem;
|
||||
import com.gmail.nossr50.skills.repair.Repairable;
|
||||
|
||||
public class CustomArmorConfig extends ModConfigLoader{
|
||||
private static CustomArmorConfig instance;
|
||||
@ -23,6 +24,8 @@ public class CustomArmorConfig extends ModConfigLoader{
|
||||
return instance;
|
||||
}
|
||||
|
||||
private List<Repairable> repairables;
|
||||
|
||||
public List<Integer> customBootIDs = new ArrayList<Integer>();
|
||||
public List<Integer> customChestplateIDs = new ArrayList<Integer>();
|
||||
public List<Integer> customHelmetIDs = new ArrayList<Integer>();
|
||||
@ -51,6 +54,7 @@ public class CustomArmorConfig extends ModConfigLoader{
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
plugin.getLogger().info("Loading mcMMO armor.yml File...");
|
||||
repairables = new ArrayList<Repairable>();
|
||||
|
||||
loadArmor("Boots", customBootIDs);
|
||||
loadArmor("Chestplates", customChestplateIDs);
|
||||
@ -99,4 +103,9 @@ public class CustomArmorConfig extends ModConfigLoader{
|
||||
customArmor.put(id, armor);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Repairable> getLoadedRepairables() {
|
||||
if(repairables == null) return new ArrayList<Repairable>();
|
||||
return repairables;
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.datatypes.mods.CustomTool;
|
||||
import com.gmail.nossr50.skills.repair.Repairable;
|
||||
|
||||
public class CustomToolsConfig extends ModConfigLoader {
|
||||
private static CustomToolsConfig instance;
|
||||
@ -23,6 +24,8 @@ public class CustomToolsConfig extends ModConfigLoader {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private List<Repairable> repairables;
|
||||
|
||||
public List<Integer> customAxeIDs = new ArrayList<Integer>();
|
||||
public List<Integer> customBowIDs = new ArrayList<Integer>();
|
||||
public List<Integer> customHoeIDs = new ArrayList<Integer>();
|
||||
@ -53,6 +56,7 @@ public class CustomToolsConfig extends ModConfigLoader {
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
plugin.getLogger().info("Loading mcMMO tools.yml File...");
|
||||
repairables = new ArrayList<Repairable>();
|
||||
|
||||
loadTool("Axes", customAxeIDs);
|
||||
loadTool("Bows", customBowIDs);
|
||||
@ -106,4 +110,9 @@ public class CustomToolsConfig extends ModConfigLoader {
|
||||
customTools.put(id, tool);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Repairable> getLoadedRepairables() {
|
||||
if(repairables == null) return new ArrayList<Repairable>();
|
||||
return repairables;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user