public static bool OnHandClick_Prefix(GrownPlant __instance, GUIHand hand) { if (__instance.seed != null && __instance.seed.gameObject != null) { PrefabIdentifier prefabID = __instance.seed.gameObject.GetComponent <PrefabIdentifier>(); if (prefabID == null) { return(true); } if (prefabID.ClassId == "MarbleMelonTiny") { PlantGenericController controllerA = __instance.gameObject.GetComponent <PlantGenericController>(); if (controllerA == null) { controllerA = __instance.seed.gameObject.GetComponent <PlantGenericController>(); } if (controllerA != null && controllerA._progress >= 1.0f) { if (__instance.seed.currentPlanter != null && Inventory.Get().HasRoomFor(1, 1)) { __instance.seed.currentPlanter.RemoveItem(__instance.seed); if (global::Utils.GetSubRoot() != null) { __instance.seed.pickupable.destroyOnDeath = false; } SkyEnvironmentChanged.Send(__instance.seed.pickupable.gameObject, Player.main.GetSkyEnvironment()); UnityEngine.Object.Destroy(__instance.seed.pickupable.gameObject); CraftData.AddToInventorySync(CrafterLogicFixer.MarbleMelonTinyFruit, 1, false, false); hand.player.PlayGrab(); } } return(false); } else if (prefabID.ClassId == "MarbleMelonTinyFruit") { if (__instance.seed.currentPlanter != null && __instance.seed.pickupable != null && Inventory.Get().HasRoomFor(__instance.seed.pickupable)) { PlantGenericController controllerA = __instance.gameObject.GetComponent <PlantGenericController>(); if (controllerA == null) { controllerA = __instance.seed.gameObject.GetComponent <PlantGenericController>(); } if (controllerA != null && controllerA._progress >= 1.0f) { __instance.seed.currentPlanter.RemoveItem(__instance.seed); Inventory.Get().Pickup(__instance.seed.pickupable, false); hand.player.PlayGrab(); } } return(false); } } return(true); }