Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ValheimTerraformPlus v1.0.0
ValheimTerraformPlus.dll
Decompiled 3 weeks agousing 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 BepInEx.Configuration; using BepInEx.Logging; 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("ValheimTerraformPlus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Increases the radius of the Cultivator/Hoe terrain tools in Valheim.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ValheimTerraformPlus")] [assembly: AssemblyTitle("ValheimTerraformPlus")] [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 ValheimTerraformPlus { [BepInPlugin("shamloebs.valheim.terraformplus", "ValheimTerraformPlus", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGUID = "shamloebs.valheim.terraformplus"; public const string PluginName = "ValheimTerraformPlus"; public const string PluginVersion = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry<float> RadiusMultiplier; internal static ConfigEntry<bool> AffectLevel; internal static ConfigEntry<bool> AffectRaise; internal static ConfigEntry<bool> AffectSmooth; internal static ConfigEntry<bool> AffectPaint; private readonly Harmony _harmony = new Harmony("shamloebs.valheim.terraformplus"); private void Awake() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; RadiusMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RadiusMultiplier", 2f, new ConfigDescription("Multiplies the radius of every hoe/cultivator terrain action (level, raise, smooth, paint). 1 = vanilla.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); AffectLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "AffectLevel", true, "Apply the radius multiplier to leveling (flatten ground)."); AffectRaise = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "AffectRaise", true, "Apply the radius multiplier to raising terrain."); AffectSmooth = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "AffectSmooth", true, "Apply the radius multiplier to smoothing terrain."); AffectPaint = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "AffectPaint", true, "Apply the radius multiplier to ground painting (paths, cultivated soil)."); _harmony.PatchAll(); Log.LogInfo((object)string.Format("{0} {1} loaded. Radius multiplier: {2}x", "ValheimTerraformPlus", "1.0.0", RadiusMultiplier.Value)); } private void OnDestroy() { _harmony.UnpatchSelf(); } } [HarmonyPatch(typeof(ZNetScene), "Awake")] internal static class ZNetScene_Awake_ScaleTerrainRadius { private static void Postfix(ZNetScene __instance) { float value = Plugin.RadiusMultiplier.Value; if (Mathf.Approximately(value, 1f)) { return; } int num = 0; foreach (GameObject prefab in __instance.m_prefabs) { if ((Object)(object)prefab == (Object)null) { continue; } TerrainOp component = prefab.GetComponent<TerrainOp>(); if ((Object)(object)component == (Object)null) { continue; } Settings settings = component.m_settings; if (settings != null) { if (Plugin.AffectLevel.Value && settings.m_level) { settings.m_levelRadius *= value; } if (Plugin.AffectRaise.Value && settings.m_raise) { settings.m_raiseRadius *= value; } if (Plugin.AffectSmooth.Value && settings.m_smooth) { settings.m_smoothRadius *= value; } if (Plugin.AffectPaint.Value && settings.m_paintCleared) { settings.m_paintRadius *= value; } num++; } } Plugin.Log.LogInfo((object)$"Scaled terrain radius on {num} prefab(s) by {value}x."); } } }