public static void MechaDrone_Update_Postfix(MechaDrone __instance, ref int __result, PrebuildData[] prebuildPool, Vector3 playerPos, float dt, ref double energy, ref double energyChange, double energyRate)
        {
            if (__result == 1)  // If the Prebuild would normally complete...
            {
                int          prebuildId = -__instance.targetObject;
                PrebuildData prebuild   = prebuildPool[prebuildId];
                if (isDroneClearingPrebuild(prebuild))
                {
                    PlanetFactory factory = GameMain.mainPlayer.factory;

                    DroneClearingMissionData missionData = null;
                    for (int activeMissionIdx = 0; activeMissionIdx < activeMissions.Count; ++activeMissionIdx)
                    {
                        missionData = activeMissions[activeMissionIdx];
                        if (missionData.prebuildId == prebuildId)
                        {
                            if (missionData.mineAction.miningType == EObjectType.Entity)
                            {
                                // Clearing completed
                                activeMissions.RemoveAt(activeMissionIdx);
                                factory.RemovePrebuildData(prebuildId);
                            }
                            else
                            {
                                __result = 0;
                            }
                            return;
                        }
                    }

                    if (configCollectResourcesFlag)
                    {
                        missionData                       = new DroneClearingMissionData();
                        missionData.prebuildId            = prebuildId;
                        missionData.forward               = __instance.forward;
                        missionData.position              = __instance.position;
                        missionData.mineAction            = new DroneAction_Mine();
                        missionData.mineAction.player     = GameMain.mainPlayer;
                        missionData.mineAction.miningType = EObjectType.Vegetable;
                        missionData.mineAction.miningId   = prebuild.upEntity;
                        missionData.mineAction.miningTick = 0;
                        activeMissions.Add(missionData);
                    }
                    else
                    {
                        factory.RemovePrebuildData(prebuildId);
                        factory.RemoveVegeWithComponents(prebuild.upEntity);
                    }

                    __result = 0;
                    return;
                }
            }
        }