Code/ClientOnlyHelper.cs
using System;
using Sandbox;

namespace Orizon;

internal static class ClientOnlyHelper
{
	private static void EnsureClient()
	{
		if ( !Networking.IsClient )
			throw new Exception( "Only the client can call this method" );
	}

	internal static void __client_only_wrapper( WrappedMethod m, params object[] args )
	{
		EnsureClient();
		m.Resume();
	}

	internal static T __client_only_wrapper<T>( WrappedMethod<T> m, params object[] args )
	{
		EnsureClient();
		return m.Resume();
	}
}