using System;
using System.Diagnostics;
using System.Linq;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("blacks7ar")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.3")]
[assembly: AssemblyInformationalVersion("1.0.3")]
[assembly: AssemblyProduct("NoTreeStump")]
[assembly: AssemblyTitle("NoTreeStump")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.3.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 NoTreeStump
{
[BepInPlugin("blacks7ar.NoTreeStump", "NoTreeStump", "1.0.3")]
public class Plugin : BaseUnityPlugin
{
[HarmonyPatch(typeof(ZNetScene), "Awake")]
private static class Patches
{
private static void Postfix(ZNetScene __instance)
{
if ((Object)(object)__instance == (Object)null || __instance.m_prefabs.Count <= 0)
{
return;
}
foreach (TreeBase item in from prefab in __instance.m_prefabs
select prefab.GetComponent<TreeBase>() into component
where Object.op_Implicit((Object)(object)component) && (Object)(object)component.m_stubPrefab != (Object)null
select component)
{
item.m_stubPrefab = null;
}
}
}
private const string modGUID = "blacks7ar.NoTreeStump";
public const string modName = "NoTreeStump";
public const string modAuthor = "blacks7ar";
public const string modVersion = "1.0.3";
public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/NoTreeStump/";
private static readonly Harmony _harmony = new Harmony("blacks7ar.NoTreeStump");
public void Awake()
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
_harmony.PatchAll(executingAssembly);
}
}
}