public void OnHandClick(GUIHand hand) { EnergyMixin mixin = shark.energyInterface.sources[0]; if (mixin.HasItem() && mixin.charge == 0f) { InventoryItem item = mixin.batterySlot.storedItem; mixin.batterySlot.RemoveItem(); Destroy(item.item.gameObject); Pickupable ionCube = CraftData.InstantiateFromPrefab(Shark.depletedIonCube).GetComponent <Pickupable>(); ionCube.transform.position = transform.position + transform.up; if (Player.main.HasInventoryRoom(ionCube)) { Inventory.main.Pickup(ionCube); } } if (!mixin.HasItem()) { if (Inventory.main.GetPickupCount(TechType.PrecursorIonCrystal) >= 1) { Inventory.main.container.RemoveItem(TechType.PrecursorIonCrystal); Pickupable battery = CraftData.InstantiateFromPrefab(Shark.internalBattery).GetComponent <Pickupable>(); InventoryItem item = mixin.batterySlot.AddItem(battery); mixin.NotifyHasBattery(item); } } }