Smelting now works with custom ores.

Also fixed exploit where smelting XP could be awarded for some
non-smeltable materials.
This commit is contained in:
GJ
2013-10-31 13:25:06 -04:00
parent 1785bab504
commit de3c4f8fd7
10 changed files with 65 additions and 24 deletions

View File

@ -92,9 +92,11 @@ public class CustomBlockConfig extends ConfigLoader {
}
int xp = config.getInt(skillType + "." + blockName + ".XP_Gain");
int smeltingXp = 0;
if (skillType.equals("Mining") && config.getBoolean(skillType + "." + blockName + ".Is_Ore")) {
customOres.add(blockMaterialData);
smeltingXp = config.getInt(skillType + "." + blockName + ".Smelting_XP_Gain", xp / 10);
}
else if (skillType.equals("Woodcutting")) {
if (config.getBoolean(skillType + "." + blockName + ".Is_Log")) {
@ -106,7 +108,7 @@ public class CustomBlockConfig extends ConfigLoader {
}
}
customBlockMap.put(blockMaterialData, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled")));
customBlockMap.put(blockMaterialData, new CustomBlock(xp, config.getBoolean(skillType + "." + blockName + ".Double_Drops_Enabled"), smeltingXp));
}
}