2020-12-22 21:39:53 +00:00
|
|
|
|
using QSB.Patches;
|
2021-02-15 10:29:24 +00:00
|
|
|
|
using System.Reflection;
|
2020-12-22 21:39:53 +00:00
|
|
|
|
|
2020-12-31 12:10:55 +00:00
|
|
|
|
namespace QSB.QuantumSync.Patches
|
2020-12-22 21:39:53 +00:00
|
|
|
|
{
|
2021-01-18 12:33:07 +00:00
|
|
|
|
public class ClientQuantumPatches : QSBPatch
|
2020-12-22 21:39:53 +00:00
|
|
|
|
{
|
|
|
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect;
|
|
|
|
|
|
2021-02-15 10:29:24 +00:00
|
|
|
|
public override void DoPatches()
|
|
|
|
|
{
|
|
|
|
|
QSBCore.Helper.HarmonyHelper.AddPrefix<QuantumMoon>("ChangeQuantumState", typeof(ClientQuantumPatches), nameof(ReturnFalsePatch));
|
|
|
|
|
QSBCore.Helper.HarmonyHelper.AddPostfix<QuantumMoon>("Start", typeof(ClientQuantumPatches), nameof(Moon_CollapseOnStart));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DoUnpatches()
|
|
|
|
|
{
|
|
|
|
|
QSBCore.Helper.HarmonyHelper.Unpatch<QuantumMoon>("ChangeQuantumState");
|
|
|
|
|
QSBCore.Helper.HarmonyHelper.Unpatch<QuantumMoon>("Start");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Moon_CollapseOnStart(QuantumMoon __instance)
|
|
|
|
|
=> __instance.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { -1 });
|
2020-12-22 21:39:53 +00:00
|
|
|
|
|
2020-12-24 10:06:17 +00:00
|
|
|
|
public static bool ReturnFalsePatch() => false;
|
2020-12-22 21:39:53 +00:00
|
|
|
|
}
|
2020-12-24 10:06:17 +00:00
|
|
|
|
}
|