Better way to handle ink sacks, allows for dropping of multiple types.

This commit is contained in:
GJ
2013-09-16 12:48:08 -04:00
parent e0592b3f62
commit 1a88b0b944
2 changed files with 17 additions and 9 deletions

View File

@ -111,7 +111,18 @@ public class TreasureConfig extends ConfigLoader {
/*
* Material, Amount, and Data
*/
Material material = treasureName.contains("POTION") ? Material.POTION : Material.matchMaterial(treasureName);
Material material;
if (treasureName.contains("POTION")) {
material = Material.POTION;
}
else if (treasureName.contains("INK_SACK")) {
material = Material.INK_SACK;
}
else {
material = Material.matchMaterial(treasureName);
}
int amount = config.getInt(type + "." + treasureName + ".Amount");
int data = config.getInt(type + "." + treasureName + ".Data");
@ -179,8 +190,8 @@ public class TreasureConfig extends ConfigLoader {
reason.add("Invalid Potion_Type: " + potionType);
}
}
else if (config.contains(type + "." + treasureName + ".Dye_Color")) {
String color = config.getString("Fishing." + treasureName + ".Dye_Color");
else if (treasureName.contains("INK_SACK")) {
String color = treasureName.substring(9);
try {
Dye dye = new Dye();