diff --git a/ContentAPI/API/Components/CustomKeybind.cs b/ContentAPI/API/Components/CustomKeybind.cs deleted file mode 100644 index 1c6179e..0000000 --- a/ContentAPI/API/Components/CustomKeybind.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ContentAPI.API.Monobehavior -{ - using System.Linq; - using UnityEngine; - - /// - /// CustomKeybind controller. - /// - public class CustomKeybind : MonoBehaviour - { - private void Update() - { - foreach (Features.Input input in Features.Input.Registered.Where(input => Input.GetKeyDown(input.Key))) - input.ProcessInput(); - } - } -} \ No newline at end of file diff --git a/ContentAPI/API/Features/Player.cs b/ContentAPI/API/Features/Player.cs index 029d78d..b749885 100644 --- a/ContentAPI/API/Features/Player.cs +++ b/ContentAPI/API/Features/Player.cs @@ -27,7 +27,8 @@ public class Player : IWrapper, IWorldSpace internal Player(PlayerAPI player) { Base = player; - Dictionary.Add(player.gameObject, this); + if (!Dictionary.ContainsKey(player.gameObject)) + Dictionary.Add(player.gameObject, this); } /// diff --git a/ContentAPI/ContentAPI.csproj b/ContentAPI/ContentAPI.csproj index f9137d0..4cafbc6 100644 --- a/ContentAPI/ContentAPI.csproj +++ b/ContentAPI/ContentAPI.csproj @@ -23,7 +23,7 @@ README.md GNU LICENSE - 0.0.4 + 0.0.5 @@ -58,13 +58,44 @@ - + - - + + + + BEPINEX + $(AssemblyName).BepInEx + + + + + + + + + $(AssemblyName) + + + + + + + + + + + + + diff --git a/ContentAPI/ContentBepinLoad.cs b/ContentAPI/ContentBepinLoad.cs index b0a1657..7c25bad 100644 --- a/ContentAPI/ContentBepinLoad.cs +++ b/ContentAPI/ContentBepinLoad.cs @@ -1,4 +1,5 @@ -namespace ContentAPI +#if BEPINEX +namespace ContentAPI { using BepInEx; using HarmonyLib; @@ -19,4 +20,5 @@ private void Awake() new Harmony(ContentGuid).PatchAll(); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/ContentAPI/ContentPlugin.cs b/ContentAPI/ContentPlugin.cs index b78d402..2bd0e28 100644 --- a/ContentAPI/ContentPlugin.cs +++ b/ContentAPI/ContentPlugin.cs @@ -22,8 +22,7 @@ public static class ContentPlugin /// /// Gets the version of the API. /// - public const string ContentVersion = "0.0.4"; - + public const string ContentVersion = "0.0.5"; /// /// Gets whether its compatible with vanilla. /// diff --git a/ContentAPI/Example/InputShowcase.cs b/ContentAPI/Example/InputShowcase.cs index 30fe54a..8d7446c 100644 --- a/ContentAPI/Example/InputShowcase.cs +++ b/ContentAPI/Example/InputShowcase.cs @@ -14,7 +14,7 @@ public class InputShowcase : Input /// public override void ProcessInput() { - Debug.Log("YOOO! The player clicked Backspace."); + Debug.Log("The player Clicked Backspace Button."); } } } \ No newline at end of file diff --git a/ContentAPI/Patches/Generic/PickupWrapPatch.cs b/ContentAPI/Patches/Generic/PickupWrapPatch.cs index ab9a79c..a6c60bc 100644 --- a/ContentAPI/Patches/Generic/PickupWrapPatch.cs +++ b/ContentAPI/Patches/Generic/PickupWrapPatch.cs @@ -27,9 +27,14 @@ private static void Postfix(PickupAPI __instance) [HarmonyPatch(typeof(PickupAPI), nameof(PickupAPI.OnDisable))] internal class PickupWrapPatch_Remove { - private static void Postfix(PickupAPI __instance) + private static void Prefix(PickupAPI __instance) { - Pickup.Items.Remove(Pickup.Get(__instance.m_itemID)); + Pickup pickup = Pickup.Get(__instance.m_itemID); + + if (pickup == null) + return; + + Pickup.Items.Remove(pickup); } } } \ No newline at end of file diff --git a/ContentAPI/ThunderAssets/manifest.json b/ContentAPI/ThunderAssets/manifest.json index 63e8254..9eb312b 100644 --- a/ContentAPI/ThunderAssets/manifest.json +++ b/ContentAPI/ThunderAssets/manifest.json @@ -1,6 +1,6 @@ { "name": "ContentAPI", - "version_number": "0.0.4", + "version_number": "0.0.5", "website_url": "https://github.com/CircusStudios/ContentAPI/", "description": "A library of tools to help developers.", "dependencies": [