mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
38 lines
No EOL
927 B
C#
38 lines
No EOL
927 B
C#
using MelonLoader;
|
|
using NAK.RelativeSync.Networking;
|
|
using NAK.RelativeSync.Patches;
|
|
|
|
namespace NAK.RelativeSync;
|
|
|
|
public class RelativeSyncMod : MelonMod
|
|
{
|
|
internal static MelonLogger.Instance Logger;
|
|
|
|
public override void OnInitializeMelon()
|
|
{
|
|
Logger = LoggerInstance;
|
|
|
|
ModNetwork.Subscribe();
|
|
|
|
ApplyPatches(typeof(NetworkRootDataUpdatePatches));
|
|
|
|
ApplyPatches(typeof(PlayerSetupPatches));
|
|
ApplyPatches(typeof(PuppetMasterPatches));
|
|
|
|
ApplyPatches(typeof(CVRSeatPatches));
|
|
ApplyPatches(typeof(CVRMovementParentPatches));
|
|
}
|
|
|
|
private void ApplyPatches(Type type)
|
|
{
|
|
try
|
|
{
|
|
HarmonyInstance.PatchAll(type);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
|
LoggerInstance.Error(e);
|
|
}
|
|
}
|
|
} |