using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Unity.Mono;
using Crafting.Inventory;
using Interactions.Interactibles.Interaction_LIsteners;
using Scriptable_Objects;
using Terrain.Platforms.Population;
using Terrain.Platforms.Population.Nature;
using UnityEngine;
using Utilities;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
public class Beehive : PopNatureBeeHive
{
private float LastHarvest;
public InteractibleMeta InteractibleScript;
private bool IsHarvestable => TimeRef.WorldTime - LastHarvest >= base.HarvestCooldownMinutes * 60f;
public void Event_TryHarvest()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
if (IsHarvestable)
{
CraftingCostClass[] onHarvestItems = base.OnHarvestItems;
foreach (CraftingCostClass val in onHarvestItems)
{
Inventory.Pickup(val.ItemID, val.Qty);
}
LastHarvest = TimeRef.WorldTime;
((PopulationObjectAbstract)this).RefreshCustomValues();
}
}
protected override void RefreshCustomValues()
{
if ((Object)(object)base.FullOfHoneyObj != (Object)null)
{
base.FullOfHoneyObj.SetActive(IsHarvestable);
}
if ((Object)(object)InteractibleScript != (Object)null)
{
InteractibleScript.ToggleInteractible(IsHarvestable);
}
}
}
[BepInPlugin("beeboxes.sessional.dev", "beeboxes", "1.0")]
public class Plugin : BaseUnityPlugin
{
}