Decompiled source of AlwaysMeteorShower v1.0.3

AlwaysMeteorShowers.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Unity.Netcode;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("AlwaysMeteorShowers")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AlwaysMeteorShowers")]
[assembly: AssemblyTitle("AlwaysMeteorShowers")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace AlwaysMeteorShowers;

[BepInPlugin("com.lacycat.alwaysmeteorshowers", "Always Meteor Showers", "1.0.3")]
public class MeteorPatchPlugin : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.lacycat.alwaysmeteorshowers");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Meteor Patch plugin loaded!");
	}
}
[HarmonyPatch(typeof(TimeOfDay), "DecideRandomDayEvents")]
public class Patch_MeteorShower_DecideRandomDayEvents
{
	public static float showertime = (float)new Random().Next(5, 50) / 100f;

	private static bool Prefix(TimeOfDay __instance)
	{
		if (((NetworkBehaviour)__instance).IsServer)
		{
			__instance.meteorShowerAtTime = showertime;
		}
		return false;
	}
}