mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-04-19 10:06:25 +02:00
25 lines
747 B
Java
25 lines
747 B
Java
package com.gmail.nossr50.skills.mining;
|
|
|
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|
import com.gmail.nossr50.mcMMO;
|
|
import org.bukkit.block.BlockState;
|
|
|
|
public class Mining {
|
|
|
|
/**
|
|
* Calculate XP gain for Mining.
|
|
*
|
|
* @param blockState The {@link BlockState} to check ability activation for
|
|
*/
|
|
public static int getBlockXp(BlockState blockState) {
|
|
int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, blockState.getType());
|
|
|
|
if (xp == 0 && mcMMO.getModManager().isCustomMiningBlock(blockState)) {
|
|
xp = mcMMO.getModManager().getBlock(blockState).getXpGain();
|
|
}
|
|
|
|
return xp;
|
|
}
|
|
}
|