diff --git a/kubejs/server_scripts/tfc/utility.js b/kubejs/server_scripts/tfc/utility.js index cfc2dc27e..c61fb4426 100644 --- a/kubejs/server_scripts/tfc/utility.js +++ b/kubejs/server_scripts/tfc/utility.js @@ -50,12 +50,26 @@ const addEmptyJson = (event, path) => { */ const addItemHeat = (event, customPath, input, heat_capacity, forging_temperature, welding_temperature) => { const defaultPath = `tfc:tfc/item_heats/` - const json = { - ingredient: input, - heat_capacity: heat_capacity, - forging_temperature: forging_temperature, - welding_temperature: welding_temperature + let json + + if (forging_temperature == null || welding_temperature == null) + { + json = { + ingredient: input, + heat_capacity: heat_capacity + } } + else + { + json = { + ingredient: input, + heat_capacity: heat_capacity, + forging_temperature: forging_temperature, + welding_temperature: welding_temperature + } + } + + event.addJson((customPath == null) ? defaultPath + makeId(20) : defaultPath + customPath, json) }