mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-29 12:14:43 +02:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user