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 StickyKiln v1.0.0
plugins/StickyKiln/StickyKiln.dll
Decompiled 6 days 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 HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")] [assembly: AssemblyCompany("StickyKiln")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("StickyKiln")] [assembly: AssemblyTitle("StickyKiln")] [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 StickyKiln { [BepInPlugin("wayfarers.stickykiln", "Sticky Kiln", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "wayfarers.stickykiln"; public const string Name = "Sticky Kiln"; public const string Version = "1.0.0"; public static ConfigEntry<float> ResinChance; public static ConfigEntry<int> ResinAmount; private Harmony _harmony; private void Awake() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ResinChance = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ResinChance", 0.25f, "Chance (0-1) that a Charcoal Kiln run yields extra Resin alongside the Charcoal."); ResinAmount = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ResinAmount", 1, "How much Resin is dropped when the chance hits."); _harmony = new Harmony("wayfarers.stickykiln"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Resin Extractor (Charcoal Kiln byproduct) is loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } [HarmonyPatch(typeof(Smelter), "Spawn")] public static class ResinByproduct { private static void Postfix(Smelter __instance, string ore, int stack) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (ore != "Wood" || Plugin.ResinChance.Value <= 0f || Plugin.ResinAmount.Value <= 0 || Random.value > Plugin.ResinChance.Value) { return; } ZNetView value = Traverse.Create((object)__instance).Field("m_nview").GetValue<ZNetView>(); Transform value2 = Traverse.Create((object)__instance).Field("m_outputPoint").GetValue<Transform>(); if ((Object)(object)value == (Object)null || !value.IsValid() || (Object)(object)value2 == (Object)null) { return; } GameObject prefab = ZNetScene.instance.GetPrefab("Resin"); if ((Object)(object)prefab == (Object)null) { return; } ItemDrop component = Object.Instantiate<GameObject>(prefab, value2.position, value2.rotation).GetComponent<ItemDrop>(); if (!((Object)(object)component == (Object)null) && component.m_itemData != null) { component.m_itemData.m_stack = Plugin.ResinAmount.Value; bool flag = value.GetZDO().GetBool(ZDOVars.s_cheatedQueued, false); if (!flag) { flag = value.GetZDO().GetBool(ZDOVars.s_cheated, false); } bool value3 = Traverse.Create(typeof(PlayerProfile)).Property("s_bypassCheatChecks", (object[])null).GetValue<bool>(); flag = flag && !value3; ItemDrop.OnCreateNew(component, flag); } } } }