Decompiled source of WeightChangeMod v0.0.2

WeightChangeMod.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.Configuration;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("WeightChangeMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WeightChangeMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("87788367-8d2f-4265-a5c8-a6d6e23a73dc")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace WeightChangeMod;

[BepInPlugin("Kojeak.WeightChangeMod", "Weight Change By Kojeak", "0.0.2")]
[BepInProcess("valheim.exe")]
public class WeightChange : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Player), "GetMaxCarryWeight")]
	private class GetMaxCarryWeight_Patch
	{
		private static void Prefix(ref float ___m_maxCarryWeight)
		{
			___m_maxCarryWeight = configText1.Value;
		}
	}

	private const string modGUID = "Kojeak.WeightChangeMod";

	private const string modName = "Weight Change By Kojeak";

	private const string modVersion = "0.0.2";

	private static ConfigEntry<float> configText1;

	private static ConfigEntry<bool> configText2;

	private readonly Harmony harmony = new Harmony("Kojeak.WeightChangeMod");

	private void Awake()
	{
		configText1 = ((BaseUnityPlugin)this).Config.Bind<float>("Config Mod", "Change Your Weight", 5000f, "Here You Can Change Your Weight, Default Value Is 50000");
		configText2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Enable Mod", "Enable/Disable", true, "You Can Enable Or Disable This Mod");
		harmony.PatchAll();
	}
}