-- BaleFermentation_Grass_fermented.lua
-- Version 1.1.0.0
-- Autor: Tidde23

BaleFermentationOverride = {}

local BaleFermentationOverride_mt = Class(BaleFermentationOverride)

function BaleFermentationOverride.loadFillTypesFromXML(fillTypes, xmlFile, baseDirectory)
    for _, fillTypeInfo in ipairs(fillTypes) do
        local fillTypeName = g_fillTypeManager:getFillTypeNameByIndex(fillTypeInfo.fillTypeIndex)
        if fillTypeName == "GRASS_WINDROW" and fillTypeInfo.fermenting ~= nil then
            local newOutputIndex = g_fillTypeManager:getFillTypeIndexByName("GRASS_FERMENTED")
            if newOutputIndex ~= nil then
                fillTypeInfo.fermenting.outputFillTypeIndex = newOutputIndex
            end
        end
    end
end

Bale.loadFillTypesFromXML = Utils.appendedFunction(Bale.loadFillTypesFromXML, BaleFermentationOverride.loadFillTypesFromXML)
