This commit is contained in:
SpeeeDCraft 2023-11-14 22:19:55 +07:00
parent 1387978d9c
commit ca286391da
4 changed files with 113 additions and 104 deletions

View file

@ -1,11 +1,5 @@
// priority: 0
const emptyJson = {
conditions: [
{ type: "forge:false" }
]
}
const registerTFCItemHeats = (event) => {
for (const [tfcMetalName, metalSpecifications] of Object.entries(Metals)) {
metalSpecifications.props.forEach(propertyName => {
@ -25,61 +19,6 @@ const registerTFCItemHeats = (event) => {
forging_temperature: metalSpecifications.forging_temp,
welding_temperature: metalSpecifications.welding_temp
}
event.addJson(path, json)
}
})
}
}
const registerTFCHeatingRecipes = (event) => {
for (const [tfcMetalName, metalSpecifications] of Object.entries(Metals)) {
metalSpecifications.props.forEach(propertyName => {
let path = `tfc:recipes/metal/${tfcMetalName}_${propertyName}`
let itemType = ItemHeats[propertyName]
let metalName = (metalSpecifications.customName != undefined) ? metalSpecifications.customName : tfcMetalName
if (itemType.heat_capacity == null) {
event.addJson(path, emptyJson)
}
else {
let ingredient = itemType.input(metalName)
let json
if (typeof(itemType.metal_amount) == "object")
{
console.log(itemType.metal_amount)
if (itemType.metal_amount[metalName] != undefined)
{
let customMetalName = itemType.metal_amount[metalName].metalName
let metalAmount = itemType.metal_amount[metalName].amount
json = {
type: "tfc:heating",
ingredient: ingredient,
result_fluid: {
fluid: `gtceu:${customMetalName}`,
amount: metalAmount
},
temperature: metalSpecifications.melt_temp,
use_durability: (propertyName.includes('head') || propertyName.includes('blade')) ? true : false
}
}
}
else {
json = {
type: "tfc:heating",
ingredient: ingredient,
result_fluid: {
fluid: `gtceu:${metalName}`,
amount: itemType.metal_amount
},
temperature: metalSpecifications.melt_temp,
use_durability: (propertyName.includes('head') || propertyName.includes('blade')) ? true : false
}
}
event.addJson(path, json)
}
})
@ -88,5 +27,4 @@ const registerTFCHeatingRecipes = (event) => {
const registerTFCData = (event) => {
registerTFCItemHeats(event)
registerTFCHeatingRecipes(event)
}