Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SnowyWeeds v1.4.1
SnowyWeeds.dll
Decompiled a year agousing System; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using HarmonyLib; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using UnityEngine; using WeatherRegistry; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SnowyWeeds")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Template plugin description")] [assembly: AssemblyFileVersion("1.3.4.0")] [assembly: AssemblyInformationalVersion("1.3.4+2f2b13822a704ee1e3a308c6c6a77272d0bf212a")] [assembly: AssemblyProduct("SnowyWeeds")] [assembly: AssemblyTitle("SnowyWeeds")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SnowyWeeds { internal static class LobbyCompatibility { internal static void Init() { PluginHelper.RegisterPlugin("dopadream.lethalcompany.snowyweeds", Version.Parse("1.4.1"), (CompatibilityLevel)0, (VersionStrictness)0); } } [BepInPlugin("dopadream.lethalcompany.snowyweeds", "SnowyWeeds", "1.4.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { [HarmonyPatch] private class SnowyWeedPatches { [HarmonyPatch(typeof(MoldSpreadManager), "Start")] [HarmonyPostfix] private static void PostStart(MoldSpreadManager __instance) { if ((Object)(object)weedMaterial == (Object)null && (Object)(object)weedTexture != (Object)null) { GameObject moldPrefab = __instance.moldPrefab; Renderer val = ((moldPrefab == null) ? null : moldPrefab.GetComponentsInChildren<Renderer>()?.Where((Renderer rend) => ((Component)rend).gameObject.layer != 22)?.FirstOrDefault()); if ((Object)(object)val != (Object)null) { weedMaterial = Object.Instantiate<Material>(val.sharedMaterial); weedMaterial.mainTexture = weedTexture; Logger.LogDebug((object)"Cached snowy material"); } else { Logger.LogError((object)"Failed to create snowy weeds material"); } } } [HarmonyPatch(typeof(RoundManager), "FinishGeneratingNewLevelClientRpc")] [HarmonyPostfix] private static void PostSpreadMold() { if ((Object)(object)weedMaterial == (Object)null || !IsSnowLevel()) { return; } MoldSpreadManager obj = Object.FindAnyObjectByType<MoldSpreadManager>(); object obj2; if (obj == null) { obj2 = null; } else { Transform moldContainer = obj.moldContainer; obj2 = ((moldContainer != null) ? ((Component)moldContainer).GetComponentsInChildren<Renderer>() : null); } Renderer[] array = (Renderer[])obj2; if (array != null && array.Length >= 1) { Renderer[] array2 = array; for (int i = 0; i < array2.Length; i++) { array2[i].sharedMaterial = weedMaterial; Logger.LogDebug((object)(((Object)weedMaterial.mainTexture).name + " applied to shroud")); } } } } internal const string PLUGIN_GUID = "dopadream.lethalcompany.snowyweeds"; internal const string PLUGIN_NAME = "SnowyWeeds"; internal const string PLUGIN_VERSION = "1.4.1"; internal const string LOBBY_COMPATIBILITY = "BMX.LobbyCompatibility"; internal const string WEATHER_REGISTRY = "mrov.WeatherRegistry"; internal const string ARTIFICE_BLIZZARD = "butterystancakes.lethalcompany.artificeblizzard"; internal static ManualLogSource Logger; internal static Texture weedTexture; internal static Material weedMaterial; private void Awake() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility")) { LobbyCompatibility.Init(); Logger.LogInfo((object)"CROSS-COMPATIBILITY - Lobby Compatibility detected"); } if (Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry")) { Logger.LogInfo((object)"CROSS-COMPATIBILITY - Weather Registry detected"); } try { Object obj = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "snowyweeds")).LoadAsset("InvasiveWeedSnowy", typeof(Texture)); weedTexture = (Texture)(object)((obj is Texture) ? obj : null); } catch { Logger.LogError((object)"Encountered some error loading asset bundle. Did you install the plugin correctly?"); return; } new Harmony("dopadream.lethalcompany.snowyweeds").PatchAll(); Logger.LogInfo((object)"SnowyWeeds v1.4.1 loaded"); } private static bool IsSnowLevel() { if (Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry") && WeatherRegistrySnowCheck()) { return true; } if (StartOfRound.Instance.currentLevel.levelIncludesSnowFootprints) { if (!(((Object)StartOfRound.Instance.currentLevel).name != "ArtificeLevel") && Chainloader.PluginInfos.ContainsKey("butterystancakes.lethalcompany.artificeblizzard")) { return (Object)(object)GameObject.Find("/Systems/Audio/BlizzardAmbience") == (Object)null; } return true; } return false; } private static bool WeatherRegistrySnowCheck() { if (!((Object)WeatherManager.GetCurrentLevelWeather()).name.Equals("Snowfall")) { return ((Object)WeatherManager.GetCurrentLevelWeather()).name.Equals("Blizzard"); } return true; } } public static class PluginInfo { public const string PLUGIN_GUID = "SnowyWeeds"; public const string PLUGIN_NAME = "SnowyWeeds"; public const string PLUGIN_VERSION = "1.3.4"; } }