Decompiled source of WeightlessBoombox v1.0.0

DedicatedBoomboxSlot.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("DedicatedBoomboxSlot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DedicatedBoomboxSlot")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a52b1176-42cc-435a-b28b-eea140fa5f39")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DedicatedBoomboxSlot
{
	[BepInPlugin("KurisuBot.DedicatedBoomboxSlot", "DedicatedBoomboxSlot", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "KurisuBot.DedicatedBoomboxSlot";

		private const string modName = "DedicatedBoomboxSlot";

		private const string modVersion = "1.0.0";

		public static Plugin instance;

		private readonly Harmony harmony = new Harmony("KurisuBot.DedicatedBoomboxSlot");

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = Logger.CreateLogSource("KurisuBot.DedicatedBoomboxSlot");
			mls.LogInfo((object)"DedicatedBoomboxSlot Loading . . . ");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			mls.LogInfo((object)"DedicatedBoomboxSlot Loaded!");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}
	}
}
namespace DedicatedBoomboxSlot.Patches
{
	[HarmonyPatch(typeof(GrabbableObject))]
	public class BoomboxWeightPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void ChangeItemWeight(GrabbableObject __instance)
		{
			Plugin.Log("Attempting to edit item...");
			if (!((Object)(object)__instance == (Object)null))
			{
				if (__instance.itemProperties.itemName == "Boombox")
				{
					__instance.itemProperties.weight = 0f;
					Plugin.Log("Weight Updated Successfully");
				}
				else
				{
					Plugin.Log("Item was not Boombox. Continuing. . .");
				}
			}
		}
	}
}