Decompiled source of WhiteMarble v1.2.0

vsp.WhiteMarble.dll

Decompiled 9 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("WhiteMarble")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WhiteMarble")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2dc112fb-c226-4496-941b-a0e33756d2a0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace WhiteMarble;

[BepInPlugin("vsp.WhiteMarble", "WhiteMarble", "1.2.0")]
public class Class1 : BaseUnityPlugin
{
	private static Texture2D whiteMarble;

	private CustomLocalization Localization;

	private void Awake()
	{
		PrefabManager.OnVanillaPrefabsAvailable += MarblePieces;
		AddLocalizations();
	}

	private void MarblePieces()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Expected O, but got Unknown
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Expected O, but got Unknown
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Expected O, but got Unknown
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Expected O, but got Unknown
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Expected O, but got Unknown
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Expected O, but got Unknown
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Expected O, but got Unknown
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Expected O, but got Unknown
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Expected O, but got Unknown
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Expected O, but got Unknown
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: Expected O, but got Unknown
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Expected O, but got Unknown
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Expected O, but got Unknown
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Expected O, but got Unknown
		//IL_0283: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Expected O, but got Unknown
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Expected O, but got Unknown
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_030d: Expected O, but got Unknown
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Expected O, but got Unknown
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0335: Expected O, but got Unknown
		//IL_035e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0365: Expected O, but got Unknown
		//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b5: Expected O, but got Unknown
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c9: Expected O, but got Unknown
		//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03dd: Expected O, but got Unknown
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Expected O, but got Unknown
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Expected O, but got Unknown
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_0471: Expected O, but got Unknown
		//IL_047b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0485: Expected O, but got Unknown
		//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b5: Expected O, but got Unknown
		//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0505: Expected O, but got Unknown
		//IL_050f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0519: Expected O, but got Unknown
		//IL_0523: Unknown result type (might be due to invalid IL or missing references)
		//IL_052d: Expected O, but got Unknown
		//IL_0556: Unknown result type (might be due to invalid IL or missing references)
		//IL_055d: Expected O, but got Unknown
		//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ae: Expected O, but got Unknown
		//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c2: Expected O, but got Unknown
		//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d6: Expected O, but got Unknown
		//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0606: Expected O, but got Unknown
		//IL_064c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0656: Expected O, but got Unknown
		//IL_0660: Unknown result type (might be due to invalid IL or missing references)
		//IL_066a: Expected O, but got Unknown
		//IL_0674: Unknown result type (might be due to invalid IL or missing references)
		//IL_067e: Expected O, but got Unknown
		//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ae: Expected O, but got Unknown
		//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fe: Expected O, but got Unknown
		//IL_0708: Unknown result type (might be due to invalid IL or missing references)
		//IL_0712: Expected O, but got Unknown
		//IL_071c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0726: Expected O, but got Unknown
		//IL_074f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0756: Expected O, but got Unknown
		//IL_079d: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a7: Expected O, but got Unknown
		//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bb: Expected O, but got Unknown
		//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cf: Expected O, but got Unknown
		//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ff: Expected O, but got Unknown
		//IL_0845: Unknown result type (might be due to invalid IL or missing references)
		//IL_084f: Expected O, but got Unknown
		//IL_0859: Unknown result type (might be due to invalid IL or missing references)
		//IL_0863: Expected O, but got Unknown
		//IL_086d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0877: Expected O, but got Unknown
		//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a7: Expected O, but got Unknown
		//IL_08ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f7: Expected O, but got Unknown
		//IL_0901: Unknown result type (might be due to invalid IL or missing references)
		//IL_090b: Expected O, but got Unknown
		//IL_0915: Unknown result type (might be due to invalid IL or missing references)
		//IL_091f: Expected O, but got Unknown
		//IL_0948: Unknown result type (might be due to invalid IL or missing references)
		//IL_094f: Expected O, but got Unknown
		//IL_0995: Unknown result type (might be due to invalid IL or missing references)
		//IL_099f: Expected O, but got Unknown
		//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b3: Expected O, but got Unknown
		//IL_09bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c7: Expected O, but got Unknown
		//IL_09f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f7: Expected O, but got Unknown
		//IL_0a3d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a47: Expected O, but got Unknown
		//IL_0a51: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5b: Expected O, but got Unknown
		//IL_0a65: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a6f: Expected O, but got Unknown
		//IL_0a79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a83: Expected O, but got Unknown
		//IL_0aac: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab3: Expected O, but got Unknown
		//IL_0af9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b03: Expected O, but got Unknown
		//IL_0b0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b17: Expected O, but got Unknown
		//IL_0b21: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b2b: Expected O, but got Unknown
		//IL_0b54: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5b: Expected O, but got Unknown
		//IL_0ba2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bac: Expected O, but got Unknown
		//IL_0bb7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc1: Expected O, but got Unknown
		//IL_0bcb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bd5: Expected O, but got Unknown
		//IL_0bfe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c05: Expected O, but got Unknown
		//IL_0c4b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c55: Expected O, but got Unknown
		//IL_0c5f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c69: Expected O, but got Unknown
		//IL_0c73: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c7d: Expected O, but got Unknown
		//IL_0ca6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cad: Expected O, but got Unknown
		//IL_0cf3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cfd: Expected O, but got Unknown
		//IL_0d07: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d11: Expected O, but got Unknown
		//IL_0d1b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d25: Expected O, but got Unknown
		//IL_0d4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d55: Expected O, but got Unknown
		//IL_0d9b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0da5: Expected O, but got Unknown
		//IL_0daf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0db9: Expected O, but got Unknown
		//IL_0dc3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dcd: Expected O, but got Unknown
		//IL_0df6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dfd: Expected O, but got Unknown
		//IL_0e43: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e4d: Expected O, but got Unknown
		//IL_0e57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e61: Expected O, but got Unknown
		//IL_0e6b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e75: Expected O, but got Unknown
		//IL_0e9e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea5: Expected O, but got Unknown
		//IL_0eeb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ef5: Expected O, but got Unknown
		//IL_0eff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f09: Expected O, but got Unknown
		//IL_0f13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1d: Expected O, but got Unknown
		//IL_0f46: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f4d: Expected O, but got Unknown
		//IL_0f93: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f9d: Expected O, but got Unknown
		//IL_0fa7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb1: Expected O, but got Unknown
		//IL_0fbb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc5: Expected O, but got Unknown
		//IL_0fee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff5: Expected O, but got Unknown
		//IL_103b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1045: Expected O, but got Unknown
		//IL_104f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1059: Expected O, but got Unknown
		//IL_1063: Unknown result type (might be due to invalid IL or missing references)
		//IL_106d: Expected O, but got Unknown
		//IL_1096: Unknown result type (might be due to invalid IL or missing references)
		//IL_109d: Expected O, but got Unknown
		//IL_10e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_10ed: Expected O, but got Unknown
		//IL_10f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_1101: Expected O, but got Unknown
		//IL_110b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1115: Expected O, but got Unknown
		//IL_113e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1145: Expected O, but got Unknown
		//IL_118b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1195: Expected O, but got Unknown
		//IL_119f: Unknown result type (might be due to invalid IL or missing references)
		//IL_11a9: Expected O, but got Unknown
		//IL_11b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_11bd: Expected O, but got Unknown
		TextureFind();
		GameObject val = PrefabManager.Instance.CreateClonedPrefab("whitemarble_1x1", "blackmarble_1x1");
		ComponentFind(val, "stone_hgih", "stone_low");
		PieceConfig val2 = new PieceConfig();
		val2.Name = "$piece_whitemarble_1x1";
		val2.Description = "$piece_whitemarble_1x1_description";
		val2.PieceTable = PieceTables.Hammer;
		val2.CraftingStation = CraftingStations.Stonecutter;
		val2.Category = "WhiteMarble";
		val2.AddRequirement(new RequirementConfig("BlackMarble", 2, 0, true));
		val2.AddRequirement(new RequirementConfig("BoneFragments", 1, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val, false, val2));
		GameObject val3 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_2x1x1", "blackmarble_2x1x1");
		ComponentFind(val3, "stone_high", "stone_low");
		PieceConfig val4 = new PieceConfig();
		val4.Name = "$piece_whitemarble_2x1x1";
		val4.Description = "$piece_whitemarble_2x1x1_description";
		val4.PieceTable = PieceTables.Hammer;
		val4.CraftingStation = CraftingStations.Stonecutter;
		val4.Category = "WhiteMarble";
		val4.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val4.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val3, false, val4));
		GameObject val5 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_2x2x2", "blackmarble_2x2x2");
		ComponentFind(val5, "stone_hgih", "stone_low");
		PieceConfig val6 = new PieceConfig();
		val6.Name = "$piece_whitemarble_2x2x2";
		val6.Description = "$piece_whitemarble_2x2x2_description";
		val6.PieceTable = PieceTables.Hammer;
		val6.CraftingStation = CraftingStations.Stonecutter;
		val6.Category = "WhiteMarble";
		val6.AddRequirement(new RequirementConfig("BlackMarble", 8, 0, true));
		val6.AddRequirement(new RequirementConfig("BoneFragments", 4, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val5, false, val6));
		GameObject val7 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_floor", "blackmarble_floor");
		ComponentFind(val7, "stone_high", "stone_low");
		PieceConfig val8 = new PieceConfig();
		val8.Name = "$piece_whitemarble_floor";
		val8.Description = "$piece_whitemarble_floor_description";
		val8.PieceTable = PieceTables.Hammer;
		val8.CraftingStation = CraftingStations.Stonecutter;
		val8.Category = "WhiteMarble";
		val8.AddRequirement(new RequirementConfig("BlackMarble", 8, 0, true));
		val8.AddRequirement(new RequirementConfig("BoneFragments", 4, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val7, false, val8));
		GameObject val9 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_floor_triangle", "blackmarble_floor_triangle");
		ComponentFind(val9, "stone_hgih", "stone_low");
		PieceConfig val10 = new PieceConfig();
		val10.Name = "$piece_whitemarble_floor_triangle";
		val10.Description = "$piece_whitemarble_floor_triangle_description";
		val10.PieceTable = PieceTables.Hammer;
		val10.CraftingStation = CraftingStations.Stonecutter;
		val10.Category = "WhiteMarble";
		val10.AddRequirement(new RequirementConfig("BlackMarble", 3, 0, true));
		val10.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val9, false, val10));
		GameObject val11 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_stair", "blackmarble_stair");
		ComponentFind(val11, "high", "low");
		PieceConfig val12 = new PieceConfig();
		val12.Name = "$piece_whitemarble_stair";
		val12.Description = "$piece_whitemarble_stair_description";
		val12.PieceTable = PieceTables.Hammer;
		val12.CraftingStation = CraftingStations.Stonecutter;
		val12.Category = "WhiteMarble";
		val12.AddRequirement(new RequirementConfig("BlackMarble", 8, 0, true));
		val12.AddRequirement(new RequirementConfig("BoneFragments", 4, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val11, false, val12));
		GameObject val13 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_tip", "blackmarble_tip");
		ComponentFind(val13, "stone_hgih", "stone_low");
		PieceConfig val14 = new PieceConfig();
		val14.Name = "$piece_whitemarble_tip";
		val14.Description = "$piece_whitemarble_tip_description";
		val14.PieceTable = PieceTables.Hammer;
		val14.CraftingStation = CraftingStations.Stonecutter;
		val14.Category = "WhiteMarble";
		val14.AddRequirement(new RequirementConfig("BlackMarble", 2, 0, true));
		val14.AddRequirement(new RequirementConfig("BoneFragments", 1, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val13, false, val14));
		GameObject val15 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_base_1", "blackmarble_base_1");
		ComponentFind(val15, "stone_high", "stone_low");
		PieceConfig val16 = new PieceConfig();
		val16.Name = "$piece_whitemarble_base_1";
		val16.Description = "$piece_whitemarble_base_1_description";
		val16.PieceTable = PieceTables.Hammer;
		val16.CraftingStation = CraftingStations.Stonecutter;
		val16.Category = "WhiteMarble";
		val16.AddRequirement(new RequirementConfig("BlackMarble", 5, 0, true));
		val16.AddRequirement(new RequirementConfig("BoneFragments", 3, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val15, false, val16));
		GameObject val17 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_base_2", "blackmarble_base_2");
		ComponentFind(val17, "stone_high", "stone_low");
		PieceConfig val18 = new PieceConfig();
		val18.Name = "$piece_whitemarble_base_2";
		val18.Description = "$piece_whitemarble_base_2_description";
		val18.PieceTable = PieceTables.Hammer;
		val18.CraftingStation = CraftingStations.Stonecutter;
		val18.Category = "WhiteMarble";
		val18.AddRequirement(new RequirementConfig("BlackMarble", 10, 0, true));
		val18.AddRequirement(new RequirementConfig("BoneFragments", 5, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val17, false, val18));
		GameObject val19 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_basecorner", "blackmarble_basecorner");
		ComponentFind(val19, "stone_high", "stone_low");
		PieceConfig val20 = new PieceConfig();
		val20.Name = "$piece_whitemarble_basecorner";
		val20.Description = "$piece_whitemarble_basecorner_description";
		val20.PieceTable = PieceTables.Hammer;
		val20.CraftingStation = CraftingStations.Stonecutter;
		val20.Category = "WhiteMarble";
		val20.AddRequirement(new RequirementConfig("BlackMarble", 6, 0, true));
		val20.AddRequirement(new RequirementConfig("BoneFragments", 3, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val19, false, val20));
		GameObject val21 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_out_1", "blackmarble_out_1");
		ComponentFind(val21, "stone_high", "stone_low");
		PieceConfig val22 = new PieceConfig();
		val22.Name = "$piece_whitemarble_out_1";
		val22.Description = "$piece_whitemarble_out_1_description";
		val22.PieceTable = PieceTables.Hammer;
		val22.CraftingStation = CraftingStations.Stonecutter;
		val22.Category = "WhiteMarble";
		val22.AddRequirement(new RequirementConfig("BlackMarble", 5, 0, true));
		val22.AddRequirement(new RequirementConfig("BoneFragments", 3, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val21, false, val22));
		GameObject val23 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_out_2", "blackmarble_out_2");
		ComponentFind(val23, "stone_high", "stone_low");
		PieceConfig val24 = new PieceConfig();
		val24.Name = "$piece_whitemarble_out_2";
		val24.Description = "$piece_whitemarble_out_2_description";
		val24.PieceTable = PieceTables.Hammer;
		val24.CraftingStation = CraftingStations.Stonecutter;
		val24.Category = "WhiteMarble";
		val24.AddRequirement(new RequirementConfig("BlackMarble", 10, 0, true));
		val24.AddRequirement(new RequirementConfig("BoneFragments", 5, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val23, false, val24));
		GameObject val25 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_outcorner", "blackmarble_outcorner");
		ComponentFind(val25, "stone_high", "stone_low");
		PieceConfig val26 = new PieceConfig();
		val26.Name = "$piece_whitemarble_outcorner";
		val26.Description = "$piece_whitemarble_outcorner_description";
		val26.PieceTable = PieceTables.Hammer;
		val26.CraftingStation = CraftingStations.Stonecutter;
		val26.Category = "WhiteMarble";
		val26.AddRequirement(new RequirementConfig("BlackMarble", 6, 0, true));
		val24.AddRequirement(new RequirementConfig("BoneFragments", 3, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val25, false, val26));
		GameObject val27 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_arch", "blackmarble_arch");
		ComponentFind(val27, "stone_high", "stone_low");
		PieceConfig val28 = new PieceConfig();
		val28.Name = "$piece_whitemarble_arch";
		val28.Description = "$piece_whitemarble_arch_description";
		val28.PieceTable = PieceTables.Hammer;
		val28.CraftingStation = CraftingStations.Stonecutter;
		val28.Category = "WhiteMarble";
		val28.AddRequirement(new RequirementConfig("BlackMarble", 5, 0, true));
		val28.AddRequirement(new RequirementConfig("BoneFragments", 3, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val27, false, val28));
		GameObject val29 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_column_2", "blackmarble_column_2");
		ComponentFind(val29, "stone_high", "stone_low");
		PieceConfig val30 = new PieceConfig();
		val30.Name = "$piece_whitemarble_column_2";
		val30.Description = "$piece_whitemarble_column_2_description";
		val30.PieceTable = PieceTables.Hammer;
		val30.CraftingStation = CraftingStations.Stonecutter;
		val30.Category = "WhiteMarble";
		val30.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val30.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val29, false, val30));
		GameObject val31 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_2x2_enforced", "blackmarble_2x2_enforced");
		ComponentFind(val31, "stone_hgih", "stone_low");
		PieceConfig val32 = new PieceConfig();
		val32.Name = "$piece_whitemarble_2x2_enforced";
		val32.Description = "$piece_whitemarble_2x2_enforced_description";
		val32.PieceTable = PieceTables.Hammer;
		val32.CraftingStation = CraftingStations.Stonecutter;
		val32.Category = "WhiteMarble";
		val32.AddRequirement(new RequirementConfig("BlackMarble", 2, 0, true));
		val32.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		val32.AddRequirement(new RequirementConfig("Copper", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val31, false, val32));
		GameObject val33 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_column_1", "blackmarble_column_1");
		ComponentFind(val33, "stone_high", "stone_low");
		PieceConfig val34 = new PieceConfig();
		val34.Name = "$piece_whitemarble_column_1";
		val34.Description = "$piece_whitemarble_column_1_description";
		val34.PieceTable = PieceTables.Hammer;
		val34.CraftingStation = CraftingStations.Stonecutter;
		val34.Category = "WhiteMarble";
		val34.AddRequirement(new RequirementConfig("BlackMarble", 2, 0, true));
		val34.AddRequirement(new RequirementConfig("BoneFragments", 1, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val33, false, val34));
		GameObject val35 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_floor_large", "blackmarble_floor_large");
		ComponentFind(val35, "high", "low");
		PieceConfig val36 = new PieceConfig();
		val36.Name = "$piece_whitemarble_floor_large";
		val36.Description = "$piece_whitemarble_floor_large_description";
		val36.PieceTable = PieceTables.Hammer;
		val36.CraftingStation = CraftingStations.Stonecutter;
		val36.Category = "WhiteMarble";
		val36.AddRequirement(new RequirementConfig("BlackMarble", 32, 0, true));
		val36.AddRequirement(new RequirementConfig("BoneFragments", 16, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val35, false, val36));
		GameObject val37 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_head_big01", "blackmarble_head_big01");
		ComponentFind(val37, "head_high", "head_low");
		PieceConfig val38 = new PieceConfig();
		val38.Name = "$piece_whitemarble_head_big01";
		val38.Description = "$piece_whitemarble_head_big01_description";
		val38.PieceTable = PieceTables.Hammer;
		val38.CraftingStation = CraftingStations.Stonecutter;
		val38.Category = "WhiteMarble";
		val38.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val38.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val37, false, val38));
		GameObject val39 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_head_big02", "blackmarble_head_big02");
		ComponentFind(val39, "head_high", "head_low");
		PieceConfig val40 = new PieceConfig();
		val40.Name = "$piece_whitemarble_head_big02";
		val40.Description = "$piece_whitemarble_head_big02_description";
		val40.PieceTable = PieceTables.Hammer;
		val40.CraftingStation = CraftingStations.Stonecutter;
		val40.Category = "WhiteMarble";
		val40.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val40.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val39, false, val40));
		GameObject val41 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_slope_1x2", "blackmarble_slope_1x2");
		ComponentFind(val41, "stone_hgih", "stone_low");
		PieceConfig val42 = new PieceConfig();
		val42.Name = "$piece_whitemarble_slope_1x2";
		val42.Description = "$piece_whitemarble_slope_1x2_description";
		val42.PieceTable = PieceTables.Hammer;
		val42.CraftingStation = CraftingStations.Stonecutter;
		val42.Category = "WhiteMarble";
		val42.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val42.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val41, false, val42));
		GameObject val43 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_slope_inverted_1x2", "blackmarble_slope_inverted_1x2");
		ComponentFind(val43, "stone_hgih", "stone_low");
		PieceConfig val44 = new PieceConfig();
		val44.Name = "$piece_whitemarble_slope_inverted_1x2";
		val44.Description = "$piece_whitemarble_slope_inverted_1x2_description";
		val44.PieceTable = PieceTables.Hammer;
		val44.CraftingStation = CraftingStations.Stonecutter;
		val44.Category = "WhiteMarble";
		val44.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val44.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val43, false, val44));
		GameObject val45 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_tile_floor_1x1", "blackmarble_tile_floor_1x1");
		ComponentFind(val45, "stone_hgih", "stone_low");
		PieceConfig val46 = new PieceConfig();
		val46.Name = "$piece_whitemarble_tile_floor_1x1";
		val46.Description = "$piece_whitemarble_tile_floor_1x1_description";
		val46.PieceTable = PieceTables.Hammer;
		val46.CraftingStation = CraftingStations.Stonecutter;
		val46.Category = "WhiteMarble";
		val46.AddRequirement(new RequirementConfig("BlackMarble", 1, 0, true));
		val46.AddRequirement(new RequirementConfig("BoneFragments", 1, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val45, false, val46));
		GameObject val47 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_tile_floor_2x2", "blackmarble_tile_floor_2x2");
		ComponentFind(val47, "stone_hgih", "stone_low");
		PieceConfig val48 = new PieceConfig();
		val48.Name = "$piece_whitemarble_tile_floor_2x2";
		val48.Description = "$piece_whitemarble_tile_floor_2x2_description";
		val48.PieceTable = PieceTables.Hammer;
		val48.CraftingStation = CraftingStations.Stonecutter;
		val48.Category = "WhiteMarble";
		val48.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val48.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val47, false, val48));
		GameObject val49 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_tile_wall_1x1", "blackmarble_tile_wall_1x1");
		ComponentFind(val49, "stone_hgih", "stone_low");
		PieceConfig val50 = new PieceConfig();
		val50.Name = "$piece_whitemarble_tile_wall_1x1";
		val50.Description = "$piece_whitemarble_tile_wall_1x1_description";
		val50.PieceTable = PieceTables.Hammer;
		val50.CraftingStation = CraftingStations.Stonecutter;
		val50.Category = "WhiteMarble";
		val50.AddRequirement(new RequirementConfig("BlackMarble", 1, 0, true));
		val50.AddRequirement(new RequirementConfig("BoneFragments", 1, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val49, false, val50));
		GameObject val51 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_tile_wall_2x2", "blackmarble_tile_wall_2x2");
		ComponentFind(val51, "stone_hgih", "stone_low");
		PieceConfig val52 = new PieceConfig();
		val52.Name = "$piece_whitemarble_tile_wall_2x2";
		val52.Description = "$piece_whitemarble_tile_wall_2x2_description";
		val52.PieceTable = PieceTables.Hammer;
		val52.CraftingStation = CraftingStations.Stonecutter;
		val52.Category = "WhiteMarble";
		val52.AddRequirement(new RequirementConfig("BlackMarble", 4, 0, true));
		val52.AddRequirement(new RequirementConfig("BoneFragments", 2, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val51, false, val52));
		GameObject val53 = PrefabManager.Instance.CreateClonedPrefab("whitemarble_tile_wall_2x4", "blackmarble_tile_wall_2x4");
		ComponentFind(val53, "stone_hgih", "stone_low");
		PieceConfig val54 = new PieceConfig();
		val54.Name = "$piece_whitemarble_tile_wall_2x4";
		val54.Description = "$piece_whitemarble_tile_wall_2x4_description";
		val54.PieceTable = PieceTables.Hammer;
		val54.CraftingStation = CraftingStations.Stonecutter;
		val54.Category = "WhiteMarble";
		val54.AddRequirement(new RequirementConfig("BlackMarble", 8, 0, true));
		val54.AddRequirement(new RequirementConfig("BoneFragments", 4, 0, true));
		PieceManager.Instance.AddPiece(new CustomPiece(val53, false, val54));
		PrefabManager.OnVanillaPrefabsAvailable -= MarblePieces;
	}

	private void ComponentFind(GameObject prefab, string name1, string name2)
	{
		((Renderer)((Component)ExposedGameObjectExtension.FindDeepChild(prefab.gameObject, name1, (IterativeSearchType)1)).GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)whiteMarble;
		((Renderer)((Component)ExposedGameObjectExtension.FindDeepChild(prefab.gameObject, name2, (IterativeSearchType)1)).GetComponent<MeshRenderer>()).material.mainTexture = (Texture)(object)whiteMarble;
	}

	private void TextureFind()
	{
		if (File.Exists(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Marble.jpg")))
		{
			whiteMarble = AssetUtils.LoadTexture(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Marble.jpg"), true);
		}
		else if (File.Exists(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Marble.png")))
		{
			whiteMarble = AssetUtils.LoadTexture(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Marble.png"), true);
		}
		else
		{
			whiteMarble = AssetUtils.LoadAssetBundleFromResources("marbletex").LoadAsset<Texture2D>("Assets/whiteMarble.png");
		}
	}

	public void AddLocalizations()
	{
		Localization = LocalizationManager.Instance.GetLocalization();
		CustomLocalization localization = Localization;
		string text = "English";
		localization.AddTranslation(ref text, new Dictionary<string, string>
		{
			{ "piece_whitemarble_1x1", "Marble Block" },
			{ "piece_whitemarble_1x1_description", "Marble Block 1х1" },
			{ "piece_whitemarble_2x1x1", "Marble Block" },
			{ "piece_whitemarble_2x1x1_description", "Marble Block 2х1х1" },
			{ "piece_whitemarble_2x2x2", "Marble Block" },
			{ "piece_whitemarble_2x2x2_description", "Marble Block 2х2х2" },
			{ "piece_whitemarble_floor", "Marble Floor" },
			{ "piece_whitemarble_floor_description", "Just a Marble Floor" },
			{ "piece_whitemarble_floor_triangle", "Marble floor triangle" },
			{ "piece_whitemarble_floor_triangle_description", "Just a marble floor triangle" },
			{ "piece_whitemarble_stair", "Marble Stair" },
			{ "piece_whitemarble_stair_description", "Just a marble stair" },
			{ "piece_whitemarble_tip", "Marble Tip" },
			{ "piece_whitemarble_tip_description", "Just a Marble Tip" },
			{ "piece_whitemarble_base_1", "Marble Base" },
			{ "piece_whitemarble_base_1_description", "Marble base" },
			{ "piece_whitemarble_base_2", "Marble Base 2" },
			{ "piece_whitemarble_base_2_description", "Marble base" },
			{ "piece_whitemarble_basecorner", "Marble Basecorner" },
			{ "piece_whitemarble_basecorner_description", "Just a marble basecorner" },
			{ "piece_whitemarble_out_1", "Marble Out" },
			{ "piece_whitemarble_out_1_description", "Just a marble out" },
			{ "piece_whitemarble_out_2", "Marble Out 2" },
			{ "piece_whitemarble_out_2_description", "Just a bigger stone stair" },
			{ "piece_whitemarble_outcorner", "Black marble floor big" },
			{ "piece_whitemarble_outcorner_description", "Just a marble out" },
			{ "piece_whitemarble_arch", "Marble Arch" },
			{ "piece_whitemarble_arch_description", "Just a marble arch" },
			{ "piece_whitemarble_column_2", "Marble Column 2" },
			{ "piece_whitemarble_column_2_description", "Just a marble column" },
			{ "piece_whitemarble_2x2_enforced", "Marble enforced 2x2" },
			{ "piece_whitemarble_2x2_enforced_description", "Enforced marble" },
			{ "piece_whitemarble_column_1", "Marble Column" },
			{ "piece_whitemarble_column_1_description", "Just a marble column" },
			{ "piece_whitemarble_floor_large", "Marble Floor 2" },
			{ "piece_whitemarble_floor_large_description", "Marble floor large" },
			{ "piece_whitemarble_head_big01", "Marble Carved" },
			{ "piece_whitemarble_head_big01_description", "Carved marble head" },
			{ "piece_whitemarble_head_big02", "Marble Carved 2" },
			{ "piece_whitemarble_head_big02_description", "Carved marble head 2" },
			{ "piece_whitemarble_slope_1x2", "Marble Slope" },
			{ "piece_whitemarble_slope_1x2_description", "Marble Slope 1x2" },
			{ "piece_whitemarble_slope_inverted_1x2", "Marble Slope" },
			{ "piece_whitemarble_slope_inverted_1x2_description", "Just a inverted marble slope 1x2" },
			{ "piece_whitemarble_tile_floor_1x1", "Marble Tile Floor" },
			{ "piece_whitemarble_tile_floor_1x1_description", "Just a marble title floor 1x1" },
			{ "piece_whitemarble_tile_floor_2x2", "Marble Tile Floor 2" },
			{ "piece_whitemarble_tile_floor_2x2_description", "Just a marble title floor 2x2" },
			{ "piece_whitemarble_tile_wall_1x1", "Marble Tile Wall" },
			{ "piece_whitemarble_tile_wall_1x1_description", "Just a marble tile wall 1x1" },
			{ "piece_whitemarble_tile_wall_2x2", "Marble Tile Wall 2" },
			{ "piece_whitemarble_tile_wall_2x2_description", "Just a marble tile wall 2x2" },
			{ "piece_whitemarble_tile_wall_2x4", "Marble Tile Wall 3" },
			{ "piece_whitemarble_tile_wall_2x4_description", "Just a marble tile wall 2x4" }
		});
		CustomLocalization localization2 = Localization;
		text = "Russian";
		localization2.AddTranslation(ref text, new Dictionary<string, string>
		{
			{ "piece_whitemarble_1x1", "Блок мрамора" },
			{ "piece_whitemarble_1x1_description", "Блок мрамора 1х1" },
			{ "piece_whitemarble_2x1x1", "Блок мрамора" },
			{ "piece_whitemarble_2x1x1_description", "Блок мрамора 2х1х1" },
			{ "piece_whitemarble_2x2x2", "Блок мрамора " },
			{ "piece_whitemarble_2x2x2_description", "Блок мрамора 2х2х2" },
			{ "piece_whitemarble_floor", "Пол из мрамора" },
			{ "piece_whitemarble_floor_description", "Мраморный пол" },
			{ "piece_whitemarble_floor_triangle", "Мраморный пол треугольный" },
			{ "piece_whitemarble_floor_triangle_description", "Треугольный мраморный пол" },
			{ "piece_whitemarble_stair", "Мраморные ступеньки" },
			{ "piece_whitemarble_stair_description", "Ступеньки сделанные из мрамора" },
			{ "piece_whitemarble_tip", "Угол из мрамора" },
			{ "piece_whitemarble_tip_description", "Угловой блок из мрамора" },
			{ "piece_whitemarble_base_1", "Мраморная опора" },
			{ "piece_whitemarble_base_1_description", "Опора из мрамора" },
			{ "piece_whitemarble_base_2", "Мраморная опора 2" },
			{ "piece_whitemarble_base_2_description", "Опора из мрамора" },
			{ "piece_whitemarble_basecorner", "Угловая мраморная опора" },
			{ "piece_whitemarble_basecorner_description", "Угловая опора из мрамора" },
			{ "piece_whitemarble_out_1", "Stone floor biggest" },
			{ "piece_whitemarble_out_1_description", "Just a bigger stone floor" },
			{ "piece_whitemarble_out_2", "Stone stair biggest" },
			{ "piece_whitemarble_out_2_description", "Just a bigger stone stair" },
			{ "piece_whitemarble_outcorner", "Black marble floor big" },
			{ "piece_whitemarble_outcorner_description", "Just a bigger black marble foor" },
			{ "piece_whitemarble_arch", "Black marble stair big" },
			{ "piece_whitemarble_arch_description", "Just a bigger black marble stair" },
			{ "piece_whitemarble_column_2", "Колонна из мрамора 2" },
			{ "piece_whitemarble_column_2_description", "Колонна сделанная из мрамора" },
			{ "piece_whitemarble_2x2_enforced", "Усиленный блок мрамора" },
			{ "piece_whitemarble_2x2_enforced_description", "Усиленный блок мрамора 2х2" },
			{ "piece_whitemarble_column_1", "Колонна из мрамора" },
			{ "piece_whitemarble_column_1_description", "Колонна сделанная из мрамора" },
			{ "piece_whitemarble_floor_large", "Пол из мрамора" },
			{ "piece_whitemarble_floor_large_description", "Большой пол сделанный из мрамора" },
			{ "piece_whitemarble_head_big01", "Узорчатый блок мрамора" },
			{ "piece_whitemarble_head_big01_description", "Блок мрамора с вырезом" },
			{ "piece_whitemarble_head_big02", "CУзорчатый блок мрамора 2" },
			{ "piece_whitemarble_head_big02_description", "Блок мрамора с вырезом 2" },
			{ "piece_whitemarble_slope_1x2", "Угловой блок мрамора" },
			{ "piece_whitemarble_slope_1x2_description", "Скошенный мраморный блок 1х2" },
			{ "piece_whitemarble_slope_inverted_1x2", "Скошенный мраморный блок 2" },
			{ "piece_whitemarble_slope_inverted_1x2_description", "Скошенный мраморный блок 1х2" },
			{ "piece_whitemarble_tile_floor_1x1", "Мраморная плитка 1х1" },
			{ "piece_whitemarble_tile_floor_1x1_description", "Мраморный блок малой толщины" },
			{ "piece_whitemarble_tile_floor_2x2", "Мраморная плитка 2х2" },
			{ "piece_whitemarble_tile_floor_2x2_description", "Мраморный блок малой толщины" },
			{ "piece_whitemarble_tile_wall_1x1", "Мраморная стена 1х1" },
			{ "piece_whitemarble_tile_wall_1x1_description", "Мраморная стена малой толщины" },
			{ "piece_whitemarble_tile_wall_2x2", "Мраморная стена 2х2" },
			{ "piece_whitemarble_tile_wall_2x2_description", "Мраморная стена малой толщины" },
			{ "piece_whitemarble_tile_wall_2x4", "Мраморная стена 2х4" },
			{ "piece_whitemarble_tile_wall_2x4_description", "Мраморная стена малой толщины" }
		});
	}
}