Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of Yeet v3.0.4
Yeet.dll
Decompiled a year agousing 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.Configuration; using BepInEx.Logging; using HG.Reflection; using On.RoR2; using On.RoR2.UI; using R2API; using RoR2; using RoR2.UI; using TILER2; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Networking; using UnityEngine.ResourceManagement.AsyncOperations; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Yeet")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Yeet")] [assembly: AssemblyTitle("Yeet")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ThinkInvisible.Yeet; [BepInPlugin("com.ThinkInvisible.Yeet", "Yeet", "3.0.4")] [BepInDependency("com.bepis.r2api", "5.1.1")] [BepInDependency("com.ThinkInvisible.TILER2", "7.4.1")] public class YeetPlugin : BaseUnityPlugin { public class ServerBlacklist : AutoConfigContainer { [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventEquipment { get; private set; } [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventLunarEquipment { get; private set; } [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventNonLunarEquipment { get; private set; } [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventItems { get; private set; } [AutoConfig(/*Could not decode attribute arguments.*/)] public bool preventHidden { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] public bool preventCantRemove { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] public bool preventTierless { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOString(null, null)] public string blacklistTier { get; private set; } = "LunarTierDef, VoidTier1Def, VoidTier2Def, VoidTier3Def, VoidBossDef"; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOString(null, null)] public string blacklistItem { get; private set; } = ""; } public class ServerConfig : AutoConfigContainer { [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool allowYeet { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool preventRecycling { get; private set; } [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool commandExtraCheesyMode { get; private set; } [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOCheckbox(null, null)] public bool announce { get; private set; } = true; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} m/s", 0f, 500f, null, null)] public float lowThrowForce { get; private set; } = 30f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} m/s", 0f, 500f, null, null)] public float highThrowForce { get; private set; } = 150f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOIntSlider("{0:N0}", 1, 100, null, null)] public int maxThrowCount { get; private set; } = 1; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} s", 0f, 300f, null, null)] public float yoinkCooldown { get; private set; } = 5f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} s", 0f, 300f, null, null)] public float yeetCooldown { get; private set; } = 10f; } public class ClientConfig : AutoConfigContainer { [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOSlider("{0:N1} s", 0f, 10f, null, null)] public float highThrowTime { get; private set; } = 2f; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOIntSlider("{0:N0}", -100, 100, null, null)] public int primaryQuantity { get; private set; } = 1; [AutoConfig(/*Could not decode attribute arguments.*/)] [AutoConfigRoOIntSlider("{0:N0}", -100, 100, null, null)] public int secondaryQuantity { get; private set; } = 1; } public const string ModVer = "3.0.4"; public const string ModName = "Yeet"; public const string ModGuid = "com.ThinkInvisible.Yeet"; public static readonly ServerConfig serverConfig = new ServerConfig(); public static readonly ClientConfig clientConfig = new ClientConfig(); public static readonly ServerBlacklist serverBlacklist = new ServerBlacklist(); internal static ManualLogSource _logger; private static GameObject yeetPickupPrefab; private static readonly HashSet<string> _blacklistTier = new HashSet<string>(); private static readonly HashSet<string> _blacklistItem = new HashSet<string>(); public void Awake() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) _logger = ((BaseUnityPlugin)this).Logger; ConfigFile val = new ConfigFile(Path.Combine(Paths.ConfigPath, "com.ThinkInvisible.Yeet.cfg"), true); ((AutoConfigContainer)serverBlacklist).ConfigEntryChanged += delegate(object sender, AutoConfigUpdateActionEventArgs args) { if (args.target.boundProperty.Name == "blacklistTier" || args.target.boundProperty.Name == "blacklistItem") { UpdateBlacklists(); } }; ((AutoConfigContainer)serverConfig).BindAll(val, "Yeet", "Server"); ((AutoConfigContainer)clientConfig).BindAll(val, "Yeet", "Client"); ((AutoConfigContainer)serverBlacklist).BindAll(val, "Yeet", "ServerBlacklist"); UpdateBlacklists(); ItemIcon.Awake += new hook_Awake(ItemIcon_Awake); EquipmentIcon.Update += new hook_Update(EquipmentIcon_Update); PickupDropletController.OnCollisionEnter += new hook_OnCollisionEnter(PickupDropletController_OnCollisionEnter); GenericPickupController.CreatePickup += new hook_CreatePickup(GenericPickupController_CreatePickup); GenericPickupController.GetInteractability += new hook_GetInteractability(GenericPickupController_GetInteractability); GenericPickupController.OnTriggerStay += new hook_OnTriggerStay(GenericPickupController_OnTriggerStay); AsyncOperationHandle<GameObject> val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/GenericPickup.prefab"); val2.Completed += delegate(AsyncOperationHandle<GameObject> obj) { GameObject result = obj.Result; if (!Object.op_Implicit((Object)(object)result)) { _logger.LogError((object)"Failed to load GenericPickup prefab to copy homework off of. The YoinkCooldown setting will not work (no extra cooldown will be added)."); } else { GameObject val3 = PrefabAPI.InstantiateClone(result, "YeetPickupPrefabPrefab"); val3.AddComponent<YeetData>(); yeetPickupPrefab = PrefabAPI.InstantiateClone(val3, "YeetPickupPrefab", true); } }; } private void UpdateBlacklists() { _blacklistItem.Clear(); _blacklistItem.UnionWith(from x in serverBlacklist.blacklistItem.Split(',') select x.Trim()); _blacklistTier.Clear(); _blacklistTier.UnionWith(from x in serverBlacklist.blacklistTier.Split(',') select x.Trim()); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void ConCmdYeet(ConCommandArgs args) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected I4, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Expected I4, but got Unknown //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Invalid comparison between Unknown and I4 //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) if (!serverConfig.allowYeet) { if (Object.op_Implicit((Object)(object)args.sender)) { NetUtil.ServerSendChatMsg(args.sender, "Yeet mod has been temporarily disabled by the server host."); } return; } if (!Object.op_Implicit((Object)(object)((ConCommandArgs)(ref args)).senderBody)) { _logger.LogError((object)"ConCmdYeet: called by nonexistent player!"); return; } if (((ConCommandArgs)(ref args)).Count < 1) { _logger.LogError((object)"ConCmdYeet: not enough arguments! Need at least 1 (item ID), received 0."); return; } YeetData yeetData = ((Component)((ConCommandArgs)(ref args)).senderBody).GetComponent<YeetData>(); if (!Object.op_Implicit((Object)(object)yeetData)) { yeetData = ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject.AddComponent<YeetData>(); yeetData.age = serverConfig.yeetCooldown; } if (yeetData.age < serverConfig.yeetCooldown) { float num = serverConfig.yeetCooldown - yeetData.age; NetUtil.ServerSendChatMsg(args.sender, string.Format("You must wait {0:0} second{1} before yeeting another item.", num, (num < 2f) ? "" : "s")); return; } bool valueOrDefault = ((ConCommandArgs)(ref args)).TryGetArgBool(1).GetValueOrDefault(); if (valueOrDefault ? serverBlacklist.preventEquipment : serverBlacklist.preventItems) { return; } string itemSearch = ((ConCommandArgs)(ref args)).TryGetArgString(0); if (itemSearch == null) { _logger.LogError((object)"ConCmdYeet: could not read first argument (item ID)!"); return; } if (int.TryParse(itemSearch, out var result)) { if (valueOrDefault) { EquipmentIndex val = (EquipmentIndex)result; if (!EquipmentCatalog.IsIndexValid(ref val)) { _logger.LogError((object)"ConCmdYeet: first argument (equipment ID as integer EquipmentIndex) is out of range; no equipment with that ID exists!"); return; } } else { ItemIndex val2 = (ItemIndex)result; if (!ItemCatalog.IsIndexValid(ref val2)) { _logger.LogError((object)"ConCmdYeet: first argument (item ID as integer ItemIndex) is out of range; no item with that ID exists!"); return; } } } else if (valueOrDefault) { IEnumerable<EquipmentIndex> source = ((IEnumerable<EquipmentIndex>)(object)EquipmentCatalog.allEquipment).Where(delegate(EquipmentIndex searchInd) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) string nameToken2 = EquipmentCatalog.GetEquipmentDef(searchInd).nameToken; string string2 = Language.GetString(nameToken2); return string2.ToUpper().Contains(itemSearch.ToUpper()); }); if (source.Count() < 1) { _logger.LogError((object)"ConCmdYeet: first argument (equipment ID as string EquipmentName) not found in EquipmentCatalog; no equipment with a name containing that string exists!"); return; } if (source.Count() > 1) { _logger.LogWarning((object)"ConCmdYeet: first argument (item ID as string EquipmentName) matched multiple equipments; using first."); } result = (int)source.First(); } else { IEnumerable<ItemIndex> source2 = ((IEnumerable<ItemIndex>)(object)ItemCatalog.allItems).Where(delegate(ItemIndex searchInd) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) string nameToken = ItemCatalog.GetItemDef(searchInd).nameToken; string @string = Language.GetString(nameToken); return @string.ToUpper().Contains(itemSearch.ToUpper()); }); if (source2.Count() < 1) { _logger.LogError((object)"ConCmdYeet: first argument (item ID as string ItemName) not found in ItemCatalog; no item with a name containing that string exists!"); return; } if (source2.Count() > 1) { _logger.LogWarning((object)"ConCmdYeet: first argument (item ID as string ItemName) matched multiple items; using first."); } result = (int)source2.First(); } float num2 = Mathf.Lerp(serverConfig.lowThrowForce, serverConfig.highThrowForce, Mathf.Clamp01(((ConCommandArgs)(ref args)).TryGetArgFloat(2).GetValueOrDefault())); int num3 = 1; string text; PickupIndex val3; if (valueOrDefault) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef((EquipmentIndex)result); string colorHexString = ColorCatalog.GetColorHexString(equipmentDef.colorIndex); text = "<color=#" + colorHexString + ">" + Language.GetString(equipmentDef.nameToken) + "</color>"; if ((int)((ConCommandArgs)(ref args)).senderBody.inventory.GetEquipmentIndex() != result) { _logger.LogWarning((object)"ConCmdYeet: someone's trying to drop an equipment they don't have"); NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": you don't have it."); return; } if (equipmentDef.isLunar ? serverBlacklist.preventLunarEquipment : serverBlacklist.preventNonLunarEquipment) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": tier blacklisted by server."); return; } if (_blacklistItem.Contains(equipmentDef.nameToken)) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": equipment blacklisted by server."); return; } ((ConCommandArgs)(ref args)).senderBody.inventory.SetEquipmentIndex((EquipmentIndex)(-1)); val3 = PickupCatalog.FindPickupIndex((EquipmentIndex)result); } else { FakeInventory component = ((Component)((ConCommandArgs)(ref args)).senderBody).GetComponent<FakeInventory>(); int num4 = (Object.op_Implicit((Object)(object)component) ? component.GetRealItemCount((ItemIndex)result) : ((ConCommandArgs)(ref args)).senderBody.inventory.GetItemCount((ItemIndex)result)); ItemDef itemDef = ItemCatalog.GetItemDef((ItemIndex)result); ItemTierDef itemTierDef = ItemTierCatalog.GetItemTierDef(itemDef.tier); string colorHexString2 = ColorCatalog.GetColorHexString(itemTierDef.colorIndex); text = "<color=#" + colorHexString2 + ">" + Language.GetString(itemDef.nameToken) + "</color>"; if (num4 < 1) { _logger.LogWarning((object)"ConCmdYeet: someone's trying to drop an item they don't have any of"); NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": you don't have any."); return; } if ((serverBlacklist.preventHidden && itemDef.hidden) || (serverBlacklist.preventCantRemove && !itemDef.canRemove) || ((!Object.op_Implicit((Object)(object)itemTierDef)) ? serverBlacklist.preventTierless : _blacklistTier.Contains(((Object)itemTierDef).name))) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": tier blacklisted by server."); return; } if (_blacklistItem.Contains(itemDef.nameToken)) { NetUtil.ServerSendChatMsg(args.sender, "Can't yeet " + text + ": item blacklisted by server."); return; } int num5 = ((ConCommandArgs)(ref args)).TryGetArgInt(3) ?? 1; if (num5 < 0) { num5 = Mathf.CeilToInt((float)num4 / ((float)(-num5) * 100f)); } num3 = Mathf.Clamp(num5, 1, Mathf.Min(serverConfig.maxThrowCount, num4)); ((ConCommandArgs)(ref args)).senderBody.inventory.RemoveItem((ItemIndex)result, num3); val3 = PickupCatalog.FindPickupIndex((ItemIndex)result); } if (serverConfig.announce) { NetUtil.ServerSendGlobalChatMsg($"{Util.EscapeRichTextForTextMeshPro(args.sender.userName)} yeeted {num3}x {text}"); } for (int i = 0; i < num3; i++) { GameObject val4 = Object.Instantiate<GameObject>(PickupDropletController.pickupDropletPrefab, ((ConCommandArgs)(ref args)).senderBody.inputBank.aimOrigin, Quaternion.identity); YeetData yeetData2 = val4.AddComponent<YeetData>(); yeetData2.yeeter = ((ConCommandArgs)(ref args)).senderBody; PickupDropletController component2 = val4.GetComponent<PickupDropletController>(); if (Object.op_Implicit((Object)(object)component2)) { component2.NetworkpickupIndex = val3; CreatePickupInfo createPickupInfo = new CreatePickupInfo { rotation = Quaternion.identity }; ((CreatePickupInfo)(ref createPickupInfo)).pickupIndex = val3; component2.createPickupInfo = createPickupInfo; } Rigidbody component3 = val4.GetComponent<Rigidbody>(); component3.velocity = ((ConCommandArgs)(ref args)).senderBody.inputBank.aimDirection * num2; component3.AddTorque(Random.Range(150f, 120f) * Random.onUnitSphere); NetworkServer.Spawn(val4); } yeetData.age = 0f; } private void GenericPickupController_OnTriggerStay(orig_OnTriggerStay orig, GenericPickupController self, Collider other) { if (NetworkServer.active) { CharacterBody component = ((Component)other).GetComponent<CharacterBody>(); YeetData component2 = ((Component)self).GetComponent<YeetData>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && (Object)(object)component2.yeeter == (Object)(object)component && component2.age < serverConfig.yoinkCooldown) { return; } } orig.Invoke(self, other); } private Interactability GenericPickupController_GetInteractability(orig_GetInteractability orig, GenericPickupController self, Interactor activator) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Interactability result = orig.Invoke(self, activator); YeetData component = ((Component)self).GetComponent<YeetData>(); CharacterBody component2 = ((Component)activator).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && (Object)(object)component.yeeter == (Object)(object)component2 && component.age < serverConfig.yoinkCooldown) { return (Interactability)0; } return result; } private void PickupDropletController_OnCollisionEnter(orig_OnCollisionEnter orig, PickupDropletController self, Collision collision) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !self.alive) { orig.Invoke(self, collision); return; } bool flag = false; YeetData component = ((Component)self).GetComponent<YeetData>(); if (Object.op_Implicit((Object)(object)component)) { if (!serverConfig.commandExtraCheesyMode) { flag = ((IEnumerable<ArtifactDef>)(object)RunArtifactManager.enabledArtifactsEnumerable).Contains(Artifacts.Command); } if (flag) { RunArtifactManager.instance.SetArtifactEnabledServer(Artifacts.Command, false); } if (!Object.op_Implicit((Object)(object)yeetPickupPrefab)) { orig.Invoke(self, collision); } else { self.alive = false; self.createPickupInfo.position = ((Component)self).transform.position; GameObject val = Object.Instantiate<GameObject>(yeetPickupPrefab, self.createPickupInfo.position, self.createPickupInfo.rotation); GenericPickupController component2 = val.GetComponent<GenericPickupController>(); if (Object.op_Implicit((Object)(object)component2)) { component2.NetworkpickupIndex = ((CreatePickupInfo)(ref self.createPickupInfo)).pickupIndex; if (serverConfig.preventRecycling) { component2.NetworkRecycled = true; } } PickupIndexNetworker component3 = val.GetComponent<PickupIndexNetworker>(); if (Object.op_Implicit((Object)(object)component3)) { component3.NetworkpickupIndex = ((CreatePickupInfo)(ref self.createPickupInfo)).pickupIndex; } YeetData component4 = val.GetComponent<YeetData>(); component4.age = component.age; component4.yeeter = component.yeeter; NetworkServer.Spawn(val); Object.Destroy((Object)(object)((Component)self).gameObject); } if (flag) { RunArtifactManager.instance.SetArtifactEnabledServer(Artifacts.Command, true); } } else { orig.Invoke(self, collision); } } private GenericPickupController GenericPickupController_CreatePickup(orig_CreatePickup orig, ref CreatePickupInfo createPickupInfo) { return orig.Invoke(ref createPickupInfo); } private void ItemIcon_Awake(orig_Awake orig, ItemIcon self) { orig.Invoke(self); ((Component)self).gameObject.AddComponent<YeetButton>(); } private void EquipmentIcon_Update(orig_Update orig, EquipmentIcon self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<YeetButton>())) { YeetButton yeetButton = ((Component)self).gameObject.AddComponent<YeetButton>(); yeetButton.isEquipment = true; } } } public class YeetData : MonoBehaviour { public CharacterBody yeeter; public float age; private void FixedUpdate() { age += Time.fixedDeltaTime; } } public class YeetButton : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler { private float holdTimeL; private float holdTimeR; public bool isEquipment; void IPointerDownHandler.OnPointerDown(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 if ((int)eventData.button == 0) { holdTimeL = Time.unscaledTime; } else if ((int)eventData.button == 1) { holdTimeR = Time.unscaledTime; } } void IPointerUpHandler.OnPointerUp(PointerEventData eventData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected I4, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected I4, but got Unknown bool flag = (int)eventData.button == 0; bool flag2 = (int)eventData.button == 1; if (flag || flag2) { float num = Time.unscaledTime - (flag ? holdTimeL : holdTimeR); string text = (isEquipment ? ((int)((Component)this).GetComponent<EquipmentIcon>().targetInventory.GetEquipmentIndex()).ToString() : ((int)((Component)this).GetComponent<ItemIcon>().itemIndex).ToString()); if (NetworkUser.readOnlyLocalPlayersList.Count > 0) { Console.instance.SubmitCmd(NetworkUser.readOnlyLocalPlayersList[0], $"yeet {text} {(isEquipment ? 1 : 0)} {num:N4} {(flag ? YeetPlugin.clientConfig.primaryQuantity : YeetPlugin.clientConfig.secondaryQuantity)}", false); } else { YeetPlugin._logger.LogError((object)"Received inventory click event with no active local players!"); } } } }