Changed format of repair.vanilla.yml. **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT**

This commit is contained in:
GJ 2013-09-19 11:02:47 -04:00
parent 59a35b170c
commit 5d7d779a49
13 changed files with 254 additions and 434 deletions

View File

@ -36,6 +36,7 @@ Version 1.4.07-dev
= Fixed a bug where the "Dodge" DamageModifier wasn't being read from advanced.yml = Fixed a bug where the "Dodge" DamageModifier wasn't being read from advanced.yml
= Fixed a bug where squid were not awarding XP. = Fixed a bug where squid were not awarding XP.
! Changed format of treasures.yml. **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT** ! Changed format of treasures.yml. **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT**
! Changed format of repair.vanilla.yml. **YOU WILL NEED TO UPDATE YOUR FILE TO THE NEW FORMAT**
! Witches no longer drop water bottles from Shake, since they no longer drop them in Vanilla. ! Witches no longer drop water bottles from Shake, since they no longer drop them in Vanilla.
! Changed various values to double in advanced.yml for the sake of consistency. ! Changed various values to double in advanced.yml for the sake of consistency.
! Nerfed Archery damage to eliminate constant one-hit kills. ! Nerfed Archery damage to eliminate constant one-hit kills.

View File

@ -41,10 +41,10 @@ public class RepairCommand extends SkillCommand {
@Override @Override
protected void dataCalculations() { protected void dataCalculations() {
// We're using pickaxes here, not the best but it works // We're using pickaxes here, not the best but it works
Repairable diamondRepairable = mcMMO.getRepairableManager().getRepairable(Material.DIAMOND_PICKAXE.getId()); Repairable diamondRepairable = mcMMO.getRepairableManager().getRepairable(Material.DIAMOND_PICKAXE);
Repairable goldRepairable = mcMMO.getRepairableManager().getRepairable(Material.GOLD_PICKAXE.getId()); Repairable goldRepairable = mcMMO.getRepairableManager().getRepairable(Material.GOLD_PICKAXE);
Repairable ironRepairable = mcMMO.getRepairableManager().getRepairable(Material.IRON_PICKAXE.getId()); Repairable ironRepairable = mcMMO.getRepairableManager().getRepairable(Material.IRON_PICKAXE);
Repairable stoneRepairable = mcMMO.getRepairableManager().getRepairable(Material.STONE_PICKAXE.getId()); Repairable stoneRepairable = mcMMO.getRepairableManager().getRepairable(Material.STONE_PICKAXE);
// TODO: This isn't really accurate - if they don't have pickaxes loaded it doesn't always mean the repair level is 0 // TODO: This isn't really accurate - if they don't have pickaxes loaded it doesn't always mean the repair level is 0
diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel(); diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel();

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.config.ConfigLoader;
@ -87,7 +88,7 @@ public class CustomArmorConfig extends ConfigLoader {
CustomItem armor; CustomItem armor;
if (repairable) { if (repairable) {
repairables.add(RepairableFactory.getRepairable(id, repairID, repairData, repairQuantity, durability)); repairables.add(RepairableFactory.getRepairable(Material.getMaterial(id), Material.getMaterial(repairID), repairData, repairQuantity, durability));
} }
armor = new CustomItem(id, durability); armor = new CustomItem(id, durability);

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.config.ConfigLoader;
@ -93,7 +94,7 @@ public class CustomToolConfig extends ConfigLoader {
CustomTool tool; CustomTool tool;
if (repairable) { if (repairable) {
repairables.add(RepairableFactory.getRepairable(id, repairID, repairData, repairQuantity, durability)); repairables.add(RepairableFactory.getRepairable(Material.getMaterial(id), Material.getMaterial(repairID), repairData, repairQuantity, durability));
} }
tool = new CustomTool(tier, abilityEnabled, multiplier, durability, id); tool = new CustomTool(tier, abilityEnabled, multiplier, durability, id);

View File

@ -52,9 +52,7 @@ public class RepairManager extends SkillManager {
public void handleRepair(ItemStack item) { public void handleRepair(ItemStack item) {
Player player = getPlayer(); Player player = getPlayer();
int itemId = item.getTypeId(); Repairable repairable = mcMMO.getRepairableManager().getRepairable(item.getType());
Repairable repairable = mcMMO.getRepairableManager().getRepairable(itemId);
// Permissions checks on material and item types // Permissions checks on material and item types
if (!repairable.getRepairItemType().getPermissions(player)) { if (!repairable.getRepairItemType().getPermissions(player)) {
@ -78,13 +76,13 @@ public class RepairManager extends SkillManager {
PlayerInventory inventory = player.getInventory(); PlayerInventory inventory = player.getInventory();
int repairMaterialId = repairable.getRepairMaterialId(); Material repairMaterial = repairable.getRepairMaterial();
byte repairMaterialMetadata = repairable.getRepairMaterialMetadata(); byte repairMaterialMetadata = repairable.getRepairMaterialMetadata();
ItemStack toRemove = new MaterialData(repairMaterialId, repairMaterialMetadata).toItemStack(1); ItemStack toRemove = new MaterialData(repairMaterial, repairMaterialMetadata).toItemStack(1);
// Check if they have the proper material to repair with // Check if they have the proper material to repair with
if (!inventory.contains(Material.getMaterial(repairMaterialId))) { if (!inventory.contains(repairMaterial)) {
String message = LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(repairMaterialId)); String message = LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(repairMaterial));
if (repairMaterialMetadata != (byte) -1 && !inventory.containsAtLeast(toRemove, 1)) { if (repairMaterialMetadata != (byte) -1 && !inventory.containsAtLeast(toRemove, 1)) {
message += ":" + repairMaterialMetadata; message += ":" + repairMaterialMetadata;
@ -131,7 +129,7 @@ public class RepairManager extends SkillManager {
// Remove the item // Remove the item
if (repairMaterialMetadata == -1) { if (repairMaterialMetadata == -1) {
toRemove = inventory.getItem(inventory.first(Material.getMaterial(repairMaterialId))).clone(); toRemove = inventory.getItem(inventory.first(repairMaterial)).clone();
toRemove.setAmount(1); toRemove.setAmount(1);
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.skills.repair; package com.gmail.nossr50.skills.repair;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@ -50,4 +51,33 @@ public enum RepairMaterialType {
return false; return false;
} }
} }
public Material getDefaultRepairMaterial() {
switch (this) {
case STRING:
return Material.STRING;
case LEATHER:
return Material.LEATHER;
case WOOD:
return Material.WOOD;
case STONE:
return Material.COBBLESTONE;
case IRON:
return Material.IRON_INGOT;
case GOLD:
return Material.GOLD_INGOT;
case DIAMOND:
return Material.DIAMOND;
case OTHER:
default:
return null;
}
}
} }

View File

@ -1,19 +1,21 @@
package com.gmail.nossr50.skills.repair; package com.gmail.nossr50.skills.repair;
import org.bukkit.Material;
public interface Repairable { public interface Repairable {
/** /**
* Gets the item id of this repairable item * Gets the type of this repairable item
* *
* @return the id of this repairable * @return the type of this repairable
*/ */
public int getItemId(); public Material getItemMaterial();
/** /**
* Gets the id of the material used to repair this item * Gets the id of the material used to repair this item
* *
* @return the id of the repair material * @return the id of the repair material
*/ */
public int getRepairMaterialId(); public Material getRepairMaterial();
/** /**
* Gets the metadata byte value of the material used to repair this item * Gets the metadata byte value of the material used to repair this item

View File

@ -1,12 +1,14 @@
package com.gmail.nossr50.skills.repair; package com.gmail.nossr50.skills.repair;
import org.bukkit.Material;
public class RepairableFactory { public class RepairableFactory {
public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumQuantity, short maximumDurability) { public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumQuantity, short maximumDurability) {
return getRepairable(itemId, repairMaterialId, repairMetadata, 0, minimumQuantity, maximumDurability, RepairItemType.OTHER, RepairMaterialType.OTHER, 1); return getRepairable(itemMaterial, repairMaterial, repairMetadata, 0, minimumQuantity, maximumDurability, RepairItemType.OTHER, RepairMaterialType.OTHER, 1);
} }
public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) { public static Repairable getRepairable(Material itemMaterial, Material repairMaterial, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) {
// TODO: Add in loading from config what type of repairable we want. // TODO: Add in loading from config what type of repairable we want.
return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier); return new SimpleRepairable(itemMaterial, repairMaterial, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier);
} }
} }

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.skills.repair;
import java.util.List; import java.util.List;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public interface RepairableManager { public interface RepairableManager {
@ -22,10 +23,10 @@ public interface RepairableManager {
/** /**
* Checks if an item is repairable * Checks if an item is repairable
* *
* @param itemId id to check if repairable * @param type Material to check if repairable
* @return true if repairable, false if not * @return true if repairable, false if not
*/ */
public boolean isRepairable(int itemId); public boolean isRepairable(Material type);
/** /**
* Checks if an item is repairable * Checks if an item is repairable
@ -36,10 +37,10 @@ public interface RepairableManager {
public boolean isRepairable(ItemStack itemStack); public boolean isRepairable(ItemStack itemStack);
/** /**
* Gets the repairable with this id * Gets the repairable with this type
* *
* @param id Id of the repairable to look for * @param type Material of the repairable to look for
* @return the repairable, can be null * @return the repairable, can be null
*/ */
public Repairable getRepairable(int id); public Repairable getRepairable(Material type);
} }

View File

@ -1,16 +1,19 @@
package com.gmail.nossr50.skills.repair; package com.gmail.nossr50.skills.repair;
import org.bukkit.Material;
public class SimpleRepairable implements Repairable { public class SimpleRepairable implements Repairable {
private final int itemId, repairMaterialId, minimumQuantity, minimumLevel; private final Material itemMaterial, repairMaterial;
private final int minimumQuantity, minimumLevel;
private final short maximumDurability, baseRepairDurability; private final short maximumDurability, baseRepairDurability;
private final byte repairMetadata; private final byte repairMetadata;
private final RepairItemType repairItemType; private final RepairItemType repairItemType;
private final RepairMaterialType repairMaterialType; private final RepairMaterialType repairMaterialType;
private final double xpMultiplier; private final double xpMultiplier;
protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) { protected SimpleRepairable(Material type, Material repairMaterial, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) {
this.itemId = itemId; this.itemMaterial = type;
this.repairMaterialId = repairMaterialId; this.repairMaterial = repairMaterial;
this.repairMetadata = repairMetadata; this.repairMetadata = repairMetadata;
this.repairItemType = repairItemType; this.repairItemType = repairItemType;
this.repairMaterialType = repairMaterialType; this.repairMaterialType = repairMaterialType;
@ -22,13 +25,13 @@ public class SimpleRepairable implements Repairable {
} }
@Override @Override
public int getItemId() { public Material getItemMaterial() {
return itemId; return itemMaterial;
} }
@Override @Override
public int getRepairMaterialId() { public Material getRepairMaterial() {
return repairMaterialId; return repairMaterial;
} }
@Override @Override

View File

@ -3,23 +3,24 @@ package com.gmail.nossr50.skills.repair;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public class SimpleRepairableManager implements RepairableManager { public class SimpleRepairableManager implements RepairableManager {
private HashMap<Integer, Repairable> repairables; private HashMap<Material, Repairable> repairables;
protected SimpleRepairableManager() { protected SimpleRepairableManager() {
this(55); this(55);
} }
protected SimpleRepairableManager(int repairablesSize) { protected SimpleRepairableManager(int repairablesSize) {
this.repairables = new HashMap<Integer, Repairable>(repairablesSize); this.repairables = new HashMap<Material, Repairable>(repairablesSize);
} }
@Override @Override
public void registerRepairable(Repairable repairable) { public void registerRepairable(Repairable repairable) {
Integer itemId = repairable.getItemId(); Material item = repairable.getItemMaterial();
repairables.put(itemId, repairable); repairables.put(item, repairable);
} }
@Override @Override
@ -30,17 +31,17 @@ public class SimpleRepairableManager implements RepairableManager {
} }
@Override @Override
public boolean isRepairable(int itemId) { public boolean isRepairable(Material type) {
return repairables.containsKey(itemId); return repairables.containsKey(type);
} }
@Override @Override
public boolean isRepairable(ItemStack itemStack) { public boolean isRepairable(ItemStack itemStack) {
return isRepairable(itemStack.getTypeId()); return isRepairable(itemStack.getType());
} }
@Override @Override
public Repairable getRepairable(int id) { public Repairable getRepairable(Material type) {
return repairables.get(id); return repairables.get(type);
} }
} }

View File

@ -4,13 +4,21 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.ConfigLoader; import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.skills.repair.RepairItemType; import com.gmail.nossr50.skills.repair.RepairItemType;
import com.gmail.nossr50.skills.repair.RepairMaterialType; import com.gmail.nossr50.skills.repair.RepairMaterialType;
import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.skills.repair.Repairable;
import com.gmail.nossr50.skills.repair.RepairableFactory; import com.gmail.nossr50.skills.repair.RepairableFactory;
import com.gmail.nossr50.util.ItemUtils;
public class RepairConfig extends ConfigLoader { public class RepairConfig extends ConfigLoader {
private List<Repairable> repairables; private List<Repairable> repairables;
@ -28,60 +36,142 @@ public class RepairConfig extends ConfigLoader {
Set<String> keys = section.getKeys(false); Set<String> keys = section.getKeys(false);
for (String key : keys) { for (String key : keys) {
if (config.contains("Repairables." + key + ".ItemId")) {
plugin.getLogger().warning("You are using an old version of the repair.yml file.");
plugin.getLogger().warning("You should delete your current file and allow a new one to generate.");
plugin.getLogger().warning("Repair will not work properly until you do.");
return;
}
// Validate all the things! // Validate all the things!
List<String> reason = new ArrayList<String>(); List<String> reason = new ArrayList<String>();
if (!config.contains("Repairables." + key + ".ItemId")) { // Item Material
reason.add(key + " is missing ItemId"); Material itemMaterial = Material.matchMaterial(key);
if (itemMaterial == null) {
reason.add("Invalid material: " + key);
} }
if (!config.contains("Repairables." + key + ".RepairMaterialId")) { // Repair Material Type
reason.add(key + " is missing RepairMaterialId");
}
if (!config.contains("Repairables." + key + ".MaximumDurability")) {
reason.add(key + " is missing MaximumDurability");
}
int itemId = config.getInt("Repairables." + key + ".ItemId", 0);
int repairMaterialId = config.getInt("Repairables." + key + ".RepairMaterialId", 0);
int maximumDurability = config.getInt("Repairables." + key + ".MaximumDurability", 0);
int repairMetadata = config.getInt("Repairables." + key + ".RepairMaterialMetadata", -1);
int minimumLevel = config.getInt("Repairables." + key + ".MinimumLevel", 0);
int minimumQuantity = config.getInt("Repairables." + key + ".MinimumQuantity", 2);
double xpMultiplier = config.getDouble("Repairables." + key + ".XpMultiplier", 1);
RepairItemType repairItemType = RepairItemType.OTHER;
RepairMaterialType repairMaterialType = RepairMaterialType.OTHER; RepairMaterialType repairMaterialType = RepairMaterialType.OTHER;
String repairItemTypeString = config.getString("Repairables." + key + ".ItemType", "OTHER");
String repairMaterialTypeString = config.getString("Repairables." + key + ".MaterialType", "OTHER"); String repairMaterialTypeString = config.getString("Repairables." + key + ".MaterialType", "OTHER");
if (minimumLevel < 0) { if (!config.contains("Repairables." + key + ".MaterialType") && itemMaterial != null) {
reason.add(key + " has an invalid MinimumLevel of " + minimumLevel); ItemStack repairItem = new ItemStack(itemMaterial);
}
if (minimumQuantity < 0) { if (ItemUtils.isWoodTool(repairItem)) {
reason.add(key + " has an invalid MinimumQuantity of " + minimumQuantity); repairMaterialType = RepairMaterialType.WOOD;
} }
else if (ItemUtils.isStoneTool(repairItem)) {
try { repairMaterialType = RepairMaterialType.STONE;
repairItemType = RepairItemType.valueOf(repairItemTypeString);
} }
catch (IllegalArgumentException ex) { else if (ItemUtils.isStringTool(repairItem)) {
reason.add(key + " has an invalid ItemType of " + repairItemTypeString); repairMaterialType = RepairMaterialType.STRING;
} }
else if (ItemUtils.isLeatherArmor(repairItem)) {
repairMaterialType = RepairMaterialType.LEATHER;
}
else if (ItemUtils.isIronArmor(repairItem) || ItemUtils.isIronTool(repairItem)) {
repairMaterialType = RepairMaterialType.IRON;
}
else if (ItemUtils.isGoldArmor(repairItem) || ItemUtils.isGoldTool(repairItem)) {
repairMaterialType = RepairMaterialType.GOLD;
}
else if (ItemUtils.isDiamondArmor(repairItem) || ItemUtils.isDiamondTool(repairItem)) {
repairMaterialType = RepairMaterialType.DIAMOND;
}
}
else {
try { try {
repairMaterialType = RepairMaterialType.valueOf(repairMaterialTypeString); repairMaterialType = RepairMaterialType.valueOf(repairMaterialTypeString);
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid MaterialType of " + repairMaterialTypeString); reason.add(key + " has an invalid MaterialType of " + repairMaterialTypeString);
} }
}
// Repair Material
String repairMaterialName = config.getString("Repairables." + key + ".RepairMaterial");
Material repairMaterial = (repairMaterialName == null ? repairMaterialType.getDefaultRepairMaterial() : Material.matchMaterial(repairMaterialName));
if (repairMaterial == null) {
reason.add(key + " has an invalid repair material: " + repairMaterialName);
}
// Maximum Durability
short maximumDurability = (config.contains("Repairables." + key + ".MaximumDurability") ? (short) config.getInt("Repairables." + key + ".MaximumDurability") : (itemMaterial != null ? itemMaterial.getMaxDurability() : 0));
if (maximumDurability <= 0) {
reason.add("Maxium durability of " + key + " must be greater than 0!");
}
// Item Type
RepairItemType repairItemType = RepairItemType.OTHER;
String repairItemTypeString = config.getString("Repairables." + key + ".ItemType", "OTHER");
if (!config.contains("Repairables." + key + ".ItemType") && itemMaterial != null) {
ItemStack repairItem = new ItemStack(itemMaterial);
if (ItemUtils.isMinecraftTool(repairItem)) {
repairItemType = RepairItemType.TOOL;
}
else if (ItemUtils.isArmor(repairItem)) {
repairItemType = RepairItemType.ARMOR;
}
}
else {
try {
repairItemType = RepairItemType.valueOf(repairItemTypeString);
}
catch (IllegalArgumentException ex) {
reason.add(key + " has an invalid ItemType of " + repairItemTypeString);
}
}
int repairMetadata = config.getInt("Repairables." + key + ".RepairMaterialMetadata", -1);
int minimumLevel = config.getInt("Repairables." + key + ".MinimumLevel");
double xpMultiplier = config.getDouble("Repairables." + key + ".XpMultiplier", 1);
if (minimumLevel < 0) {
reason.add(key + " has an invalid MinimumLevel of " + minimumLevel);
}
// Minimum Quantity
int minimumQuantity = 0;
if (config.contains("Repairables." + key + ".MinimumQuantity")) {
minimumQuantity = config.getInt("Repairables." + key + ".MinimumQuantity");
}
else if (itemMaterial != null) {
ItemStack item = new ItemStack(itemMaterial);
MaterialData repairData = new MaterialData(repairMaterial, (byte) repairMetadata);
Recipe recipe = mcMMO.p.getServer().getRecipesFor(item).get(0);
if (recipe instanceof ShapelessRecipe) {
for (ItemStack ingredient : ((ShapelessRecipe) recipe).getIngredientList()) {
if (ingredient != null && ingredient.getType() == repairMaterial && (repairMetadata == -1 || ingredient.getData() == repairData)) {
minimumQuantity += ingredient.getAmount();
}
}
}
else if (recipe instanceof ShapedRecipe) {
for (ItemStack ingredient : ((ShapedRecipe) recipe).getIngredientMap().values()) {
if (ingredient != null && ingredient.getType() == repairMaterial && (repairMetadata == -1 || ingredient.getData() == repairData)) {
minimumQuantity += ingredient.getAmount();
}
}
}
}
System.out.println("Minimum quantity of " + key + ": " + minimumQuantity);
if (minimumQuantity <= 0) {
reason.add("Minimum quantity of " + key + " must be greater than 0!");
}
if (noErrorsInRepairable(reason)) { if (noErrorsInRepairable(reason)) {
Repairable repairable = RepairableFactory.getRepairable(itemId, repairMaterialId, (byte) repairMetadata, minimumLevel, minimumQuantity, (short) maximumDurability, repairItemType, repairMaterialType, xpMultiplier); Repairable repairable = RepairableFactory.getRepairable(itemMaterial, repairMaterial, (byte) repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier);
repairables.add(repairable); repairables.add(repairable);
} }
} }

View File

@ -1,11 +1,9 @@
## Last updated on ${project.version}-b${BUILD_NUMBER}
# #
# Any file named repair.*.yml in the mcmmmo folder will be loaded as a repair config # Any file named repair.*.yml in the mcmmmo folder will be loaded as a repair config
# All repair configs have a main section titled "Repairables" # All repair configs have a main section titled "Repairables"
# Afterwards, all sub-items are considered a Repairable to be loaded # Afterwards, all sub-items are considered a Repairable to be loaded. The names of each subitem should be the exact material name.
# The bare minimum of a Repairable is that it have an ItemId, a RepairMaterialId, and a MaximumDurability # The bare minimum of a Repairable is that it have a RepairMaterial and a MaximumDurability
#
# ItemId: This is the id of the item to be repairable.
## This is required to be set.
# #
# ItemType: This is the type of item to be repaired, this is only important to permissions. # ItemType: This is the type of item to be repaired, this is only important to permissions.
## Valid values are ARMOR, TOOL, and OTHER. ## Valid values are ARMOR, TOOL, and OTHER.
@ -15,7 +13,7 @@
## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, and OTHER ## Valid values are STRING, LEATHER, WOOD, STONE, IRON, GOLD, DIAMOND, and OTHER
## This defaults to OTHER. ## This defaults to OTHER.
# #
# RepairMaterialId: This is the id of the item used to repair this repairable. # RepairMaterial: This is the material name of the item used to repair this repairable.
## This is required to be set. ## This is required to be set.
# #
# RepairMaterialMetadata: This is the metadata of the item used to repair this repairable. # RepairMaterialMetadata: This is the metadata of the item used to repair this repairable.
@ -26,7 +24,7 @@
## This is required to be set. ## This is required to be set.
# #
# MinimumLevel: This is the minimum repair level needed to repair this item. # MinimumLevel: This is the minimum repair level needed to repair this item.
## Valid values are > 0 ## Valid values are => 0
## This defaults to 0 ## This defaults to 0
# #
# MinimumQuantity: This is the minimum number of items needed to repair this item ignoring all other repair bonuses. # MinimumQuantity: This is the minimum number of items needed to repair this item ignoring all other repair bonuses.
@ -46,470 +44,162 @@ Repairables:
# Wooden repairables # Wooden repairables
### ###
# Tools # Tools
WoodSword: WOOD_SWORD:
ItemId: 268
ItemType: TOOL
MaterialType: WOOD
RepairMaterialId: 5
RepairMaterialMetadata: -1
MaximumDurability: 59
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .25 XpMultiplier: .25
WoodShovel: WOOD_SPADE:
ItemId: 269
ItemType: TOOL
MaterialType: WOOD
RepairMaterialId: 5
RepairMaterialMetadata: -1
MaximumDurability: 59
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 1
XpMultiplier: .16 XpMultiplier: .16
WoodPickaxe: WOOD_PICKAXE:
ItemId: 270
ItemType: TOOL
MaterialType: WOOD
RepairMaterialId: 5
RepairMaterialMetadata: -1
MaximumDurability: 59
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: .5 XpMultiplier: .5
WoodAxe: WOOD_AXE:
ItemId: 271
ItemType: TOOL
MaterialType: WOOD
RepairMaterialId: 5
RepairMaterialMetadata: -1
MaximumDurability: 59
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: .5 XpMultiplier: .5
WoodHoe: WOOD_HOE:
ItemId: 290
ItemType: TOOL
MaterialType: WOOD
RepairMaterialId: 5
RepairMaterialMetadata: -1
MaximumDurability: 59
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .25 XpMultiplier: .25
# #
# Stone repairables # Stone repairables
### ###
# Tools # Tools
StoneSword: STONE_SWORD:
ItemId: 272
ItemType: TOOL
MaterialType: STONE
RepairMaterialId: 4
RepairMaterialMetadata: -1
MaximumDurability: 131
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .25 XpMultiplier: .25
StoneShovel: STONE_SPADE:
ItemId: 273
ItemType: TOOL
MaterialType: STONE
RepairMaterialId: 4
RepairMaterialMetadata: -1
MaximumDurability: 131
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 1
XpMultiplier: .16 XpMultiplier: .16
StonePickaxe: STONE_PICKAXE:
ItemId: 274
ItemType: TOOL
MaterialType: STONE
RepairMaterialId: 4
RepairMaterialMetadata: -1
MaximumDurability: 131
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: .5 XpMultiplier: .5
StoneAxe: STONE_AXE:
ItemId: 275
ItemType: TOOL
MaterialType: STONE
RepairMaterialId: 4
RepairMaterialMetadata: -1
MaximumDurability: 131
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: .5 XpMultiplier: .5
StoneHoe: STONE_HOE:
ItemId: 291
ItemType: TOOL
MaterialType: STONE
RepairMaterialId: 4
RepairMaterialMetadata: -1
MaximumDurability: 131
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .25 XpMultiplier: .25
# #
# Iron repairables # Iron repairables
### ###
# Tools # Tools
IronSword: IRON_SWORD:
ItemId: 267
ItemType: TOOL
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 250
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .5 XpMultiplier: .5
IronShovel: IRON_SPADE:
ItemId: 256
ItemType: TOOL
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 250
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 1
XpMultiplier: .3 XpMultiplier: .3
IronPickaxe: IRON_PICKAXE:
ItemId: 257
ItemType: TOOL
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 250
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: 1 XpMultiplier: 1
IronAxe: IRON_AXE:
ItemId: 258
ItemType: TOOL
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 250
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: 1 XpMultiplier: 1
IronHoe: IRON_HOE:
ItemId: 292
ItemType: TOOL
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 250
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .5 XpMultiplier: .5
Shears: SHEARS:
ItemId: 359
ItemType: TOOL
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 238
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: 1 XpMultiplier: 1
# Armor # Armor
IronHelmet: IRON_HELMET:
ItemId: 306
ItemType: ARMOR
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 165
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 5
XpMultiplier: 2 XpMultiplier: 2
IronChest: IRON_CHESTPLATE:
ItemId: 307
ItemType: ARMOR
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 240
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 8
XpMultiplier: 2 XpMultiplier: 2
IronLegs: IRON_LEGGINGS:
ItemId: 308
ItemType: ARMOR
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 225
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 7
XpMultiplier: 2 XpMultiplier: 2
IronBoots: IRON_BOOTS:
ItemId: 309
ItemType: ARMOR
MaterialType: IRON
RepairMaterialId: 265
RepairMaterialMetadata: -1
MaximumDurability: 195
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 4
XpMultiplier: 2 XpMultiplier: 2
# #
# Gold repairables # Gold repairables
### ###
# Tools # Tools
GoldSword: GOLD_SWORD:
ItemId: 283
ItemType: TOOL
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 32
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: 4 XpMultiplier: 4
GoldShovel: GOLD_SPADE:
ItemId: 284
ItemType: TOOL
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 32
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 1
XpMultiplier: 2.6 XpMultiplier: 2.6
GoldPickaxe: GOLD_PICKAXE:
ItemId: 285
ItemType: TOOL
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 32
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: 8 XpMultiplier: 8
GoldAxe: GOLD_AXE:
ItemId: 286
ItemType: TOOL
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 32
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: 8 XpMultiplier: 8
GoldHoe: GOLD_HOE:
ItemId: 294
ItemType: TOOL
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 32
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: 4 XpMultiplier: 4
# Armor # Armor
GoldHelmet: GOLD_HELMET:
ItemId: 314
ItemType: ARMOR
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 77
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 5
XpMultiplier: 4 XpMultiplier: 4
GoldChest: GOLD_CHESTPLATE:
ItemId: 315
ItemType: ARMOR
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 112
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 8
XpMultiplier: 4 XpMultiplier: 4
GoldLegs: GOLD_LEGGINGS:
ItemId: 316
ItemType: ARMOR
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 105
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 7
XpMultiplier: 4 XpMultiplier: 4
GoldBoots: GOLD_BOOTS:
ItemId: 317
ItemType: ARMOR
MaterialType: GOLD
RepairMaterialId: 266
RepairMaterialMetadata: -1
MaximumDurability: 91
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 4
XpMultiplier: 4 XpMultiplier: 4
# #
# Diamond repairables # Diamond repairables
### ###
# Tools # Tools
DiamondSword: DIAMOND_SWORD:
ItemId: 276
ItemType: TOOL
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 1561
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 2
XpMultiplier: .5 XpMultiplier: .5
DiamondShovel: DIAMOND_SPADE:
ItemId: 277
ItemType: TOOL
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 1561
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 1
XpMultiplier: .3 XpMultiplier: .3
DiamondPickaxe: DIAMOND_PICKAXE:
ItemId: 278
ItemType: TOOL
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 1561
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 3
XpMultiplier: 1 XpMultiplier: 1
DiamondAxe: DIAMOND_AXE:
ItemId: 279
ItemType: TOOL
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 1561
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 3
XpMultiplier: 1 XpMultiplier: 1
DiamondHoe: DIAMOND_HOE:
ItemId: 293
ItemType: TOOL
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 1561
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 2
XpMultiplier: .5 XpMultiplier: .5
# Armor # Armor
DiamondHelmet: DIAMOND_HELMET:
ItemId: 310
ItemType: ARMOR
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 363
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 5
XpMultiplier: 6 XpMultiplier: 6
DiamondChest: DIAMOND_CHESTPLATE:
ItemId: 311
ItemType: ARMOR
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 528
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 8
XpMultiplier: 6 XpMultiplier: 6
DiamondLegs: DIAMOND_LEGGINGS:
ItemId: 312
ItemType: ARMOR
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 495
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 7
XpMultiplier: 6 XpMultiplier: 6
DiamondBoots: DIAMOND_BOOTS:
ItemId: 313
ItemType: ARMOR
MaterialType: DIAMOND
RepairMaterialId: 264
RepairMaterialMetadata: -1
MaximumDurability: 429
MinimumLevel: 50 MinimumLevel: 50
MinimumQuantity: 4
XpMultiplier: 6 XpMultiplier: 6
# #
# Leather repairables # Leather repairables
### ###
# Armor # Armor
LeatherHelmet: LEATHER_HELMET:
ItemId: 298
ItemType: ARMOR
MaterialType: LEATHER
RepairMaterialId: 334
RepairMaterialMetadata: -1
MaximumDurability: 55
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 5
XpMultiplier: 1 XpMultiplier: 1
LeatherChest: LEATHER_CHESTPLATE:
ItemId: 299
ItemType: ARMOR
MaterialType: LEATHER
RepairMaterialId: 334
RepairMaterialMetadata: -1
MaximumDurability: 80
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 8
XpMultiplier: 1 XpMultiplier: 1
LeatherLegs: LEATHER_LEGGINGS:
ItemId: 300
ItemType: ARMOR
MaterialType: LEATHER
RepairMaterialId: 334
RepairMaterialMetadata: -1
MaximumDurability: 75
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 7
XpMultiplier: 1 XpMultiplier: 1
LeatherBoots: LEATHER_BOOTS:
ItemId: 301
ItemType: ARMOR
MaterialType: LEATHER
RepairMaterialId: 334
RepairMaterialMetadata: -1
MaximumDurability: 65
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 4
XpMultiplier: 1 XpMultiplier: 1
# #
# String repairables # String repairables
### ###
# Tools # Tools
FishingRod: FISHING_ROD:
ItemId: 346
ItemType: TOOL
MaterialType: STRING
RepairMaterialId: 287
RepairMaterialMetadata: -1
MaximumDurability: 64
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 2
XpMultiplier: .5 XpMultiplier: .5
Bow: BOW:
ItemId: 261
ItemType: TOOL
MaterialType: STRING
RepairMaterialId: 287
RepairMaterialMetadata: -1
MaximumDurability: 384
MinimumLevel: 0 MinimumLevel: 0
MinimumQuantity: 3
XpMultiplier: .5 XpMultiplier: .5