





🌟 Special thanks to our amazing supporters:
✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Arch Toasty][Benedikt][David Martínez Martí]
Hello, it's another Friday, so time for another Friday Facts.
data.raw.item["transport-belt"].subgroup = "transport-belt"
data.raw.item["transport-belt"].order = "a"
data.raw.item["fast-transport-belt"].subgroup = "transport-belt"
data.raw.item["fast-transport-belt"].order = "b"
data.raw.item["express-transport-belt"].subgroup = "transport-belt"
data.raw.item["express-transport-belt"].order = "c"
This is a typical situation, where the fact that our data definition is done in a scripting language can be taken advantage of. We can just replace the previous code by more generic variant.
for index, recipe in pairs(data.raw.recipe) do
-- Assuming the name of the entity is the same as name of the recipe, it could be solved more precisely
if data.raw["transport-belt"][recipe.name] then
recipe.subgroup = "transport-belt"
end
end
The code goes through all the recipes and whenever its result is a transport belt, it is moved to the correct category. This way, all the possible other transport belts added by other mods will go there and my change of categories doesn't actually make more problems than it solves. This is a shoutout to the mod devs so they try to be reasonable with the crafting categories, so it doesn't happen that often that [ 6084 ]
[ 1345 ]
[ 4067 ]