Decompiled source of NoWoodWaterDamage v1.0.0

plugins/cjayride-NoWoodWaterDamage/Cjayride.NoWoodWaterDamage.dll

Decompiled 8 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("assembly_valheim")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyCompany("Cjayride.NoWoodWaterDamage")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Cjayride.NoWoodWaterDamage")]
[assembly: AssemblyTitle("Cjayride.NoWoodWaterDamage")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 Cjayride.NoWoodWaterDamage
{
	[BepInPlugin("cjayride.NoWoodWaterDamage", "No Wood Water Damage", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "cjayride.NoWoodWaterDamage";

		public const string PluginName = "No Wood Water Damage";

		public const string PluginVersion = "1.0.0";

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("cjayride.NoWoodWaterDamage").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Wood, hardwood, and timberwood pieces no longer wear from being in water. Rain on an unroofed piece still does.");
		}
	}
	[HarmonyPatch(typeof(WearNTear), "IsWet")]
	internal static class SkipSubmergedWood
	{
		private static void Postfix(WearNTear __instance, ref bool __result)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			if (__result && !((Object)(object)__instance == (Object)null))
			{
				MaterialType materialType = __instance.m_materialType;
				if (((int)materialType == 0 || (int)materialType == 3 || (int)materialType == 8) && !((Object)(object)((Component)__instance).GetComponentInParent<Ship>() != (Object)null) && __instance.IsUnderWater())
				{
					__result = false;
				}
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}