Finnaly fix #65
This commit is contained in:
parent
d1898c0d63
commit
b5a1ed0ec9
1 changed files with 19 additions and 5 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue