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 BlackMetalBuildables v1.0.1
plugins\BlackMetalBuildables.dll
Decompiled 6 days agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BlackMetalBuildables")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f737fbdbf47d558a3bca54c44548dcb5bb4168a6")] [assembly: AssemblyProduct("BlackMetalBuildables")] [assembly: AssemblyTitle("BlackMetalBuildables")] [assembly: AssemblyVersion("1.0.0.0")] [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 BlackMetalBuildables { [BepInPlugin("haydenc52.BlackMetalBuildables", "Black Metal Buildables", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string PluginGuid = "haydenc52.BlackMetalBuildables"; private const string PluginName = "Black Metal Buildables"; private const string PluginVersion = "1.0.1"; private void Awake() { PrefabManager.OnVanillaPrefabsAvailable += RegisterPieces; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Black Metal Buildables loaded"); } private static void RegisterPieces() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown PrefabManager.OnVanillaPrefabsAvailable -= RegisterPieces; AddPiece(new CustomPiece("blackmetal_floor_1x1", "iron_floor_1x1_v2", CreateBlackMetalPieceConfig("Black Metal Cage Floor 1x1", "A sturdy cage floor forged from black metal.", 1))); AddPiece(new CustomPiece("blackmetal_floor_2x2", "iron_floor_2x2", CreateBlackMetalPieceConfig("Black Metal Cage Floor", "A sturdy cage floor forged from black metal.", 2))); AddPiece(new CustomPiece("blackmetal_gate", "iron_grate", CreateBlackMetalPieceConfig("Black Metal Gate", "A sturdy gate forged from black metal.", 2))); AddPiece(new CustomPiece("blackmetal_wall_1x1", "iron_wall_1x1", CreateBlackMetalPieceConfig("Black Metal Cage Wall 1x1", "A sturdy cage wall forged from black metal.", 1))); AddPiece(new CustomPiece("blackmetal_wall_2x2", "iron_wall_2x2", CreateBlackMetalPieceConfig("Black Metal Cage Wall 2x2", "A sturdy cage wall forged from black metal.", 2))); } private static PieceConfig CreateBlackMetalPieceConfig(string name, string description, int blackMetalCost) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown PieceConfig val = new PieceConfig { Name = name, Description = description, PieceTable = "Hammer", Category = "HeavyBuild", CraftingStation = "Forge" }; val.AddRequirement("BlackMetal", blackMetalCost, true); return val; } private static void AddPiece(CustomPiece piece) { ApplyBlackMetalLook(piece.PiecePrefab); PieceManager.Instance.AddPiece(piece); } private static void ApplyBlackMetalLook(GameObject prefab) { Renderer[] componentsInChildren = prefab.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val2 = Object.Instantiate<Material>(sharedMaterials[j]); ((Object)val2).name = ((Object)sharedMaterials[j]).name + "_BMB_BlackMetal"; TryTintMaterial(val2); sharedMaterials[j] = val2; } } val.sharedMaterials = sharedMaterials; } } private static void TryTintMaterial(Material mat) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (mat.HasProperty("_Color")) { Color color = mat.color; mat.color = new Color(color.r * 0.4f, color.g * 0.7f, color.b * 0.55f, color.a); } } } }