I'm trying to modify mining speed with a mixin but it doesn't seem to work.
@Mixin(AbstractBlock.AbstractBlockState.class)
public abstract class AbstractBlockMixin {
@Inject(method = "calcBlockBreakingDelta", at = @At("RETURN"), cancellable = true)
private void modifyBreakingDelta(PlayerEntity player, BlockView world, BlockPos pos, CallbackInfoReturnable<Float> cir) {
if (player.getWorld().isClient()) return;
if (!player.getMainHandStack().isEmpty()) return;
PlayerStats stats = ModComponents.STATS.get(player).getStats();
Stat fuerza = stats.getStat(PlayerStats.StatEnum.FUERZA);
float fuerzaValor = fuerza.getValor();
// Bonus: +5% por punto de fuerza
float fuerzaMultiplier = fuerzaValor * 0.01f;
float original = cir.getReturnValueF();
float result = original * fuerzaMultiplier;
cir.setReturnValue(result);
}
}