private bool ContextOnInterraction(InteractionContext context) { if (context.Method == InteractionMethod.Right) { if (context.SelectedItem is PickaxeItem) { if (context.HasBlock == false || context.Player.User.Inventory.Carried.IsEmpty) { if (SkillsUtil.HasSkillLevel(context.Player.User, typeof(MiningPickupAmountSkill), 1)) { RubbleUtils.PickUpRubble(context.Player.User, 2 + (2 * SkillsUtil.GetSkillLevel(context.Player.User, typeof(MiningPickupRangeSkill))), (BetterMiningPlugin.ConfigStorage.GetInt("PickupRubbleBySkillLevel") * SkillsUtil.GetSkillLevel(context.Player.User, typeof(MiningPickupAmountSkill)))); } } } } else if (context.Method == InteractionMethod.Left) { if (context.SelectedItem is PickaxeItem && context.HasBlock && context.Block.Is <Minable>()) { if (context.SelectedItem.OnActLeft(context).IsSuccess) { RubbleUtils.BreakBigRubble(context.BlockPosition.Value, 20 * SkillsUtil.GetSkillLevel(context.Player.User, typeof(StrongMiningSkill))); return(true); } } } return(false); }
public override InteractResult OnActRight(InteractionContext context) { User user = context.Player.User; if (context.HasBlock == false || user.Inventory.Carried.IsEmpty) { if (SkillsUtil.HasSkillLevel(user, typeof(MiningPickupAmountSkill), 1)) { RubbleUtils.PickUpRubble(user, 2 + (2 * SkillsUtil.GetSkillLevel(user, typeof(MiningPickupRangeSkill))), (4 * SkillsUtil.GetSkillLevel(user, typeof(MiningPickupAmountSkill)))); return(InteractResult.Success); } } return(InteractResult.NoOp); }