Decompiled source of SNOWDAY v3.0.0

SnowDay.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SnowDay")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("TheBeesDecree")]
[assembly: AssemblyProduct("SnowDay")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4358610B-F3F4-4843-B7AF-98B7BC60DCDE")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace SnowDay
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("TheBeesDecree.SnowDay", "SnowDay", "3.0.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class SnowDayplugin : BaseUnityPlugin
	{
		internal const string ModName = "SnowDay";

		internal const string ModVersion = "3.0.0";

		internal const string Author = "TheBeesDecree";

		private const string ModGUID = "TheBeesDecree.SnowDay";

		private readonly Harmony _harmony = new Harmony("TheBeesDecree.SnowDay");

		public static readonly ManualLogSource SnowDayLogger = Logger.CreateLogSource("SnowDay");

		public void Awake()
		{
			AddPieces();
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			_harmony.PatchAll(executingAssembly);
		}

		private void AddPieces()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			string text = "snowday";
			AssetBundle val = AssetUtils.LoadAssetBundleFromResources(text, Assembly.GetExecutingAssembly());
			GameObject[] array = val.LoadAllAssets<GameObject>();
			GameObject val2 = val.LoadAsset<GameObject>("MagickMitten");
			ItemConfig val3 = new ItemConfig();
			val3.Name = "Magick Mitten";
			val3.Description = "You cant even put it on, its frozen hard as a rock!";
			val3.CraftingStation = CraftingStations.Workbench;
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
			{
				new RequirementConfig
				{
					Item = "WolfPelt",
					Amount = 10
				},
				new RequirementConfig
				{
					Item = "Blueberries",
					Amount = 5
				},
				new RequirementConfig
				{
					Item = "Crystal",
					Amount = 50,
					AmountPerLevel = 50
				}
			};
			ItemManager.Instance.AddItem(new CustomItem(val2, false, val3));
			PieceTable buildPieces = val2.GetComponent<ItemDrop>().m_itemData.m_shared.m_buildPieces;
			buildPieces.m_categories = new List<PieceCategory>
			{
				(PieceCategory)0,
				(PieceCategory)1,
				(PieceCategory)2,
				(PieceCategory)3
			};
			buildPieces.m_categoryLabels = new List<string> { "Ice/Deep North", "Misc.", "Snow/Mountains", "Furniture" };
			foreach (GameObject piece in buildPieces.m_pieces)
			{
				PieceManager.Instance.AddPiece(new CustomPiece(piece, ((Object)buildPieces).name, false));
			}
		}
	}
}