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

@ -22,15 +22,10 @@ public class Mining {
*/
protected static int getBlockXp(BlockState blockState) {
Material blockType = blockState.getType();
int xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, blockType);
int xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, blockType != Material.GLOWING_REDSTONE_ORE ? blockType : Material.REDSTONE_ORE);
if (xp == 0) {
if (blockType == Material.GLOWING_REDSTONE_ORE) {
xp = ExperienceConfig.getInstance().getXp(SkillType.MINING, Material.REDSTONE_ORE);
}
else if (ModUtils.isCustomMiningBlock(blockState)) {
xp = ModUtils.getCustomBlock(blockState).getXpGain();
}
if (xp == 0 && ModUtils.isCustomMiningBlock(blockState)) {
xp = ModUtils.getCustomBlock(blockState).getXpGain();
}
return xp;