Decompiled source of Spoods IL2CPP Larger Trash Can Radius v1.0.1

Spood.IL2CPP.LargerTrashRadius.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppScheduleOne.ObjectScripts;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using Spood.IL2CPP.LargerTrashRadius;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Mod), "Spood.IL2CPP.LargerTrashRadius", "1.0.0", "Spood", null)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Spood.IL2CPP.LargerTrashRadius")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+05d3b8ccb08b1f063b74bd29183b0cc02a060ffa")]
[assembly: AssemblyProduct("Spood.IL2CPP.LargerTrashRadius")]
[assembly: AssemblyTitle("Spood.IL2CPP.LargerTrashRadius")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 Spood.IL2CPP.LargerTrashRadius
{
	public class Mod : MelonMod
	{
		public const string PreferencesCategory = "Spood_LargerTrashRadius";

		public const string PreferencesRadiusEntryName = "radius";

		public override void OnInitializeMelon()
		{
			((MelonBase)this).LoggerInstance.Msg("Spood.IL2CPP.LargerTrashRadius Initialized");
			SetupPreferences();
			((MelonBase)this).HarmonyInstance.PatchAll();
		}

		private void SetupPreferences()
		{
			MelonPreferences_Category val = MelonPreferences.CreateCategory("Spood_LargerTrashRadius");
			if (val.GetEntry("radius") == null)
			{
				val.CreateEntry<float>("radius", 5.5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
				val.SaveToFile(true);
			}
		}
	}
	[HarmonyPatch(typeof(TrashContainerItem), "Awake")]
	public class PickupRadiusPatch
	{
		private static void Prefix(Il2CppObjectBase __instance)
		{
			MelonPreferences_Category category = MelonPreferences.GetCategory("Spood_LargerTrashRadius");
			float value = category.GetEntry<float>("radius").Value;
			PropertyInfo property = ((object)__instance).GetType().GetProperty("PickupRadius", BindingFlags.Instance | BindingFlags.Public);
			property.SetValue(__instance, value);
		}
	}
}