use of net.silentchaos512.gems.skills.ToolSkillDigger in project SilentGems by SilentChaos512.
the class GemsCommonEvents method onGetBreakSpeed.
@SubscribeEvent
public void onGetBreakSpeed(PlayerEvent.BreakSpeed event) {
EntityPlayer player = event.getEntityPlayer();
ItemStack mainHand = player.getHeldItem(EnumHand.MAIN_HAND);
if (StackHelper.isValid(mainHand)) {
// Shears on Fluffy Blocks
if (event.getState() == ModBlocks.fluffyBlock) {
ModBlocks.fluffyBlock.onGetBreakSpeed(event);
}
// Gravity enchantment.
int gravityLevel = EnchantmentHelper.getEnchantmentLevel(ModEnchantments.gravity, mainHand);
if (gravityLevel > 0)
ModEnchantments.gravity.onGetBreakSpeed(event, mainHand, gravityLevel);
// Reduce speed for Area Miner and Lumberjack.
ToolSkill skill = ToolHelper.getSuperSkill(mainHand);
if (skill instanceof ToolSkillDigger && ToolHelper.isSpecialAbilityEnabled(mainHand))
((ToolSkillDigger) skill).onGetBreakSpeed(event);
}
}
Aggregations