Decompiled source of InfiniteLantern v1.0.0

Lantern with unlimited durability.dll

Decompiled 4 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("peak")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("peak")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3517a43d-b78c-4bcc-b8c0-aee24c2920a4")]
[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 PeakLanternMod;

[BepInPlugin("com.yourname.peak.lantern", "提灯无限耐久热键版", "1.0.0")]
public class LanternHotkeyMod : BaseUnityPlugin
{
	public static bool IsInfiniteEnabled;

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.yourname.peak.lantern");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"提灯 Mod 已加载!按 F11 切换无限耐久。");
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)292))
		{
			IsInfiniteEnabled = !IsInfiniteEnabled;
			string text = (IsInfiniteEnabled ? "开启" : "关闭");
			((BaseUnityPlugin)this).Logger.LogInfo((object)("[提灯补丁] 当前状态: " + text));
		}
	}

	private void OnGUI()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		GUIStyle val = new GUIStyle();
		val.fontSize = 20;
		val.normal.textColor = (IsInfiniteEnabled ? Color.green : Color.white);
		string text = (IsInfiniteEnabled ? "【提灯无限耐久: 已开启】" : "【提灯无限耐久: 已关闭 (F11切换)】");
		GUI.Label(new Rect(20f, 20f, 400f, 50f), text, val);
	}
}
[HarmonyPatch(typeof(Lantern), "UpdateFuel")]
public class LanternUpdatePatch
{
	private static bool Prefix()
	{
		if (LanternHotkeyMod.IsInfiniteEnabled)
		{
			return false;
		}
		return true;
	}
}