43 lines
805 B
Lua
43 lines
805 B
Lua
local inferium = {}
|
|
|
|
inferium.SERVER = 'inferium.com'
|
|
inferium.FERTILIZED_ESSENCE = 'mysticalagriculture:fertilized_essence'
|
|
|
|
inferium.formatSeedName = function(essenceName)
|
|
if not essenceName then
|
|
return false
|
|
end
|
|
|
|
return 'mysticalagriculture:' .. essenceName .. '_seeds'
|
|
end
|
|
|
|
inferium.parseSeedName = function(seedName)
|
|
if not seedName then
|
|
return nil
|
|
end
|
|
|
|
local result, nbReplaced = string.gsub(seedName, 'mysticalagriculture:', '')
|
|
|
|
if nbReplaced == 0 then
|
|
return nil
|
|
end
|
|
|
|
local finalResult, nbFinalReplaced = string.gsub(result, '_seeds', '')
|
|
|
|
if nbFinalReplaced == 0 then
|
|
return nil
|
|
end
|
|
|
|
return finalResult
|
|
end
|
|
|
|
inferium.isMysticalSeed = function(seedName)
|
|
if inferium.parseSeedName(seedName) then
|
|
return true
|
|
end
|
|
|
|
return false
|
|
end
|
|
|
|
return inferium
|