Decompiled source of RefinedStonePieces v1.0.7
RefinedStonePieces.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BoatAdditions.Functions; using HarmonyLib; using ItemManager; using JetBrains.Annotations; using LocalizationManager; using Microsoft.CodeAnalysis; using PieceManager; using RefinedStonePieces.Functions; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("RefinedStonePieces")] [assembly: AssemblyDescription("https://thunderstore.io/c/valheim/p/blacks7ar/RefinedStonePieces/")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("blacks7ar")] [assembly: AssemblyProduct("RefinedStonePieces")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("28A168E4-262D-496F-9504-19B8833D9F40")] [assembly: AssemblyFileVersion("1.0.7")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.7.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 BoatAdditions.Functions { public static class ShaderReplacer { private static readonly List<GameObject> GOToSwap; static ShaderReplacer() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown GOToSwap = new List<GameObject>(); new Harmony("blacks7ar.utilities.ShaderReplacer").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(FejdStartup), "Awake", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(ShaderReplacer), "ReplaceShaderPatch", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } public static void Replace(GameObject gameObject) { GOToSwap.Add(gameObject); } [HarmonyPriority(700)] private static void ReplaceShaderPatch() { foreach (Material item in from gameObject in GOToSwap select gameObject.GetComponentsInChildren<Renderer>(true) into renderers from renderer in renderers where (Object)(object)renderer != (Object)null from material in renderer.sharedMaterials where (Object)(object)material != (Object)null select material) { Shader[] array = Resources.FindObjectsOfTypeAll<Shader>(); foreach (Shader val in array) { if (((Object)item.shader).name == ((Object)val).name) { item.shader = val; } } } } } } namespace RefinedStonePieces { [BepInPlugin("blacks7ar.RefinedStonePieces", "RefinedStonePieces", "1.0.7")] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(ZNetScene), "Awake")] private static class Patch { private static void Postfix(ZNetScene __instance) { Hearth(__instance); } } private const string modGUID = "blacks7ar.RefinedStonePieces"; public const string modName = "RefinedStonePieces"; public const string modAuthor = "blacks7ar"; public const string modVersion = "1.0.7"; public const string modLink = "https://thunderstore.io/c/valheim/p/blacks7ar/RefinedStonePieces/"; private static readonly Harmony _harmony = new Harmony("blacks7ar.RefinedStonePieces"); private static readonly ConfigSync _configSync = new ConfigSync("blacks7ar.RefinedStonePieces") { DisplayName = "RefinedStonePieces", CurrentVersion = "1.0.7", MinimumRequiredVersion = "1.0.7" }; private static ConfigEntry<ItemManager.Toggle> _serverConfigLocked; private ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); _configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig; return val2; } public void Awake() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown Localizer.Load(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; _serverConfigLocked = config("1- ServerSync", "Lock Configuration", ItemManager.Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>())); _configSync.AddLockingConfigEntry<ItemManager.Toggle>(_serverConfigLocked); SetupPrefabs.Init(); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private static void Hearth(ZNetScene zNetScene) { Fireplace component = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("BRP_RefinedStone_Hearth")).GetComponent<Fireplace>(); GameObject prefab = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("hearth")); SmokeSpawner componentInChildren = prefab.GetComponentInChildren<SmokeSpawner>(true); Fireplace component2 = prefab.GetComponent<Fireplace>(); component.m_fuelItem = zNetScene.GetPrefab(StringExtensionMethods.GetStableHashCode("Wood")).GetComponent<ItemDrop>(); component.m_smokeSpawner.m_smokePrefab = componentInChildren.m_smokePrefab; component.m_fuelAddedEffects = component2.m_fuelAddedEffects; component.m_firePrefab = component2.m_firePrefab; } } } namespace RefinedStonePieces.Functions { public static class SetupPrefabs { private static AssetBundle _refinedBundle; private const string _category = "RefinedStonePieces"; private const string _refinedStone = "BRP_RefinedStone"; public static void Init() { _refinedBundle = PiecePrefabManager.RegisterAssetBundle("refinedstonepieces"); Item item = new Item(_refinedBundle, "BRP_RefinedStone"); item.Crafting.Add(ItemManager.CraftingTable.StoneCutter, 1); item.CraftAmount = 100; item.RequiredItems.Add("Stone", 100); item.RequiredItems.Add("Flint", 10); item.RequiredItems.Add("Resin", 10); item.Configurable = Configurability.Recipe; ShaderReplacer.Replace(item.Prefab); BuildPiece buildPiece = new BuildPiece(_refinedBundle, "BRP_StoneArch"); buildPiece.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece.Category.Set("RefinedStonePieces"); buildPiece.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece.Prefab); BuildPiece buildPiece2 = new BuildPiece(_refinedBundle, "BRP_StoneArch2"); buildPiece2.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece2.Category.Set("RefinedStonePieces"); buildPiece2.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece2.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece2.Prefab); BuildPiece buildPiece3 = new BuildPiece(_refinedBundle, "BRP_StoneArch3"); buildPiece3.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece3.Category.Set("RefinedStonePieces"); buildPiece3.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece3.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece3.Prefab); BuildPiece buildPiece4 = new BuildPiece(_refinedBundle, "BRP_StoneArch4"); buildPiece4.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece4.Category.Set("RefinedStonePieces"); buildPiece4.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece4.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece4.Prefab); BuildPiece buildPiece5 = new BuildPiece(_refinedBundle, "BRP_StoneArch5"); buildPiece5.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece5.Category.Set("RefinedStonePieces"); buildPiece5.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece5.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece5.Prefab); BuildPiece buildPiece6 = new BuildPiece(_refinedBundle, "BRP_StoneArch6"); buildPiece6.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece6.Category.Set("RefinedStonePieces"); buildPiece6.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece6.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece6.Prefab); BuildPiece buildPiece7 = new BuildPiece(_refinedBundle, "BRP_StoneArch_Bottom"); buildPiece7.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece7.Category.Set("RefinedStonePieces"); buildPiece7.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece7.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece7.Prefab); BuildPiece buildPiece8 = new BuildPiece(_refinedBundle, "BRP_StoneArch_Inverted"); buildPiece8.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece8.Category.Set("RefinedStonePieces"); buildPiece8.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece8.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece8.Prefab); BuildPiece buildPiece9 = new BuildPiece(_refinedBundle, "BRP_StoneBase1"); buildPiece9.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece9.Category.Set("RefinedStonePieces"); buildPiece9.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece9.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece9.Prefab); BuildPiece buildPiece10 = new BuildPiece(_refinedBundle, "BRP_StoneBase2"); buildPiece10.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece10.Category.Set("RefinedStonePieces"); buildPiece10.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece10.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece10.Prefab); BuildPiece buildPiece11 = new BuildPiece(_refinedBundle, "BRP_StoneBase_Corner"); buildPiece11.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece11.Category.Set("RefinedStonePieces"); buildPiece11.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece11.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece11.Prefab); BuildPiece buildPiece12 = new BuildPiece(_refinedBundle, "BRP_StoneBeam1m"); buildPiece12.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece12.Category.Set("RefinedStonePieces"); buildPiece12.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece12.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece12.Prefab); BuildPiece buildPiece13 = new BuildPiece(_refinedBundle, "BRP_StoneBeam2m"); buildPiece13.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece13.Category.Set("RefinedStonePieces"); buildPiece13.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece13.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece13.Prefab); BuildPiece buildPiece14 = new BuildPiece(_refinedBundle, "BRP_StoneBlock1x1"); buildPiece14.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece14.Category.Set("RefinedStonePieces"); buildPiece14.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece14.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece14.Prefab); BuildPiece buildPiece15 = new BuildPiece(_refinedBundle, "BRP_StoneBlock2x1x1"); buildPiece15.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece15.Category.Set("RefinedStonePieces"); buildPiece15.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece15.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece15.Prefab); BuildPiece buildPiece16 = new BuildPiece(_refinedBundle, "BRP_StoneBlock2x2_Enforced"); buildPiece16.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece16.Category.Set("RefinedStonePieces"); buildPiece16.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece16.RequiredItems.Add("Copper", 2, recover: true); buildPiece16.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece16.Prefab); BuildPiece buildPiece17 = new BuildPiece(_refinedBundle, "BRP_StoneBlock2x2x1"); buildPiece17.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece17.Category.Set("RefinedStonePieces"); buildPiece17.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece17.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece17.Prefab); BuildPiece buildPiece18 = new BuildPiece(_refinedBundle, "BRP_StoneBlock2x2x2"); buildPiece18.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece18.Category.Set("RefinedStonePieces"); buildPiece18.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece18.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece18.Prefab); BuildPiece buildPiece19 = new BuildPiece(_refinedBundle, "BRP_StoneBlock_Out1"); buildPiece19.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece19.Category.Set("RefinedStonePieces"); buildPiece19.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece19.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece19.Prefab); BuildPiece buildPiece20 = new BuildPiece(_refinedBundle, "BRP_StoneBlock_Out2"); buildPiece20.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece20.Category.Set("RefinedStonePieces"); buildPiece20.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece20.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece20.Prefab); BuildPiece buildPiece21 = new BuildPiece(_refinedBundle, "BRP_StoneBlock_OutCorner"); buildPiece21.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece21.Category.Set("RefinedStonePieces"); buildPiece21.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece21.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece21.Prefab); BuildPiece buildPiece22 = new BuildPiece(_refinedBundle, "BRP_StoneBlock_Slope1x2"); buildPiece22.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece22.Category.Set("RefinedStonePieces"); buildPiece22.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece22.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece22.Prefab); BuildPiece buildPiece23 = new BuildPiece(_refinedBundle, "BRP_StoneBlock_SlopeInverted1x2"); buildPiece23.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece23.Category.Set("RefinedStonePieces"); buildPiece23.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece23.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece23.Prefab); BuildPiece buildPiece24 = new BuildPiece(_refinedBundle, "BRP_StoneChest"); buildPiece24.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece24.Category.Set("RefinedStonePieces"); buildPiece24.RequiredItems.Add("BRP_RefinedStone", 6, recover: true); buildPiece24.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece24.Prefab); BuildPiece buildPiece25 = new BuildPiece(_refinedBundle, "BRP_StoneColumn1"); buildPiece25.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece25.Category.Set("RefinedStonePieces"); buildPiece25.RequiredItems.Add("BRP_RefinedStone", 5, recover: true); buildPiece25.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece25.Prefab); BuildPiece buildPiece26 = new BuildPiece(_refinedBundle, "BRP_StoneColumn2"); buildPiece26.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece26.Category.Set("RefinedStonePieces"); buildPiece26.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece26.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece26.Prefab); BuildPiece buildPiece27 = new BuildPiece(_refinedBundle, "BRP_StoneCorgi"); buildPiece27.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece27.Category.Set("RefinedStonePieces"); buildPiece27.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece27.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece27.Prefab); BuildPiece buildPiece28 = new BuildPiece(_refinedBundle, "BRP_StoneDeco_Floor"); buildPiece28.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece28.Category.Set("RefinedStonePieces"); buildPiece28.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece28.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece28.Prefab); BuildPiece buildPiece29 = new BuildPiece(_refinedBundle, "BRP_StoneDeco_Wall2x2"); buildPiece29.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece29.Category.Set("RefinedStonePieces"); buildPiece29.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece29.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece29.Prefab); BuildPiece buildPiece30 = new BuildPiece(_refinedBundle, "BRP_StoneDeco_WallDivider"); buildPiece30.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece30.Category.Set("RefinedStonePieces"); buildPiece30.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece30.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece30.Prefab); BuildPiece buildPiece31 = new BuildPiece(_refinedBundle, "BRP_StoneDeco_WallTree"); buildPiece31.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece31.Category.Set("RefinedStonePieces"); buildPiece31.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece31.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece31.Prefab); BuildPiece buildPiece32 = new BuildPiece(_refinedBundle, "BRP_StoneDeer"); buildPiece32.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece32.Category.Set("RefinedStonePieces"); buildPiece32.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece32.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece32.Prefab); BuildPiece buildPiece33 = new BuildPiece(_refinedBundle, "BRP_StoneFloor1"); buildPiece33.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece33.Category.Set("RefinedStonePieces"); buildPiece33.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece33.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece33.Prefab); BuildPiece buildPiece34 = new BuildPiece(_refinedBundle, "BRP_StoneFloor_1x1"); buildPiece34.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece34.Category.Set("RefinedStonePieces"); buildPiece34.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece34.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece34.Prefab); BuildPiece buildPiece35 = new BuildPiece(_refinedBundle, "BRP_StoneFloor_2x2"); buildPiece35.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece35.Category.Set("RefinedStonePieces"); buildPiece35.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece35.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece35.Prefab); BuildPiece buildPiece36 = new BuildPiece(_refinedBundle, "BRP_StoneFloor_Large"); buildPiece36.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece36.Category.Set("RefinedStonePieces"); buildPiece36.RequiredItems.Add("BRP_RefinedStone", 6, recover: true); buildPiece36.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece36.Prefab); BuildPiece buildPiece37 = new BuildPiece(_refinedBundle, "BRP_StoneFloor_Triangle"); buildPiece37.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece37.Category.Set("RefinedStonePieces"); buildPiece37.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece37.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece37.Prefab); BuildPiece buildPiece38 = new BuildPiece(_refinedBundle, "BRP_StoneHalfWall_1x2"); buildPiece38.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece38.Category.Set("RefinedStonePieces"); buildPiece38.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece38.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece38.Prefab); BuildPiece buildPiece39 = new BuildPiece(_refinedBundle, "BRP_StoneHare"); buildPiece39.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece39.Category.Set("RefinedStonePieces"); buildPiece39.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece39.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece39.Prefab); BuildPiece buildPiece40 = new BuildPiece(_refinedBundle, "BRP_StoneHead1"); buildPiece40.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece40.Category.Set("RefinedStonePieces"); buildPiece40.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece40.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece40.Prefab); BuildPiece buildPiece41 = new BuildPiece(_refinedBundle, "BRP_StoneHead2"); buildPiece41.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece41.Category.Set("RefinedStonePieces"); buildPiece41.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece41.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece41.Prefab); BuildPiece buildPiece42 = new BuildPiece(_refinedBundle, "BRP_StoneLadder"); buildPiece42.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece42.Category.Set("RefinedStonePieces"); buildPiece42.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece42.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece42.Prefab); BuildPiece buildPiece43 = new BuildPiece(_refinedBundle, "BRP_StonePillar1"); buildPiece43.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece43.Category.Set("RefinedStonePieces"); buildPiece43.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece43.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece43.Prefab); BuildPiece buildPiece44 = new BuildPiece(_refinedBundle, "BRP_StonePillar_Arch"); buildPiece44.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece44.Category.Set("RefinedStonePieces"); buildPiece44.RequiredItems.Add("BRP_RefinedStone", 6, recover: true); buildPiece44.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece44.Prefab); BuildPiece buildPiece45 = new BuildPiece(_refinedBundle, "BRP_StonePillar_ArchSmall"); buildPiece45.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece45.Category.Set("RefinedStonePieces"); buildPiece45.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece45.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece45.Prefab); BuildPiece buildPiece46 = new BuildPiece(_refinedBundle, "BRP_StonePillar_BaseMedium"); buildPiece46.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece46.Category.Set("RefinedStonePieces"); buildPiece46.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece46.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece46.Prefab); BuildPiece buildPiece47 = new BuildPiece(_refinedBundle, "BRP_StonePillar_BaseSmall"); buildPiece47.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece47.Category.Set("RefinedStonePieces"); buildPiece47.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece47.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece47.Prefab); BuildPiece buildPiece48 = new BuildPiece(_refinedBundle, "BRP_StonePillar_BaseTapered"); buildPiece48.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece48.Category.Set("RefinedStonePieces"); buildPiece48.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece48.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece48.Prefab); BuildPiece buildPiece49 = new BuildPiece(_refinedBundle, "BRP_StonePillar_BaseTapered_Inverted"); buildPiece49.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece49.Category.Set("RefinedStonePieces"); buildPiece49.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece49.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece49.Prefab); BuildPiece buildPiece50 = new BuildPiece(_refinedBundle, "BRP_StonePillar_BeamMedium"); buildPiece50.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece50.Category.Set("RefinedStonePieces"); buildPiece50.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece50.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece50.Prefab); BuildPiece buildPiece51 = new BuildPiece(_refinedBundle, "BRP_StonePillar_BeamSmall"); buildPiece51.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece51.Category.Set("RefinedStonePieces"); buildPiece51.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece51.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece51.Prefab); BuildPiece buildPiece52 = new BuildPiece(_refinedBundle, "BRP_StonePole1m"); buildPiece52.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece52.Category.Set("RefinedStonePieces"); buildPiece52.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece52.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece52.Prefab); BuildPiece buildPiece53 = new BuildPiece(_refinedBundle, "BRP_StonePole2m"); buildPiece53.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece53.Category.Set("RefinedStonePieces"); buildPiece53.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece53.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece53.Prefab); BuildPiece buildPiece54 = new BuildPiece(_refinedBundle, "BRP_StoneQuarterWall_1x1"); buildPiece54.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece54.Category.Set("RefinedStonePieces"); buildPiece54.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece54.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece54.Prefab); BuildPiece buildPiece55 = new BuildPiece(_refinedBundle, "BRP_StoneRoof26"); buildPiece55.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece55.Category.Set("RefinedStonePieces"); buildPiece55.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece55.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece55.Prefab); BuildPiece buildPiece56 = new BuildPiece(_refinedBundle, "BRP_StoneRoof45"); buildPiece56.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece56.Category.Set("RefinedStonePieces"); buildPiece56.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece56.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece56.Prefab); BuildPiece buildPiece57 = new BuildPiece(_refinedBundle, "BRP_StoneRoof_ICorner26"); buildPiece57.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece57.Category.Set("RefinedStonePieces"); buildPiece57.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece57.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece57.Prefab); BuildPiece buildPiece58 = new BuildPiece(_refinedBundle, "BRP_StoneRoof_ICorner45"); buildPiece58.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece58.Category.Set("RefinedStonePieces"); buildPiece58.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece58.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece58.Prefab); BuildPiece buildPiece59 = new BuildPiece(_refinedBundle, "BRP_StoneRoof_OCorner26"); buildPiece59.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece59.Category.Set("RefinedStonePieces"); buildPiece59.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece59.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece59.Prefab); BuildPiece buildPiece60 = new BuildPiece(_refinedBundle, "BRP_StoneRoof_OCorner45"); buildPiece60.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece60.Category.Set("RefinedStonePieces"); buildPiece60.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece60.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece60.Prefab); BuildPiece buildPiece61 = new BuildPiece(_refinedBundle, "BRP_StoneRoof_Top26"); buildPiece61.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece61.Category.Set("RefinedStonePieces"); buildPiece61.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece61.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece61.Prefab); BuildPiece buildPiece62 = new BuildPiece(_refinedBundle, "BRP_StoneRoof_Top45"); buildPiece62.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece62.Category.Set("RefinedStonePieces"); buildPiece62.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece62.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece62.Prefab); BuildPiece buildPiece63 = new BuildPiece(_refinedBundle, "BRP_StoneRoundDoor"); buildPiece63.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece63.Category.Set("RefinedStonePieces"); buildPiece63.RequiredItems.Add("BRP_RefinedStone", 6, recover: true); buildPiece63.RequiredItems.Add("Copper", 10, recover: true); buildPiece63.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece63.Prefab); BuildPiece buildPiece64 = new BuildPiece(_refinedBundle, "BRP_StoneStair1"); buildPiece64.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece64.Category.Set("RefinedStonePieces"); buildPiece64.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece64.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece64.Prefab); BuildPiece buildPiece65 = new BuildPiece(_refinedBundle, "BRP_StoneStair2"); buildPiece65.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece65.Category.Set("RefinedStonePieces"); buildPiece65.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece65.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece65.Prefab); BuildPiece buildPiece66 = new BuildPiece(_refinedBundle, "BRP_StoneTile_Floor1x1"); buildPiece66.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece66.Category.Set("RefinedStonePieces"); buildPiece66.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece66.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece66.Prefab); BuildPiece buildPiece67 = new BuildPiece(_refinedBundle, "BRP_StoneTile_Floor2x2"); buildPiece67.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece67.Category.Set("RefinedStonePieces"); buildPiece67.RequiredItems.Add("BRP_RefinedStone", 5, recover: true); buildPiece67.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece67.Prefab); BuildPiece buildPiece68 = new BuildPiece(_refinedBundle, "BRP_StoneTile_Wall1x1"); buildPiece68.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece68.Category.Set("RefinedStonePieces"); buildPiece68.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece68.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece68.Prefab); BuildPiece buildPiece69 = new BuildPiece(_refinedBundle, "BRP_StoneTile_Wall2x2"); buildPiece69.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece69.Category.Set("RefinedStonePieces"); buildPiece69.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece69.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece69.Prefab); BuildPiece buildPiece70 = new BuildPiece(_refinedBundle, "BRP_StoneTile_Wall2x4"); buildPiece70.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece70.Category.Set("RefinedStonePieces"); buildPiece70.RequiredItems.Add("BRP_RefinedStone", 3, recover: true); buildPiece70.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece70.Prefab); BuildPiece buildPiece71 = new BuildPiece(_refinedBundle, "BRP_StoneTip"); buildPiece71.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece71.Category.Set("RefinedStonePieces"); buildPiece71.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece71.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece71.Prefab); BuildPiece buildPiece72 = new BuildPiece(_refinedBundle, "BRP_StoneWall1x2"); buildPiece72.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece72.Category.Set("RefinedStonePieces"); buildPiece72.RequiredItems.Add("BRP_RefinedStone", 5, recover: true); buildPiece72.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece72.Prefab); BuildPiece buildPiece73 = new BuildPiece(_refinedBundle, "BRP_StoneWall2x2"); buildPiece73.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece73.Category.Set("RefinedStonePieces"); buildPiece73.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece73.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece73.Prefab); BuildPiece buildPiece74 = new BuildPiece(_refinedBundle, "BRP_StoneWall4x2"); buildPiece74.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece74.Category.Set("RefinedStonePieces"); buildPiece74.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece74.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece74.Prefab); BuildPiece buildPiece75 = new BuildPiece(_refinedBundle, "BRP_StoneWall_2x2"); buildPiece75.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece75.Category.Set("RefinedStonePieces"); buildPiece75.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece75.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece75.Prefab); BuildPiece buildPiece76 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Beam26"); buildPiece76.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece76.Category.Set("RefinedStonePieces"); buildPiece76.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece76.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece76.Prefab); BuildPiece buildPiece77 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Beam26Alt"); buildPiece77.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece77.Category.Set("RefinedStonePieces"); buildPiece77.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece77.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece77.Prefab); BuildPiece buildPiece78 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Beam45"); buildPiece78.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece78.Category.Set("RefinedStonePieces"); buildPiece78.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece78.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece78.Prefab); BuildPiece buildPiece79 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Beam45Alt"); buildPiece79.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece79.Category.Set("RefinedStonePieces"); buildPiece79.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece79.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece79.Prefab); BuildPiece buildPiece80 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Cross26"); buildPiece80.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece80.Category.Set("RefinedStonePieces"); buildPiece80.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece80.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece80.Prefab); BuildPiece buildPiece81 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Cross26Alt"); buildPiece81.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece81.Category.Set("RefinedStonePieces"); buildPiece81.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece81.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece81.Prefab); BuildPiece buildPiece82 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Cross45"); buildPiece82.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece82.Category.Set("RefinedStonePieces"); buildPiece82.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece82.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece82.Prefab); BuildPiece buildPiece83 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Cross45Alt"); buildPiece83.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece83.Category.Set("RefinedStonePieces"); buildPiece83.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece83.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece83.Prefab); BuildPiece buildPiece84 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Roof26"); buildPiece84.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece84.Category.Set("RefinedStonePieces"); buildPiece84.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece84.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece84.Prefab); BuildPiece buildPiece85 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Roof26_UpsideDown"); buildPiece85.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece85.Category.Set("RefinedStonePieces"); buildPiece85.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece85.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece85.Prefab); BuildPiece buildPiece86 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Roof45"); buildPiece86.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece86.Category.Set("RefinedStonePieces"); buildPiece86.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece86.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece86.Prefab); BuildPiece buildPiece87 = new BuildPiece(_refinedBundle, "BRP_StoneWall_Roof45_UpsideDown"); buildPiece87.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece87.Category.Set("RefinedStonePieces"); buildPiece87.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece87.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece87.Prefab); BuildPiece buildPiece88 = new BuildPiece(_refinedBundle, "BRP_StoneWindow2x2"); buildPiece88.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece88.Category.Set("RefinedStonePieces"); buildPiece88.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece88.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece88.Prefab); BuildPiece buildPiece89 = new BuildPiece(_refinedBundle, "BRP_StoneWindow4x2"); buildPiece89.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece89.Category.Set("RefinedStonePieces"); buildPiece89.RequiredItems.Add("BRP_RefinedStone", 6, recover: true); buildPiece89.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece89.Prefab); BuildPiece buildPiece90 = new BuildPiece(_refinedBundle, "BRP_SturdyStone_Roof45"); buildPiece90.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece90.Category.Set("RefinedStonePieces"); buildPiece90.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece90.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece90.Prefab); BuildPiece buildPiece91 = new BuildPiece(_refinedBundle, "BRP_SturdyStone_Roof45_Corner"); buildPiece91.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece91.Category.Set("RefinedStonePieces"); buildPiece91.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece91.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece91.Prefab); BuildPiece buildPiece92 = new BuildPiece(_refinedBundle, "BRP_SturdyStone_Roof45_Corner2"); buildPiece92.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece92.Category.Set("RefinedStonePieces"); buildPiece92.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece92.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece92.Prefab); BuildPiece buildPiece93 = new BuildPiece(_refinedBundle, "BRP_SturdyStone_Roof45Arch"); buildPiece93.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece93.Category.Set("RefinedStonePieces"); buildPiece93.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece93.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece93.Prefab); BuildPiece buildPiece94 = new BuildPiece(_refinedBundle, "BRP_SturdyStone_Roof45Arch_Corner"); buildPiece94.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece94.Category.Set("RefinedStonePieces"); buildPiece94.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece94.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece94.Prefab); BuildPiece buildPiece95 = new BuildPiece(_refinedBundle, "BRP_SturdyStone_Roof45Arch_Corner2"); buildPiece95.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece95.Category.Set("RefinedStonePieces"); buildPiece95.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece95.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece95.Prefab); BuildPiece buildPiece96 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_Stack"); buildPiece96.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece96.Category.Set("RefinedStonePieces"); buildPiece96.RequiredItems.Add("BRP_RefinedStone", 50, recover: true); buildPiece96.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece96.Prefab); BuildPiece buildPiece97 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_Floor1x1"); buildPiece97.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece97.Category.Set("RefinedStonePieces"); buildPiece97.RequiredItems.Add("BRP_RefinedStone", 1, recover: true); buildPiece97.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece97.Prefab); BuildPiece buildPiece98 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_Floor2x2"); buildPiece98.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece98.Category.Set("RefinedStonePieces"); buildPiece98.RequiredItems.Add("BRP_RefinedStone", 2, recover: true); buildPiece98.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece98.Prefab); BuildPiece buildPiece99 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_Floor4x4"); buildPiece99.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece99.Category.Set("RefinedStonePieces"); buildPiece99.RequiredItems.Add("BRP_RefinedStone", 4, recover: true); buildPiece99.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece99.Prefab); BuildPiece buildPiece100 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_Hearth"); buildPiece100.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece100.Category.Set("RefinedStonePieces"); buildPiece100.RequiredItems.Add("BRP_RefinedStone", 15, recover: true); buildPiece100.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece100.Prefab); BuildPiece buildPiece101 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_HexagonalDoor"); buildPiece101.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece101.Category.Set("RefinedStonePieces"); buildPiece101.RequiredItems.Add("BRP_RefinedStone", 18, recover: true); buildPiece101.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece101.Prefab); BuildPiece buildPiece102 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_SpiralStair"); buildPiece102.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece102.Category.Set("RefinedStonePieces"); buildPiece102.RequiredItems.Add("BRP_RefinedStone", 8, recover: true); buildPiece102.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece102.Prefab); BuildPiece buildPiece103 = new BuildPiece(_refinedBundle, "BRP_RefinedStone_SpiralStair_Right"); buildPiece103.Crafting.Set(PieceManager.CraftingTable.StoneCutter); buildPiece103.Category.Set("RefinedStonePieces"); buildPiece103.RequiredItems.Add("BRP_RefinedStone", 8, recover: true); buildPiece103.SpecialProperties = new SpecialProperties { AdminOnly = false, NoConfig = false }; ShaderReplacer.Replace(buildPiece103.Prefab); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_build_hammer_stone"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_chest_close"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_chest_open"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_darkwood_door_close"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_darkwood_door_open"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_rock_destroyed"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_sfx_rock_hit"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_vfx_MarbleDestroyed"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_vfx_MarbleHit"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_vfx_Place_stone_floor"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_vfx_Place_stone_wall_2x1"); PrefabManager.RegisterPrefab(_refinedBundle, "brp_vfx_SawDust"); } } public enum Toggle { On = 1, Off = 0 } } namespace ItemManager { [PublicAPI] public enum CraftingTable { Disabled, Inventory, [InternalName("piece_workbench")] Workbench, [InternalName("piece_cauldron")] Cauldron, [InternalName("forge")] Forge, [InternalName("piece_artisanstation")] ArtisanTable, [InternalName("piece_stonecutter")] StoneCutter, [InternalName("piece_magetable")] MageTable, [InternalName("blackforge")] BlackForge, Custom } [PublicAPI] public enum ConversionPiece { Disabled, [InternalName("smelter")] Smelter, [InternalName("charcoal_kiln")] CharcoalKiln, [InternalName("blastfurnace")] BlastFurnace, [InternalName("windmill")] Windmill, [InternalName("piece_spinningwheel")] SpinningWheel, [InternalName("eitrrefinery")] EitrRefinery, Custom } public class InternalName : Attribute { public readonly string internalName; public InternalName(string internalName) { this.internalName = internalName; } } [PublicAPI] public class RequiredResourceList { public readonly List<Requirement> Requirements = new List<Requirement>(); public bool Free; public void Add(string itemName, int amount, int quality = 0) { Requirements.Add(new Requirement { itemName = itemName, amount = amount, quality = quality }); } public void Add(string itemName, ConfigEntry<int> amountConfig, int quality = 0) { Requirements.Add(new Requirement { itemName = itemName, amountConfig = amountConfig, quality = quality }); } } [PublicAPI] public class CraftingStationList { public readonly List<CraftingStationConfig> Stations = new List<CraftingStationConfig>(); public void Add(CraftingTable table, int level) { Stations.Add(new CraftingStationConfig { Table = table, level = level }); } public void Add(string customTable, int level) { Stations.Add(new CraftingStationConfig { Table = CraftingTable.Custom, level = level, custom = customTable }); } } [PublicAPI] public class ItemRecipe { public readonly RequiredResourceList RequiredItems = new RequiredResourceList(); public readonly RequiredResourceList RequiredUpgradeItems = new RequiredResourceList(); public readonly CraftingStationList Crafting = new CraftingStationList(); public int CraftAmount = 1; public bool RequireOnlyOneIngredient; public float QualityResultAmountMultiplier = 1f; public ConfigEntryBase? RecipeIsActive; } [PublicAPI] public class Trade { public Trader Trader; public uint Price; public uint Stack = 1u; public string? RequiredGlobalKey; } [PublicAPI] [Flags] public enum Trader { None = 0, Haldor = 1, Hildir = 2 } public struct Requirement { public string itemName; public int amount; public ConfigEntry<int>? amountConfig; [Description("Set to a non-zero value to apply the requirement only for a specific quality")] public int quality; } public struct CraftingStationConfig { public CraftingTable Table; public int level; public string? custom; } [Flags] public enum Configurability { Disabled = 0, Recipe = 1, Stats = 2, Drop = 4, Trader = 8, Full = 0xF } [PublicAPI] public class DropTargets { public readonly List<DropTarget> Drops = new List<DropTarget>(); public void Add(string creatureName, float chance, int min = 1, int? max = null, bool levelMultiplier = true) { Drops.Add(new DropTarget { creature = creatureName, chance = chance, min = min, max = (max ?? min), levelMultiplier = levelMultiplier }); } } public struct DropTarget { public string creature; public int min; public int max; public float chance; public bool levelMultiplier; } public enum Toggle { On = 1, Off = 0 } [PublicAPI] public class Item { private class ItemConfig { public ConfigEntry<string>? craft; public ConfigEntry<string>? upgrade; public ConfigEntry<CraftingTable> table; public ConfigEntry<int> tableLevel; public ConfigEntry<string> customTable; public ConfigEntry<int>? maximumTableLevel; public ConfigEntry<Toggle> requireOneIngredient; public ConfigEntry<float> qualityResultAmountMultiplier; } private class TraderConfig { public ConfigEntry<Trader> trader; public ConfigEntry<uint> price; public ConfigEntry<uint> stack; public ConfigEntry<string> requiredGlobalKey; } private class RequirementQuality { public int quality; } private class ConfigurationManagerAttributes { [UsedImplicitly] public int? Order; [UsedImplicitly] public bool? Browsable; [UsedImplicitly] public string? Category; [UsedImplicitly] public Action<ConfigEntryBase>? CustomDrawer; public Func<bool>? browsability; } [PublicAPI] public enum DamageModifier { Normal, Resistant, Weak, Immune, Ignore, VeryResistant, VeryWeak, None } private delegate void setDmgFunc(ref DamageTypes dmg, float value); private class SerializedRequirements { public readonly List<Requirement> Reqs; public SerializedRequirements(List<Requirement> reqs) { Reqs = reqs; } public SerializedRequirements(string reqs) : this(reqs.Split(new char[1] { ',' }).Select(delegate(string r) { string[] array = r.Split(new char[1] { ':' }); Requirement result = default(Requirement); result.itemName = array[0]; result.amount = ((array.Length <= 1 || !int.TryParse(array[1], out var result2)) ? 1 : result2); result.quality = ((array.Length > 2 && int.TryParse(array[2], out var result3)) ? result3 : 0); return result; }).ToList()) { } public override string ToString() { return string.Join(",", Reqs.Select((Requirement r) => $"{r.itemName}:{r.amount}" + ((r.quality > 0) ? $":{r.quality}" : ""))); } public static ItemDrop? fetchByName(ObjectDB objectDB, string name) { GameObject itemPrefab = objectDB.GetItemPrefab(name); ItemDrop obj = ((itemPrefab != null) ? itemPrefab.GetComponent<ItemDrop>() : null); if ((Object)(object)obj == (Object)null) { Debug.LogWarning((object)("The required item '" + name + "' does not exist.")); } return obj; } public static Requirement[] toPieceReqs(ObjectDB objectDB, SerializedRequirements craft, SerializedRequirements upgrade) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_0194: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown Dictionary<string, Requirement> dictionary = craft.Reqs.Where((Requirement r) => r.itemName != "").ToDictionary((Func<Requirement, string>)((Requirement r) => r.itemName), (Func<Requirement, Requirement>)delegate(Requirement r) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown ItemDrop val6 = ResItem(r); return (val6 != null) ? new Requirement { m_amount = (r.amountConfig?.Value ?? r.amount), m_resItem = val6, m_amountPerLevel = 0 } : ((Requirement)null); }); List<Requirement> list = dictionary.Values.Where((Requirement v) => v != null).ToList(); foreach (Requirement item in upgrade.Reqs.Where((Requirement r) => r.itemName != "")) { if (item.quality > 0) { ItemDrop val = ResItem(item); if (val != null) { Requirement val2 = new Requirement { m_resItem = val, m_amountPerLevel = (item.amountConfig?.Value ?? item.amount), m_amount = 0 }; list.Add(val2); requirementQuality.Add(val2, new RequirementQuality { quality = item.quality }); } continue; } if (!dictionary.TryGetValue(item.itemName, out var value) || value == null) { ItemDrop val3 = ResItem(item); if (val3 != null) { string itemName = item.itemName; Requirement val4 = new Requirement { m_resItem = val3, m_amount = 0 }; Requirement val5 = val4; dictionary[itemName] = val4; value = val5; list.Add(value); } } if (value != null) { value.m_amountPerLevel = item.amountConfig?.Value ?? item.amount; } } return list.ToArray(); ItemDrop? ResItem(Requirement r) { return fetchByName(objectDB, r.itemName); } } } private class SerializedDrop { public readonly List<DropTarget> Drops; public SerializedDrop(List<DropTarget> drops) { Drops = drops; } public SerializedDrop(string drops) { Drops = ((drops == "") ? ((IEnumerable<string>)Array.Empty<string>()) : ((IEnumerable<string>)drops.Split(new char[1] { ',' }))).Select(delegate(string r) { string[] array = r.Split(new char[1] { ':' }); if (array.Length <= 2 || !int.TryParse(array[2], out var result)) { result = 1; } if (array.Length <= 3 || !int.TryParse(array[3], out var result2)) { result2 = result; } bool levelMultiplier = array.Length <= 4 || array[4] != "0"; DropTarget result3 = default(DropTarget); result3.creature = array[0]; result3.chance = ((array.Length > 1 && float.TryParse(array[1], out var result4)) ? result4 : 1f); result3.min = result; result3.max = result2; result3.levelMultiplier = levelMultiplier; return result3; }).ToList(); } public override string ToString() { return string.Join(",", Drops.Select((DropTarget r) => $"{r.creature}:{r.chance.ToString(CultureInfo.InvariantCulture)}:{r.min}:" + ((r.min == r.max) ? "" : $"{r.max}") + (r.levelMultiplier ? "" : ":0"))); } private static Character? fetchByName(ZNetScene netScene, string name) { GameObject prefab = netScene.GetPrefab(name); Character obj = ((prefab != null) ? prefab.GetComponent<Character>() : null); if ((Object)(object)obj == (Object)null) { Debug.LogWarning((object)("The drop target character '" + name + "' does not exist.")); } return obj; } public Dictionary<Character, Drop> toCharacterDrops(ZNetScene netScene, GameObject item) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown Dictionary<Character, Drop> dictionary = new Dictionary<Character, Drop>(); foreach (DropTarget drop in Drops) { Character val = fetchByName(netScene, drop.creature); if (val != null) { dictionary[val] = new Drop { m_prefab = item, m_amountMin = drop.min, m_amountMax = drop.max, m_chance = drop.chance, m_levelMultiplier = drop.levelMultiplier }; } } return dictionary; } } private static readonly List<Item> registeredItems = new List<Item>(); private static readonly Dictionary<ItemDrop, Item> itemDropMap = new Dictionary<ItemDrop, Item>(); private static Dictionary<Item, Dictionary<string, List<Recipe>>> activeRecipes = new Dictionary<Item, Dictionary<string, List<Recipe>>>(); private static Dictionary<Recipe, ConfigEntryBase?> hiddenCraftRecipes = new Dictionary<Recipe, ConfigEntryBase>(); private static Dictionary<Recipe, ConfigEntryBase?> hiddenUpgradeRecipes = new Dictionary<Recipe, ConfigEntryBase>(); private static Dictionary<Item, Dictionary<string, ItemConfig>> itemCraftConfigs = new Dictionary<Item, Dictionary<string, ItemConfig>>(); private static Dictionary<Item, ConfigEntry<string>> itemDropConfigs = new Dictionary<Item, ConfigEntry<string>>(); private Dictionary<CharacterDrop, Drop> characterDrops = new Dictionary<CharacterDrop, Drop>(); private readonly Dictionary<ConfigEntryBase, Action> statsConfigs = new Dictionary<ConfigEntryBase, Action>(); private static readonly ConditionalWeakTable<Requirement, RequirementQuality> requirementQuality = new ConditionalWeakTable<Requirement, RequirementQuality>(); public static Configurability DefaultConfigurability = Configurability.Full; public Configurability? Configurable; private Configurability configurationVisible = Configurability.Full; private TraderConfig? traderConfig; public readonly GameObject Prefab; [Description("Specifies the maximum required crafting station level to upgrade and repair the item.\nDefault is calculated from crafting station level and maximum quality.")] public int MaximumRequiredStationLevel = int.MaxValue; [Description("Assigns the item as a drop item to a creature.\nUses a creature name, a drop chance and a minimum and maximum amount.")] public readonly DropTargets DropsFrom = new DropTargets(); [Description("Configures whether the item can be bought at the trader.\nDon't forget to set cost to something above 0 or the item will be sold for free.")] public readonly Trade Trade = new Trade(); internal List<Conversion> Conversions = new List<Conversion>(); internal List<ItemConversion> conversions = new List<ItemConversion>(); public Dictionary<string, ItemRecipe> Recipes = new Dictionary<string, ItemRecipe>(); private LocalizeKey? _name; private LocalizeKey? _description; private static object? configManager; private static Localization? _english; private static BaseUnityPlugin? _plugin; private static bool hasConfigSync = true; private static object? _configSync; private Configurability configurability => Configurable ?? DefaultConfigurability; [Description("Specifies the resources needed to craft the item.\nUse .Add to add resources with their internal ID and an amount.\nUse one .Add for each resource type the item should need.")] public RequiredResourceList RequiredItems => this[""].RequiredItems; [Description("Specifies the resources needed to upgrade the item.\nUse .Add to add resources with their internal ID and an amount. This amount will be multipled by the item quality level.\nUse one .Add for each resource type the upgrade should need.")] public RequiredResourceList RequiredUpgradeItems => this[""].RequiredUpgradeItems; [Description("Specifies the crafting station needed to craft the item.\nUse .Add to add a crafting station, using the CraftingTable enum and a minimum level for the crafting station.\nUse one .Add for each crafting station.")] public CraftingStationList Crafting => this[""].Crafting; [Description("Specifies a config entry which toggles whether a recipe is active.")] public ConfigEntryBase? RecipeIsActive { get { return this[""].RecipeIsActive; } set { this[""].RecipeIsActive = value; } } [Description("Specifies the number of items that should be given to the player with a single craft of the item.\nDefaults to 1.")] public int CraftAmount { get { return this[""].CraftAmount; } set { this[""].CraftAmount = value; } } public bool RequireOnlyOneIngredient { get { return this[""].RequireOnlyOneIngredient; } set { this[""].RequireOnlyOneIngredient = value; } } public float QualityResultAmountMultiplier { get { return this[""].QualityResultAmountMultiplier; } set { this[""].QualityResultAmountMultiplier = value; } } public ItemRecipe this[string name] { get { if (Recipes.TryGetValue(name, out var value)) { return value; } return Recipes[name] = new ItemRecipe(); } } public LocalizeKey Name { get { LocalizeKey name = _name; if (name != null) { return name; } SharedData shared = Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; if (shared.m_name.StartsWith("$")) { _name = new LocalizeKey(shared.m_name); } else { string text = "$item_" + ((Object)Prefab).name.Replace(" ", "_"); _name = new LocalizeKey(text).English(shared.m_name); shared.m_name = text; } return _name; } } public LocalizeKey Description { get { LocalizeKey description = _description; if (description != null) { return description; } SharedData shared = Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; if (shared.m_description.StartsWith("$")) { _description = new LocalizeKey(shared.m_description); } else { string text = "$itemdesc_" + ((Object)Prefab).name.Replace(" ", "_"); _description = new LocalizeKey(text).English(shared.m_description); shared.m_description = text; } return _description; } } private static Localization english => _english ?? (_english = LocalizationCache.ForLanguage("English")); private static BaseUnityPlugin plugin { get { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown if (_plugin == null) { IEnumerable<TypeInfo> source; try { source = Assembly.GetExecutingAssembly().DefinedTypes.ToList(); } catch (ReflectionTypeLoadException ex) { source = from t in ex.Types where t != null select t.GetTypeInfo(); } _plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First((TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t))); } return _plugin; } } private static object? configSync { get { if (_configSync == null && hasConfigSync) { Type type = Assembly.GetExecutingAssembly().GetType("ServerSync.ConfigSync"); if ((object)type != null) { _configSync = Activator.CreateInstance(type, plugin.Info.Metadata.GUID + " ItemManager"); type.GetField("CurrentVersion").SetValue(_configSync, plugin.Info.Metadata.Version.ToString()); type.GetProperty("IsLocked").SetValue(_configSync, true); } else { hasConfigSync = false; } } return _configSync; } } public Item(string assetBundleFileName, string prefabName, string folderName = "assets") : this(PrefabManager.RegisterAssetBundle(assetBundleFileName, folderName), prefabName) { } public Item(AssetBundle bundle, string prefabName) : this(PrefabManager.RegisterPrefab(bundle, prefabName, addToObjectDb: true), skipRegistering: true) { } public Item(GameObject prefab, bool skipRegistering = false) { if (!skipRegistering) { PrefabManager.RegisterPrefab(prefab, addToObjectDb: true); } Prefab = prefab; registeredItems.Add(this); itemDropMap[Prefab.GetComponent<ItemDrop>()] = this; Prefab.GetComponent<ItemDrop>().m_itemData.m_dropPrefab = Prefab; } public void ToggleConfigurationVisibility(Configurability visible) { configurationVisible = visible; if (itemDropConfigs.TryGetValue(this, out var value)) { Toggle((ConfigEntryBase)(object)value, Configurability.Drop); } if (itemCraftConfigs.TryGetValue(this, out var value2)) { foreach (ItemConfig value4 in value2.Values) { ToggleObj(value4, Configurability.Recipe); } } foreach (Conversion conversion in Conversions) { if (conversion.config != null) { ToggleObj(conversion.config, Configurability.Recipe); } } foreach (KeyValuePair<ConfigEntryBase, Action> statsConfig in statsConfigs) { Toggle(statsConfig.Key, Configurability.Stats); if ((visible & Configurability.Stats) != 0) { statsConfig.Value(); } } reloadConfigDisplay(); void Toggle(ConfigEntryBase cfg, Configurability check) { object[] tags = cfg.Description.Tags; for (int j = 0; j < tags.Length; j++) { if (tags[j] is ConfigurationManagerAttributes configurationManagerAttributes) { configurationManagerAttributes.Browsable = (visible & check) != 0 && (configurationManagerAttributes.browsability == null || configurationManagerAttributes.browsability()); } } } void ToggleObj(object obj, Configurability check) { FieldInfo[] fields = obj.GetType().GetFields(); for (int i = 0; i < fields.Length; i++) { object? value3 = fields[i].GetValue(obj); ConfigEntryBase val = (ConfigEntryBase)((value3 is ConfigEntryBase) ? value3 : null); if (val != null) { Toggle(val, check); } } } } internal static void reloadConfigDisplay() { object obj = configManager?.GetType().GetProperty("DisplayingWindow").GetValue(configManager); if (obj is bool && (bool)obj) { configManager.GetType().GetMethod("BuildSettingList").Invoke(configManager, Array.Empty<object>()); } } private void UpdateItemTableConfig(string recipeKey, CraftingTable table, string customTableValue) { if (activeRecipes.ContainsKey(this) && activeRecipes[this].TryGetValue(recipeKey, out var value)) { value.First().m_enabled = table != CraftingTable.Disabled; if ((uint)table <= 1u) { value.First().m_craftingStation = null; } else if (table == CraftingTable.Custom) { Recipe obj = value.First(); GameObject prefab = ZNetScene.instance.GetPrefab(customTableValue); obj.m_craftingStation = ((prefab != null) ? prefab.GetComponent<CraftingStation>() : null); } else { value.First().m_craftingStation = ZNetScene.instance.GetPrefab(getInternalName(table)).GetComponent<CraftingStation>(); } } } private void UpdateCraftConfig(string recipeKey, SerializedRequirements craftRequirements, SerializedRequirements upgradeRequirements) { if (!Object.op_Implicit((Object)(object)ObjectDB.instance) || !activeRecipes.ContainsKey(this) || !activeRecipes[this].TryGetValue(recipeKey, out var value)) { return; } foreach (Recipe item in value) { item.m_resources = SerializedRequirements.toPieceReqs(ObjectDB.instance, craftRequirements, upgradeRequirements); } } internal static void Patch_FejdStartup() { //IL_0e99: Unknown result type (might be due to invalid IL or missing references) //IL_0e9e: Unknown result type (might be due to invalid IL or missing references) //IL_2164: Unknown result type (might be due to invalid IL or missing references) //IL_216e: Expected O, but got Unknown //IL_0f62: Unknown result type (might be due to invalid IL or missing references) //IL_0f65: Unknown result type (might be due to invalid IL or missing references) //IL_0fbb: Expected I4, but got Unknown //IL_0b88: Unknown result type (might be due to invalid IL or missing references) //IL_0b92: Expected O, but got Unknown //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Expected O, but got Unknown //IL_10ef: Unknown result type (might be due to invalid IL or missing references) //IL_10f2: Unknown result type (might be due to invalid IL or missing references) //IL_10f4: Invalid comparison between Unknown and I4 //IL_10f6: Unknown result type (might be due to invalid IL or missing references) //IL_10fa: Invalid comparison between Unknown and I4 //IL_0cab: Unknown result type (might be due to invalid IL or missing references) //IL_0cb5: Expected O, but got Unknown //IL_0d56: Unknown result type (might be due to invalid IL or missing references) //IL_0d60: Expected O, but got Unknown //IL_10fc: Unknown result type (might be due to invalid IL or missing references) //IL_1100: Invalid comparison between Unknown and I4 //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Expected O, but got Unknown //IL_0e0a: Unknown result type (might be due to invalid IL or missing references) //IL_0e14: Expected O, but got Unknown //IL_12fb: Unknown result type (might be due to invalid IL or missing references) //IL_12fe: Unknown result type (might be due to invalid IL or missing references) //IL_1300: Invalid comparison between Unknown and I4 //IL_1302: Unknown result type (might be due to invalid IL or missing references) //IL_1306: Unknown result type (might be due to invalid IL or missing references) //IL_1308: Invalid comparison between Unknown and I4 //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Expected O, but got Unknown //IL_130a: Unknown result type (might be due to invalid IL or missing references) //IL_130e: Invalid comparison between Unknown and I4 //IL_13e3: Unknown result type (might be due to invalid IL or missing references) //IL_13e8: Unknown result type (might be due to invalid IL or missing references) //IL_13ea: Unknown result type (might be due to invalid IL or missing references) //IL_13ed: Invalid comparison between Unknown and I4 //IL_13ef: Unknown result type (might be due to invalid IL or missing references) //IL_13f3: Invalid comparison between Unknown and I4 //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Expected O, but got Unknown //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Expected O, but got Unknown //IL_1462: Unknown result type (might be due to invalid IL or missing references) //IL_1465: Unknown result type (might be due to invalid IL or missing references) //IL_1467: Invalid comparison between Unknown and I4 //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Expected O, but got Unknown //IL_1469: Unknown result type (might be due to invalid IL or missing references) //IL_146d: Unknown result type (might be due to invalid IL or missing references) //IL_146f: Invalid comparison between Unknown and I4 //IL_1471: Unknown result type (might be due to invalid IL or missing references) //IL_1475: Invalid comparison between Unknown and I4 //IL_15b2: Unknown result type (might be due to invalid IL or missing references) //IL_15b5: Invalid comparison between Unknown and I4 //IL_17b2: Unknown result type (might be due to invalid IL or missing references) //IL_17b9: Invalid comparison between Unknown and I4 //IL_1882: Unknown result type (might be due to invalid IL or missing references) //IL_1887: Unknown result type (might be due to invalid IL or missing references) //IL_1889: Unknown result type (might be due to invalid IL or missing references) //IL_188d: Unknown result type (might be due to invalid IL or missing references) //IL_188f: Invalid comparison between Unknown and I4 //IL_18fe: Unknown result type (might be due to invalid IL or missing references) //IL_1901: Unknown result type (might be due to invalid IL or missing references) //IL_1903: Invalid comparison between Unknown and I4 //IL_1528: Unknown result type (might be due to invalid IL or missing references) //IL_152d: Unknown result type (might be due to invalid IL or missing references) //IL_1905: Unknown result type (might be due to invalid IL or missing references) //IL_1909: Invalid comparison between Unknown and I4 //IL_190b: Unknown result type (might be due to invalid IL or missing references) //IL_190f: Invalid comparison between Unknown and I4 //IL_1d7c: Unknown result type (might be due to invalid IL or missing references) //IL_1d7f: Invalid comparison between Unknown and I4 Type type = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "ConfigurationManager")?.GetType("ConfigurationManager.ConfigurationManager"); if (DefaultConfigurability != 0) { bool saveOnConfigSet = plugin.Config.SaveOnConfigSet; plugin.Config.SaveOnConfigSet = false; foreach (Item item4 in registeredItems.Where((Item i) => i.configurability != Configurability.Disabled)) { Item item3 = item4; string name2 = item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_name; string englishName = new Regex("[=\\n\\t\\\\\"\\'\\[\\]]*").Replace(english.Localize(name2), "").Trim(); string localizedName = Localization.instance.Localize(name2).Trim(); int order = 0; if ((item3.configurability & Configurability.Recipe) != 0) { itemCraftConfigs[item3] = new Dictionary<string, ItemConfig>(); foreach (string item5 in item3.Recipes.Keys.DefaultIfEmpty("")) { string configKey = item5; string text = ((configKey == "") ? "" : (" (" + configKey + ")")); if (!item3.Recipes.ContainsKey(configKey) || item3.Recipes[configKey].Crafting.Stations.Count <= 0) { continue; } ItemConfig itemConfig2 = (itemCraftConfigs[item3][configKey] = new ItemConfig()); ItemConfig cfg = itemConfig2; List<ConfigurationManagerAttributes> hideWhenNoneAttributes = new List<ConfigurationManagerAttributes>(); cfg.table = config(englishName, "Crafting Station" + text, item3.Recipes[configKey].Crafting.Stations.First().Table, new ConfigDescription("Crafting station where " + englishName + " is available.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = (order -= 1), Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName } })); ConfigurationManagerAttributes customTableAttributes = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = CustomTableBrowsability, Browsable = (CustomTableBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; cfg.customTable = config(englishName, "Custom Crafting Station" + text, item3.Recipes[configKey].Crafting.Stations.First().custom ?? "", new ConfigDescription("", (AcceptableValueBase)null, new object[1] { customTableAttributes })); cfg.table.SettingChanged += TableConfigChanged; cfg.customTable.SettingChanged += TableConfigChanged; ConfigurationManagerAttributes configurationManagerAttributes = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = TableLevelBrowsability, Browsable = (TableLevelBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; hideWhenNoneAttributes.Add(configurationManagerAttributes); cfg.tableLevel = config(englishName, "Crafting Station Level" + text, item3.Recipes[configKey].Crafting.Stations.First().level, new ConfigDescription("Required crafting station level to craft " + englishName + ".", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); cfg.tableLevel.SettingChanged += delegate { if (activeRecipes.ContainsKey(item3) && activeRecipes[item3].TryGetValue(configKey, out var value6)) { value6.First().m_minStationLevel = cfg.tableLevel.Value; } }; if (item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality > 1) { cfg.maximumTableLevel = config(englishName, "Maximum Crafting Station Level" + text, (item3.MaximumRequiredStationLevel == int.MaxValue) ? (item3.Recipes[configKey].Crafting.Stations.First().level + item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality - 1) : item3.MaximumRequiredStationLevel, new ConfigDescription("Maximum crafting station level to upgrade and repair " + englishName + ".", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); } cfg.requireOneIngredient = config(englishName, "Require only one resource" + text, item3.Recipes[configKey].RequireOnlyOneIngredient ? Toggle.On : Toggle.Off, new ConfigDescription("Whether only one of the ingredients is needed to craft " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = (order -= 1), Category = localizedName } })); ConfigurationManagerAttributes qualityResultAttributes = new ConfigurationManagerAttributes { Order = (order -= 1), browsability = QualityResultBrowsability, Browsable = (QualityResultBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; cfg.requireOneIngredient.SettingChanged += delegate { if (activeRecipes.ContainsKey(item3) && activeRecipes[item3].TryGetValue(configKey, out var value5)) { foreach (Recipe item6 in value5) { item6.m_requireOnlyOneIngredient = cfg.requireOneIngredient.Value == Toggle.On; } } qualityResultAttributes.Browsable = QualityResultBrowsability(); reloadConfigDisplay(); }; cfg.qualityResultAmountMultiplier = config(englishName, "Quality Multiplier" + text, item3.Recipes[configKey].QualityResultAmountMultiplier, new ConfigDescription("Multiplies the crafted amount based on the quality of the resources when crafting " + englishName + ". Only works, if Require Only One Resource is true.", (AcceptableValueBase)null, new object[1] { qualityResultAttributes })); cfg.qualityResultAmountMultiplier.SettingChanged += delegate { if (activeRecipes.ContainsKey(item3) && activeRecipes[item3].TryGetValue(configKey, out var value4)) { foreach (Recipe item7 in value4) { item7.m_qualityResultAmountMultiplier = cfg.qualityResultAmountMultiplier.Value; } } }; if ((!item3.Recipes[configKey].RequiredItems.Free || item3.Recipes[configKey].RequiredItems.Requirements.Count > 0) && item3.Recipes[configKey].RequiredItems.Requirements.All((Requirement r) => r.amountConfig == null)) { cfg.craft = itemConfig("Crafting Costs" + text, new SerializedRequirements(item3.Recipes[configKey].RequiredItems.Requirements).ToString(), "Item costs to craft " + englishName, isUpgrade: false); } if (item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_maxQuality > 1 && (!item3.Recipes[configKey].RequiredUpgradeItems.Free || item3.Recipes[configKey].RequiredUpgradeItems.Requirements.Count > 0) && item3.Recipes[configKey].RequiredUpgradeItems.Requirements.All((Requirement r) => r.amountConfig == null)) { cfg.upgrade = itemConfig("Upgrading Costs" + text, new SerializedRequirements(item3.Recipes[configKey].RequiredUpgradeItems.Requirements).ToString(), "Item costs per level to upgrade " + englishName, isUpgrade: true); } if (cfg.craft != null) { cfg.craft.SettingChanged += ConfigChanged; } if (cfg.upgrade != null) { cfg.upgrade.SettingChanged += ConfigChanged; } void ConfigChanged(object o, EventArgs e) { item3.UpdateCraftConfig(configKey, new SerializedRequirements(cfg.craft?.Value ?? ""), new SerializedRequirements(cfg.upgrade?.Value ?? "")); } bool CustomTableBrowsability() { return cfg.table.Value == CraftingTable.Custom; } bool ItemBrowsability() { return cfg.table.Value != CraftingTable.Disabled; } bool QualityResultBrowsability() { return cfg.requireOneIngredient.Value == Toggle.On; } void TableConfigChanged(object o, EventArgs e) { item3.UpdateItemTableConfig(configKey, cfg.table.Value, cfg.customTable.Value); customTableAttributes.Browsable = cfg.table.Value == CraftingTable.Custom; foreach (ConfigurationManagerAttributes item8 in hideWhenNoneAttributes) { item8.Browsable = cfg.table.Value != CraftingTable.Disabled; } reloadConfigDisplay(); } bool TableLevelBrowsability() { return cfg.table.Value != CraftingTable.Disabled; } ConfigEntry<string> itemConfig(string name, string value, string desc, bool isUpgrade) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown ConfigurationManagerAttributes configurationManagerAttributes3 = new ConfigurationManagerAttributes { CustomDrawer = drawRequirementsConfigTable(item3, isUpgrade), Order = (order -= 1), browsability = ItemBrowsability, Browsable = (ItemBrowsability() && (item3.configurationVisible & Configurability.Recipe) != 0), Category = localizedName }; hideWhenNoneAttributes.Add(configurationManagerAttributes3); return config(englishName, name, value, new ConfigDescription(desc, (AcceptableValueBase)null, new object[1] { configurationManagerAttributes3 })); } } if ((item3.configurability & Configurability.Drop) != 0) { ConfigEntry<string> val3 = (itemDropConfigs[item3] = config(englishName, "Drops from", new SerializedDrop(item3.DropsFrom.Drops).ToString(), new ConfigDescription(englishName + " drops from this creature.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { CustomDrawer = drawDropsConfigTable, Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Drop) != 0) } }))); val3.SettingChanged += delegate { item3.UpdateCharacterDrop(); }; } for (int j = 0; j < item3.Conversions.Count; j++) { string text2 = ((item3.Conversions.Count > 1) ? $"{j + 1}. " : ""); Conversion conversion = item3.Conversions[j]; conversion.config = new Conversion.ConversionConfig(); int index = j; conversion.config.input = config(englishName, text2 + "Conversion Input Item", conversion.Input, new ConfigDescription("Input item to create " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0) } })); conversion.config.input.SettingChanged += delegate { if (index < item3.conversions.Count) { ObjectDB instance = ObjectDB.instance; if (instance != null) { ItemDrop from = SerializedRequirements.fetchByName(instance, conversion.config.input.Value); item3.conversions[index].m_from = from; UpdatePiece(); } } }; conversion.config.piece = config(englishName, text2 + "Conversion Piece", conversion.Piece, new ConfigDescription("Conversion piece used to create " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0) } })); conversion.config.piece.SettingChanged += delegate { UpdatePiece(); }; conversion.config.customPiece = config(englishName, text2 + "Conversion Custom Piece", conversion.customPiece ?? "", new ConfigDescription("Custom conversion piece to create " + englishName, (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Category = localizedName, Browsable = ((item3.configurationVisible & Configurability.Recipe) != 0) } })); conversion.config.customPiece.SettingChanged += delegate { UpdatePiece(); }; void UpdatePiece() { if (index < item3.conversions.Count && Object.op_Implicit((Object)(object)ZNetScene.instance)) { string text3 = ((conversion.config.piece.Value == ConversionPiece.Disabled) ? null : ((conversion.config.piece.Value == ConversionPiece.Custom) ? conversion.config.customPiece.Value : getInternalName(conversion.config.piece.Value))); string activePiece = conversion.config.activePiece; if (conversion.config.activePiece != null) { int num = ZNetScene.instance.GetPrefab(conversion.config.activePiece).GetComponent<Smelter>().m_conversion.IndexOf(item3.conversions[index]); if (num >= 0) { Smelter[] array3 = Resources.FindObjectsOfTypeAll<Smelter>(); foreach (Smelter val4 in array3) { if (Utils.GetPrefabName(((Component)val4).gameObject) == activePiece) { val4.m_conversion.RemoveAt(num); } } } conversion.config.activePiece = null; } if (item3.conversions[index].m_from != null && conversion.config.piece.Value != 0) { GameObject prefab = ZNetScene.instance.GetPrefab(text3); if (((prefab != null) ? prefab.GetComponent<Smelter>() : null) != null) { conversion.config.activePiece = text3; Smelter[] array3 = Resources.FindObjectsOfTypeAll<Smelter>(); foreach (Smelter val5 in array3) { if (Utils.GetPrefabName(((Component)val5).gameObject) == text3) { val5.m_conversion.Add(item3.conversions[index]); } } } } } } } } if ((item3.configurability & Configurability.Stats) != 0) { item3.statsConfigs.Clear(); SharedData shared2 = item3.Prefab.GetComponent<ItemDrop>().m_itemData.m_shared; ItemType itemType = shared2.m_itemType; statcfg<float>("Weight", "Weight of " + englishName + ".", (SharedData shared) => shared.m_weight, delegate(SharedData shared, float value) { shared.m_weight = value; }); statcfg<int>("Trader Value", "Trader value of " + englishName + ".", (SharedData shared) => shared.m_value, delegate(SharedData shared, int value) { shared.m_value = value; }); bool flag; switch (itemType - 3) { case 0: case 1: case 2: case 3: case 4: case 8: case 9: case 11: case 14: case 16: case 19: flag = true; break; default: flag = false; break; } if (flag) { statcfg<float>("Durability", "Durability of " + englishName + ".", (SharedData shared) => shared.m_maxDurability, delegate(SharedData shared, float value) { shared.m_maxDurability = value; }); statcfg<float>("Durability per Level", "Durability gain per level of " + englishName + ".", (SharedData shared) => shared.m_durabilityPerLevel, delegate(SharedData shared, float value) { shared.m_durabilityPerLevel = value; }); statcfg<float>("Movement Speed Modifier", "Movement speed modifier of " + englishName + ".", (SharedData shared) => shared.m_movementModifier, delegate(SharedData shared, float value) { shared.m_movementModifier = value; }); } if ((itemType - 3 <= 2 || (int)itemType == 14 || (int)itemType == 22) ? true : false) { statcfg<float>("Block Armor", "Block armor of " + englishName + ".", (SharedData shared) => shared.m_blockPower, delegate(SharedData shared, float value) { shared.m_blockPower = value; }); statcfg<float>("Block Armor per Level", "Block armor per level for " + englishName + ".", (SharedData shared) => shared.m_blockPowerPerLevel, delegate(SharedData shared, float value) { shared.m_blockPowerPerLevel = value; }); statcfg<float>("Block Force", "Block force of " + englishName + ".", (SharedData shared) => shared.m_deflectionForce, delegate(SharedData shared, float value) { shared.m_deflectionForce = value; }); statcfg<float>("Block Force per Level", "Block force per level for " + englishName + ".", (SharedData shared) => shared.m_deflectionForcePerLevel, delegate(SharedData shared, float value) { shared.m_deflectionForcePerLevel = value; }); statcfg<float>("Parry Bonus", "Parry bonus of " + englishName + ".", (SharedData shared) => shared.m_timedBlockBonus, delegate(SharedData shared, float value) { shared.m_timedBlockBonus = value; }); } else if ((itemType - 6 <= 1 || itemType - 11 <= 1 || (int)itemType == 17) ? true : false) { statcfg<float>("Armor", "Armor of " + englishName + ".", (SharedData shared) => shared.m_armor, delegate(SharedData shared, float value) { shared.m_armor = value; })