Decompiled source of UpturnedVariety v1.3.3

UpturnedVariety.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("UpturnedVariety")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Includes some assets from The Upturned for vanilla-friendly variety")]
[assembly: AssemblyFileVersion("1.3.3.0")]
[assembly: AssemblyInformationalVersion("1.3.3+bcd6c9d5e0ce1673f5b93d68819ee5346f45a2a3")]
[assembly: AssemblyProduct("UpturnedVariety")]
[assembly: AssemblyTitle("UpturnedVariety")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.3.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace UpturnedVariety
{
	internal static class LobbyCompatibility
	{
		internal static void Init()
		{
			PluginHelper.RegisterPlugin("butterystancakes.lethalcompany.upturnedvariety", Version.Parse("1.3.3"), (CompatibilityLevel)0, (VersionStrictness)0);
		}
	}
	[BepInPlugin("butterystancakes.lethalcompany.upturnedvariety", "Upturned Variety", "1.3.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal const string PLUGIN_GUID = "butterystancakes.lethalcompany.upturnedvariety";

		internal const string PLUGIN_NAME = "Upturned Variety";

		internal const string PLUGIN_VERSION = "1.3.3";

		internal static ManualLogSource Logger;

		private const string GUID_LOBBY_COMPATIBILITY = "BMX.LobbyCompatibility";

		internal static ConfigEntry<bool> configGift;

		internal static ConfigEntry<bool> configCandy;

		internal static ConfigEntry<bool> configPerfume;

		internal static ConfigEntry<bool> configPerfumeMeshes;

		internal static ConfigEntry<bool> configPills;

		internal static ConfigEntry<bool> configMug;

		internal static ConfigEntry<bool> configControlPad;

		internal static ConfigEntry<bool> configFish;

		internal static ConfigEntry<bool> configCandyMeshes;

		internal static ConfigEntry<bool> configSteeringWheel;

		private void Awake()
		{
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			Logger = ((BaseUnityPlugin)this).Logger;
			if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"))
			{
				Logger.LogInfo((object)"CROSS-COMPATIBILITY - Lobby Compatibility detected");
				LobbyCompatibility.Init();
			}
			configGift = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Gift", true, "Enables alternate palettes for the \"Gift box\" item.");
			configCandy = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Candy", true, "Enables alternate palettes for the \"Candy\" item.");
			configCandyMeshes = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "CandyModels", true, "Enables alternate models for the \"Candy\" item.");
			configPerfume = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Perfume", true, "Enables alternate palettes for the \"Perfume bottle\" item.");
			configPerfumeMeshes = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "PerfumeModels", true, "Enables alternate models for the \"Perfume bottle\" item.");
			configPills = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Pills", true, "Enables alternate palettes for the \"Pill bottle\" item.");
			configMug = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Mug", true, "Enables alternate palettes for the \"Mug\" item.");
			configControlPad = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "ControlPad", true, "Enables alternate palettes for the \"Control pad\" item.");
			configFish = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "Fish", true, "Enables alternate models for the \"Plastic fish\" item.");
			configSteeringWheel = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", "SteeringWheel", true, "Enables alternate palettes for the \"Steering wheel\" item.");
			try
			{
				AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "upturnedvariety"));
				ItemVariety.boombox = val.LoadAsset<AudioClip>("Boombox");
				if (configGift.Value)
				{
					ItemVariety.giftBoxTex2 = val.LoadAsset<Texture>("GiftBoxTex2");
				}
				if (configCandy.Value)
				{
					ItemVariety.lollipop2 = val.LoadAsset<Material>("LollyPop");
					ItemVariety.lollyStick = val.LoadAsset<Material>("LightWood");
					ItemVariety.lollyMesh = val.LoadAsset<Mesh>("Cylinder.001");
					if (configCandyMeshes.Value)
					{
						ItemVariety.sucker = val.LoadAsset<Mesh>("Sucker");
					}
				}
				if (configPerfumeMeshes.Value)
				{
					ItemVariety.perfumeMeshes = (Mesh[])(object)new Mesh[5]
					{
						val.LoadAsset<Mesh>("PerfumeBottle_001"),
						val.LoadAsset<Mesh>("PerfumeBottle_002"),
						val.LoadAsset<Mesh>("PerfumeBottle_003"),
						val.LoadAsset<Mesh>("PerfumeBottle_004"),
						val.LoadAsset<Mesh>("PerfumeBottle_005")
					};
				}
				if (configPills.Value)
				{
					ItemVariety.pillBottle2 = val.LoadAsset<Texture>("PillBottleTextureB2");
				}
				if (configMug.Value)
				{
					ItemVariety.coffeeMug6 = val.LoadAsset<Material>("CoffeeMug6");
				}
				if (configControlPad.Value)
				{
					ItemVariety.controlPad2 = val.LoadAsset<Texture>("ArcadeControlPanel2");
				}
				if (configFish.Value)
				{
					ItemVariety.fish2 = val.LoadAsset<Mesh>("Fish2");
					ItemVariety.sardine = val.LoadAsset<Mesh>("Sardine");
					ItemVariety.sardineBanana = val.LoadAsset<Mesh>("Sardine.001");
				}
				if (configSteeringWheel.Value)
				{
					ItemVariety.darkPlastic = val.LoadAsset<Material>("DarkPlastic");
				}
				val.Unload(false);
			}
			catch
			{
				Logger.LogError((object)"Encountered some error loading asset bundle. Did you install the plugin correctly?");
				return;
			}
			new Harmony("butterystancakes.lethalcompany.upturnedvariety").PatchAll();
			Logger.LogInfo((object)"Upturned Variety v1.3.3 loaded");
		}
	}
	[HarmonyPatch]
	internal class UpturnedVarietyPatches
	{
		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		[HarmonyPostfix]
		private static void StartOfRoundPostAwake(StartOfRound __instance)
		{
			if ((Object)(object)ItemVariety.boombox != (Object)null)
			{
				Item val = ((IEnumerable<Item>)__instance.allItemsList.itemsList).FirstOrDefault((Func<Item, bool>)((Item item) => ((Object)item).name == "Boombox"));
				if ((Object)(object)val != (Object)null)
				{
					BoomboxItem component = val.spawnPrefab.GetComponent<BoomboxItem>();
					if (Array.IndexOf(component.musicAudios, ItemVariety.boombox) < 0)
					{
						component.musicAudios = new List<AudioClip>(component.musicAudios) { ItemVariety.boombox }.ToArray();
						Plugin.Logger.LogDebug((object)"Loaded Upturned track into Boombox");
					}
				}
			}
			ItemVariety.cache.Clear();
		}

		[HarmonyPatch(typeof(RoundManager), "SyncScrapValuesClientRpc")]
		[HarmonyPostfix]
		private static void PostSyncScrapValuesClientRpc(RoundManager __instance, NetworkObjectReference[] spawnedScrap)
		{
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_071b: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_073d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0834: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			ItemVariety.offsets.Clear();
			NetworkObject val = default(NetworkObject);
			GrabbableObject val2 = default(GrabbableObject);
			Renderer val7 = default(Renderer);
			MeshFilter val8 = default(MeshFilter);
			for (int i = 0; i < spawnedScrap.Length; i++)
			{
				if (!((NetworkObjectReference)(ref spawnedScrap[i])).TryGet(ref val, (NetworkManager)null) || !ItemVariety.cache.Add(val.NetworkObjectId) || !((Component)val).TryGetComponent<GrabbableObject>(ref val2))
				{
					continue;
				}
				if (val2 is GiftBoxItem)
				{
					ItemVariety.GetSkinIndices(val2);
					if (Plugin.configGift.Value && (Object)(object)ItemVariety.giftBoxTex2 != (Object)null && ItemVariety.tex == 1)
					{
						((Component)val2).GetComponent<Renderer>().material.mainTexture = ItemVariety.giftBoxTex2;
						Plugin.Logger.LogDebug((object)$"Gift #{val.NetworkObjectId} using alternate texture");
					}
					continue;
				}
				if (((Object)val2.itemProperties).name == "Candy")
				{
					MeshRenderer mainObjectRenderer = val2.mainObjectRenderer;
					if (((mainObjectRenderer != null) ? ((Renderer)mainObjectRenderer).sharedMaterials : null) != null && ((Renderer)val2.mainObjectRenderer).sharedMaterials.Length == 2 && ((Object)((Renderer)val2.mainObjectRenderer).sharedMaterials[0]).name.StartsWith("LollyPop"))
					{
						ItemVariety.GetSkinIndices(val2, 2, 2);
						if (!Plugin.configCandy.Value || !((Object)(object)ItemVariety.lollipop2 != (Object)null) || !((Object)(object)ItemVariety.lollyStick != (Object)null))
						{
							continue;
						}
						if (ItemVariety.tex == 1)
						{
							((Renderer)val2.mainObjectRenderer).materials = (Material[])(object)new Material[2]
							{
								ItemVariety.lollipop2,
								ItemVariety.lollyStick
							};
							Plugin.Logger.LogDebug((object)$"Candy #{val.NetworkObjectId} using alternate texture");
						}
						if (Plugin.configCandyMeshes.Value && ItemVariety.mesh == 1)
						{
							((Component)val2.mainObjectRenderer).GetComponent<MeshFilter>().mesh = ItemVariety.sucker;
							Plugin.Logger.LogDebug((object)$"Candy #{val.NetworkObjectId} using alternate model");
							if (ItemVariety.tex == 0)
							{
								Material val3 = ((Renderer)val2.mainObjectRenderer).materials[0];
								val3.SetColor("_Color", ItemVariety.candyPink);
								val3.SetColor("_BaseColor", ItemVariety.candyPink);
								((Renderer)val2.mainObjectRenderer).materials = (Material[])(object)new Material[2]
								{
									val3,
									((Renderer)val2.mainObjectRenderer).sharedMaterials[1]
								};
							}
						}
						else if (ItemVariety.tex == 1 && (Object)(object)ItemVariety.lollyMesh != (Object)null)
						{
							((Component)val2.mainObjectRenderer).GetComponent<MeshFilter>().mesh = ItemVariety.lollyMesh;
						}
						continue;
					}
				}
				if (((Object)val2.itemProperties).name == "PerfumeBottle")
				{
					MeshRenderer mainObjectRenderer2 = val2.mainObjectRenderer;
					if (((mainObjectRenderer2 != null) ? ((Renderer)mainObjectRenderer2).sharedMaterials : null) != null && ((Renderer)val2.mainObjectRenderer).sharedMaterials.Length == 2 && ((Object)((Renderer)val2.mainObjectRenderer).sharedMaterials[0]).name.StartsWith("Material.004"))
					{
						ItemVariety.GetSkinIndices(val2, 4, 6);
						if (Plugin.configPerfume.Value && ItemVariety.tex != 0)
						{
							Color val4 = default(Color);
							Color val5 = default(Color);
							switch (ItemVariety.tex)
							{
							case 1:
								val4 = ItemVariety.perfumeRed;
								val5 = ItemVariety.perfumeRedTrans;
								break;
							case 2:
								val4 = ItemVariety.perfumeBlue;
								val5 = ItemVariety.perfumeBlueTrans;
								break;
							case 3:
								val4 = ItemVariety.perfumeBlack;
								val5 = ItemVariety.perfumeBlackTrans;
								break;
							}
							Material val6 = ((Renderer)val2.mainObjectRenderer).materials[0];
							val6.SetColor("_Color", val4);
							val6.SetColor("_BaseColor", val4);
							val6.SetColor("_TransmittanceColor", val5);
							((Renderer)val2.mainObjectRenderer).materials = (Material[])(object)new Material[2]
							{
								val6,
								((Renderer)val2.mainObjectRenderer).sharedMaterials[1]
							};
							Plugin.Logger.LogDebug((object)$"Perfume #{val.NetworkObjectId} using alternate texture");
						}
						if (Plugin.configPerfumeMeshes.Value && ItemVariety.perfumeMeshes != null && ItemVariety.perfumeMeshes.Length >= 5 && ItemVariety.mesh != 0)
						{
							((Component)val2.mainObjectRenderer).GetComponent<MeshFilter>().mesh = ItemVariety.perfumeMeshes[ItemVariety.mesh - 1];
							Plugin.Logger.LogDebug((object)$"Perfume #{val.NetworkObjectId} using alternate model");
						}
						continue;
					}
				}
				if (((Object)val2.itemProperties).name == "PillBottle")
				{
					MeshRenderer mainObjectRenderer3 = val2.mainObjectRenderer;
					if ((Object)(object)((mainObjectRenderer3 != null) ? ((Renderer)mainObjectRenderer3).sharedMaterial : null) != (Object)null && ((Object)((Renderer)val2.mainObjectRenderer).sharedMaterial).name.StartsWith("Material.002"))
					{
						ItemVariety.GetSkinIndices(val2);
						if (Plugin.configPills.Value && (Object)(object)ItemVariety.pillBottle2 != (Object)null && ItemVariety.tex == 1)
						{
							((Renderer)val2.mainObjectRenderer).material.mainTexture = ItemVariety.pillBottle2;
							Plugin.Logger.LogDebug((object)$"Pills #{val.NetworkObjectId} using alternate texture");
						}
						continue;
					}
				}
				if (((Object)val2.itemProperties).name == "Mug")
				{
					MeshRenderer mainObjectRenderer4 = val2.mainObjectRenderer;
					if ((Object)(object)((mainObjectRenderer4 != null) ? ((Renderer)mainObjectRenderer4).sharedMaterial : null) != (Object)null && ((Object)((Renderer)val2.mainObjectRenderer).sharedMaterial).name.StartsWith("CoffeeMug"))
					{
						ItemVariety.GetSkinIndices(val2, 6);
						if (Plugin.configMug.Value && (Object)(object)ItemVariety.coffeeMug6 != (Object)null && ItemVariety.tex == 5)
						{
							((Renderer)val2.mainObjectRenderer).material = ItemVariety.coffeeMug6;
							Plugin.Logger.LogDebug((object)$"Mug #{val.NetworkObjectId} using alternate texture");
						}
						continue;
					}
				}
				if (((Object)val2.itemProperties).name == "ControlPad" && ((Component)val2).TryGetComponent<Renderer>(ref val7) && (Object)(object)val7.sharedMaterial != (Object)null && ((Object)val7.sharedMaterial).name.StartsWith("ArcadeControlPanel"))
				{
					ItemVariety.GetSkinIndices(val2);
					if (Plugin.configControlPad.Value && (Object)(object)ItemVariety.controlPad2 != (Object)null && ItemVariety.tex == 1)
					{
						val7.material.mainTexture = ItemVariety.controlPad2;
						Plugin.Logger.LogDebug((object)$"Controller #{val.NetworkObjectId} using alternate texture");
					}
				}
				else if (((Object)val2.itemProperties).name == "FishTestProp" && ((Component)val2.mainObjectRenderer).TryGetComponent<MeshFilter>(ref val8))
				{
					ItemVariety.GetSkinIndices(val2, 10, 3);
					if (!Plugin.configFish.Value)
					{
						continue;
					}
					if (ItemVariety.tex == 8)
					{
						if ((Object)(object)ItemVariety.sardineBanana == (Object)null)
						{
							continue;
						}
						val8.mesh = ItemVariety.sardineBanana;
						Material val9 = ((Renderer)val2.mainObjectRenderer).materials[1];
						Material val10 = Object.Instantiate<Material>(val9);
						val9.SetColor("_Color", ItemVariety.banana);
						val9.SetColor("_BaseColor", ItemVariety.banana);
						val10.SetColor("_Color", ItemVariety.stem);
						val10.SetColor("_BaseColor", ItemVariety.stem);
						((Renderer)val2.mainObjectRenderer).materials = (Material[])(object)new Material[3]
						{
							((Renderer)val2.mainObjectRenderer).sharedMaterials[0],
							val9,
							val10
						};
					}
					else if ((Object)(object)ItemVariety.fish2 != (Object)null && (Object)(object)ItemVariety.sardine != (Object)null)
					{
						int mesh = ItemVariety.mesh;
						if (mesh != 1)
						{
							if (mesh != 2)
							{
								continue;
							}
							val8.mesh = ItemVariety.sardine;
							Material val11 = ((Renderer)val2.mainObjectRenderer).materials[1];
							val11.SetColor("_Color", ItemVariety.fishRed);
							val11.SetColor("_BaseColor", ItemVariety.fishRed);
							((Renderer)val2.mainObjectRenderer).materials = (Material[])(object)new Material[2]
							{
								((Renderer)val2.mainObjectRenderer).sharedMaterials[0],
								val11
							};
						}
						else
						{
							val8.mesh = ItemVariety.fish2;
							Material val12 = ((Renderer)val2.mainObjectRenderer).materials[1];
							val12.SetColor("_Color", ItemVariety.fishYellow);
							val12.SetColor("_BaseColor", ItemVariety.fishYellow);
							((Renderer)val2.mainObjectRenderer).materials = (Material[])(object)new Material[2]
							{
								val12,
								((Renderer)val2.mainObjectRenderer).sharedMaterials[0]
							};
						}
					}
					Plugin.Logger.LogDebug((object)$"Fish #{val.NetworkObjectId} using alternate model");
				}
				else if (((Object)val2.itemProperties).name == "SteeringWheel" && (Object)(object)val2.mainObjectRenderer != (Object)null && (Object)(object)((Renderer)val2.mainObjectRenderer).sharedMaterial != (Object)null && ((Object)((Renderer)val2.mainObjectRenderer).sharedMaterial).name.StartsWith("DirtySmoothSteel"))
				{
					ItemVariety.GetSkinIndices(val2);
					if (Plugin.configSteeringWheel.Value && (Object)(object)ItemVariety.darkPlastic != (Object)null && ItemVariety.tex == 1)
					{
						((Renderer)val2.mainObjectRenderer).material = ItemVariety.darkPlastic;
						Plugin.Logger.LogDebug((object)$"Wheel #{val.NetworkObjectId} using alternate texture");
					}
				}
			}
		}
	}
	internal class ItemVariety
	{
		internal static AudioClip boombox;

		internal static Texture giftBoxTex2;

		internal static Texture pillBottle2;

		internal static Texture controlPad2;

		internal static Material lollipop2;

		internal static Material lollyStick;

		internal static Material coffeeMug6;

		internal static Material darkPlastic;

		internal static Color perfumeRed = new Color(0.9f, 0.3922666f, 0.324f, 0.6313726f);

		internal static Color perfumeRedTrans = new Color(1f, 0.4f, 0.4f);

		internal static Color perfumeBlue = new Color(0.4509091f, 0.416f, 0.8f, 0.6313726f);

		internal static Color perfumeBlueTrans = new Color(0.59f, 0.6241666f, 1f);

		internal static Color perfumeBlack = new Color(0.01f, 0.01f, 0.01f, 0.6313726f);

		internal static Color perfumeBlackTrans = new Color(0.48f, 0.48f, 0.48f);

		internal static Color fishYellow = new Color(0.773024f, 0.8392157f, 0.3692549f);

		internal static Color fishRed = new Color(0.5019608f, 0.1780566f, 0.1556078f);

		internal static Color banana = new Color(0.44f, 0.4296874f, 0.2028124f);

		internal static Color stem = new Color(0.3799999f, 0.243271f, 0.1527103f);

		internal static Color candyPink = new Color(0.9063317f, 0.5387983f, 0.8062879f);

		internal static Mesh lollyMesh;

		internal static Mesh sucker;

		internal static Mesh fish2;

		internal static Mesh sardine;

		internal static Mesh sardineBanana;

		internal static Mesh[] perfumeMeshes;

		internal static HashSet<ulong> cache = new HashSet<ulong>();

		internal static Dictionary<string, int> offsets = new Dictionary<string, int>();

		internal static int tex = -1;

		internal static int mesh = -1;

		internal static void GetSkinIndices(GrabbableObject obj, int texCount = 2, int meshCount = -1)
		{
			if (offsets.ContainsKey(((Object)obj.itemProperties).name))
			{
				offsets[((Object)obj.itemProperties).name]++;
			}
			else
			{
				offsets.Add(((Object)obj.itemProperties).name, 0);
			}
			Random random = new Random(StartOfRound.Instance.randomMapSeed + (int)obj.targetFloorPosition.x + (int)obj.targetFloorPosition.z + offsets[((Object)obj.itemProperties).name]);
			if (texCount >= 0)
			{
				tex = random.Next(texCount);
			}
			if (meshCount >= 0)
			{
				mesh = random.Next(meshCount);
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "UpturnedVariety";

		public const string PLUGIN_NAME = "UpturnedVariety";

		public const string PLUGIN_VERSION = "1.3.3";
	}
}