Refactor of material recipes (#2732)

* refactor

* phew

* drive-by fix

* all done I think

* cleaned up some lines that didn't do anything, added more comments, removed log spam
This commit is contained in:
Pyritie 2026-01-14 21:36:52 +00:00 committed by GitHub
parent 8c6551dda6
commit 2e10938e1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 2107 additions and 3303 deletions

View file

@ -27,7 +27,7 @@
{
"type": "patchouli:text",
"title": "Bastions",
"text": "Raiding a $(thing)Bastion$() might be very dangerous, but they can also be very rewarding! You can find things like:$(li)Gold, Rose Gold, Pig Iron, Black Bronze, and Silver ingots$(li)Black Bronze weapons, tools, and armor$(li)Kaolin clay and graphite$(li)Permanent light sources$(li)Cloth, leather, seeds, and food$(li)And other treasures!"
"text": "Raiding a $(thing)Bastion$() might be very dangerous, but they can also be very rewarding! You can find things like:$(li)Gold, Rose Gold, Pig Iron, Black Bronze, and Silver ingots$(li)Black Bronze weapons, tools, and armor$(li)Kaolin clay and graphite$(li)Lanterns$(li)Cloth, leather, seeds, and food$(li)And other treasures!"
},
{
"type": "patchouli:spotlight",

View file

@ -394,13 +394,6 @@ const registerFirmaLifeRecipes = (event) => {
//#endregion
//#region Plated blocks
generatePlatedBlockRecipe(event, GTMaterials.Chromium);
generatePlatedBlockRecipe(event, GTMaterials.StainlessSteel);
// #endregion
// #region Drying mat alternatives
event.shaped('firmalife:drying_mat', ['AAA'], { A: 'tfc:plant/leafy_kelp' }).id('tfg:shaped/drying_mat_leafy_kelp')

View file

@ -7,7 +7,6 @@
*/
const registerGTCEURecipes = (event) => {
registerGTCEUMetalRecipes(event)
registerGTCEURecyclingRecipes(event)
registerGTCEuMachineRecipes(event)

File diff suppressed because it is too large Load diff

View file

@ -778,6 +778,7 @@ function removeGTCEURecipes(event) {
event.remove({ id: 'greate:mixing/integration/gtceu/mixer/mossy_red_granite_cobblestone_from_vine' })
event.remove({ id: 'gtceu:lathe/stone_rod_from_cobblestone' })
event.remove({ id: 'gtceu:extractor/extract_sodium_hydroxide_dust' })
// who the hell is grinding metal ingots with their bare hands?
event.remove({ id: 'gtceu:shaped/mortar_grind_antimony' })

View file

@ -66,135 +66,6 @@ const generateCutterRecipe = (event, input, output, duration, EUt, id) => {
//#endregion
//#region Filling NBT
/**
* Function to get fluid filling NBT.
*
* @param {string} material -Fluid
* @param {number} amount -mB
* @returns {{ tank: { FluidName: string; Amount: number; }; }}
*/
const getFillingNBT = (material, amount) => {
return {
tank: {
FluidName: Fluid.of(material.getFluid()).getId(),
Amount: amount
}
}
}
//#endregion
//#region Plated Blocks
/**
* Function for generating plated block recipes.
*
* @param {*} event
* @param {GTMaterial} material
*/
function generatePlatedBlockRecipe(event, material) {
// firmaciv plated blocks don't have this property
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
const outputMaterial = (tfcProperty === null || tfcProperty.getOutputMaterial() === null) ? material : tfcProperty.getOutputMaterial()
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
const platedBlock = ChemicalHelper.get(TFGTagPrefix.blockPlated, material, 1);
const platedSlab = ChemicalHelper.get(TFGTagPrefix.slabPlated, material, 1);
const platedStair = ChemicalHelper.get(TFGTagPrefix.stairPlated, material, 1);
if (platedBlock === null) return;
let tfcMetalName = material.getName();
if (tfcMetalName === "iron") {
tfcMetalName = "cast_iron";
}
event.shapeless(platedBlock, ['#forge:stone_bricks', plateItem, '#forge:tools/hammers'])
.id(`tfg:shapeless/${material.getName()}_plated_block`)
event.recipes.gtceu.assembler(`tfg:${material.getName()}_plated_block`)
.itemInputs('#forge:stone_bricks', plateItem)
.itemOutputs(platedBlock)
.circuit(10)
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
if (tfcProperty !== null) {
event.recipes.tfc.heating(platedBlock, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), 144))
.id(`tfc:heating/metal/${tfcMetalName}_block`)
}
event.recipes.gtceu.macerator(`tfg:${material.getName()}_plated_block`)
.itemInputs(platedBlock)
.itemOutputs(ChemicalHelper.get(TagPrefix.dust, material, 1))
.duration(material.getMass())
.category(GTRecipeCategories.MACERATOR_RECYCLING)
.EUt(GTValues.VA[GTValues.ULV])
event.recipes.gtceu.arc_furnace(`tfg:${material.getName()}_plated_block`)
.itemInputs(platedBlock)
.itemOutputs(ChemicalHelper.get(TagPrefix.ingot, material, 1))
.duration(material.getMass())
.category(GTRecipeCategories.ARC_FURNACE_RECYCLING)
.EUt(GTValues.VA[GTValues.LV])
event.shapeless(platedSlab.withCount(2), ['2x #tfg:brick_slabs', plateItem, '#forge:tools/hammers'])
.id(`tfg:item_application/${material.getName()}_plated_slab`)
event.recipes.gtceu.assembler(`tfg:${material.getName()}_plated_slab`)
.itemInputs('2x #tfg:brick_slabs', plateItem)
.itemOutputs(platedSlab.withCount(2))
.circuit(10)
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
if (tfcProperty !== null) {
// Slabs are lossy because it's possible to plate a double slab block with one metal plate
event.recipes.tfc.heating(platedSlab, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), 72))
.id(`tfc:heating/metal/${tfcMetalName}_block_slab`)
}
event.recipes.gtceu.macerator(`tfg:${material.getName()}_plated_slab`)
.itemInputs(platedSlab)
.itemOutputs(ChemicalHelper.get(TagPrefix.dustSmall, material, 2))
.duration(material.getMass())
.category(GTRecipeCategories.MACERATOR_RECYCLING)
.EUt(GTValues.VA[GTValues.ULV])
event.recipes.gtceu.arc_furnace(`tfg:${material.getName()}_plated_slab`)
.itemInputs(platedSlab)
.itemOutputs(ChemicalHelper.get(TagPrefix.nugget, material, 4))
.duration(material.getMass())
.category(GTRecipeCategories.ARC_FURNACE_RECYCLING)
.EUt(GTValues.VA[GTValues.LV])
event.shapeless(platedStair, ['#tfg:brick_stairs', plateItem, '#forge:tools/hammers'])
.id(`tfg:item_application/${material.getName()}_plated_stair`)
event.recipes.gtceu.assembler(`tfg:${material.getName()}_plated_stair`)
.itemInputs('#tfg:brick_stairs', plateItem)
.itemOutputs(platedStair)
.circuit(10)
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
if (tfcProperty !== null) {
event.recipes.tfc.heating(platedStair, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), 144))
.id(`tfc:heating/metal/${tfcMetalName}_block_stairs`)
}
event.recipes.gtceu.macerator(`tfg:${material.getName()}_plated_stair`)
.itemInputs(platedStair)
.itemOutputs(ChemicalHelper.get(TagPrefix.dust, material, 1))
.duration(material.getMass())
.category(GTRecipeCategories.MACERATOR_RECYCLING)
.EUt(GTValues.VA[GTValues.ULV])
event.recipes.gtceu.arc_furnace(`tfg:${material.getName()}_plated_stair`)
.itemInputs(platedStair)
.itemOutputs(ChemicalHelper.get(TagPrefix.ingot, material, 1))
.duration(material.getMass())
.category(GTRecipeCategories.ARC_FURNACE_RECYCLING)
.EUt(GTValues.VA[GTValues.LV])
}
//#endregion
//#region forEachMaterial
/**
* Function for iterating through registered materials

View file

@ -278,6 +278,7 @@ ServerEvents.recipes(event => {
registerTFCGurmanRecipes(event)
registerTFGRecipes(event)
registerTFCTextileRecipes(event)
registerTFCScrapingKnivesRecipes(event)
registerToolBeltRecipes(event)
registerVintageImprovementsRecipes(event)
registerWaterFlasksRecipes(event)

View file

@ -1,46 +1,45 @@
"use strict";
const registerRnrRecipes = (event) => {
event.remove({input: 'rnr:concrete_powder'})
event.remove({id: 'rnr:crafting/concrete_powder'})
event.remove({ input: 'rnr:concrete_powder' })
event.remove({ id: 'rnr:crafting/concrete_powder' })
//#region Recipes
event.recipes.gtceu.assembler('rnr:assembler/base_course')
event.recipes.gtceu.assembler('rnr:assembler/base_course')
.itemInputs('1x rnr:crushed_base_course', '1x #tfc:dirt')
.itemOutputs('2x rnr:base_course')
.circuit(7)
.circuit(7)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
event.recipes.gtceu.assembler('rnr:assembler/crushed_base_course')
event.recipes.gtceu.assembler('rnr:assembler/crushed_base_course')
.itemInputs('1x #forge:gravel', '1x #rnr:loose_rock_items')
.itemOutputs('8x rnr:crushed_base_course')
.circuit(7)
.circuit(7)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
global.TFC_STONE_TYPES.forEach(stone => {
event.recipes.gtceu.cutter(`rnr:assembler/flagstone/${stone}`)
.itemInputs(`tfc:brick/${stone}`)
.itemOutputs(`2x rnr:flagstone/${stone}`)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
global.TFC_STONE_TYPES.forEach(stone => {
event.recipes.gtceu.cutter(`rnr:assembler/flagstone/${stone}`)
.itemInputs(`tfc:brick/${stone}`)
.itemOutputs(`2x rnr:flagstone/${stone}`)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
event.recipes.gtceu.cutter(`rnr:assembler/flagstone/mossy_${stone}`)
.itemInputs(`tfc:rock/mossy_loose/${stone}`)
.itemOutputs(`2x rnr:flagstone/${stone}`)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
});
event.recipes.gtceu.cutter(`rnr:assembler/flagstone/mossy_${stone}`)
.itemInputs(`tfc:rock/mossy_loose/${stone}`)
.itemOutputs(`2x rnr:flagstone/${stone}`)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
});
global.SAND_COLORS.forEach(sand => {
event.recipes.gtceu.assembler(`rnr:assembler/flagstone/${sand}_sandstone`)
.itemInputs(`tfc:raw_sandstone/${sand}`)
.itemOutputs(`8x rnr:flagstone/${sand}_sandstone`)
.circuit(7)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
});
global.SAND_COLORS.forEach(sand => {
event.recipes.gtceu.assembler(`rnr:assembler/flagstone/${sand}_sandstone`)
.itemInputs(`tfc:raw_sandstone/${sand}`)
.itemOutputs(`8x rnr:flagstone/${sand}_sandstone`)
.circuit(7)
.duration(20)
.EUt(GTValues.VA[GTValues.ULV])
});
event.smelting(
'1x rnr:terracotta_roof_tile',
@ -51,10 +50,10 @@ const registerRnrRecipes = (event) => {
'1x rnr:ceramic_roof_tile',
'rnr:unfired_roof_tile'
).id('rnr:smelting/unfired_roof_tile')
event.remove({id: 'rnr:clay_knapping/roof_tile_a'})
event.remove({id: 'rnr:clay_knapping/roof_tile_b'})
event.remove({id: 'rnr:clay_knapping/roof_tile_c'})
event.remove({ id: 'rnr:clay_knapping/roof_tile_a' })
event.remove({ id: 'rnr:clay_knapping/roof_tile_b' })
event.remove({ id: 'rnr:clay_knapping/roof_tile_c' })
event.recipes.tfc.knapping('10x rnr:unfired_roof_tile', 'tfc:clay', [
'XXXXX',
@ -84,7 +83,7 @@ const registerRnrRecipes = (event) => {
event.recipes.gtceu.mixer('rnr:mixer/wet_concrete_mix')
.inputFluids('gtceu:concrete 200', "#tfg:clean_water 800")
.outputFluids('rnr:concrete 1000')
.circuit(7)
.circuit(7)
.duration(200)
.EUt(GTValues.VA[GTValues.ULV])
};

View file

@ -247,23 +247,45 @@ const registerSNSRecipes = (event) => {
.circuit(4)
.duration(40)
.EUt(GTValues.VA[GTValues.LV])
event.custom({
type: "createaddition:rolling",
input: ChemicalHelper.get(TagPrefix.rod, GTMaterials.Steel, 1),
result: 'sns:metal/horseshoe/steel'
}).id(`tfg:rolling/steel_horseshoe`)
event.recipes.gtceu.bender('sns:horseshoe_black_steel_electric_only')
.itemInputs('#forge:rods/black_steel')
.itemOutputs('sns:metal/horseshoe/black_steel')
.circuit(4)
.duration(40)
.EUt(GTValues.VA[GTValues.LV])
event.custom({
type: "createaddition:rolling",
input: ChemicalHelper.get(TagPrefix.rod, GTMaterials.BlackSteel, 1),
result: 'sns:metal/horseshoe/black_steel'
}).id(`tfg:rolling/black_steel_horseshoe`)
event.recipes.gtceu.bender('sns:horseshoe_blue_steel_electric_only')
.itemInputs('#forge:rods/blue_steel')
.itemOutputs('sns:metal/horseshoe/blue_steel')
.circuit(4)
.duration(40)
.EUt(GTValues.VA[GTValues.LV])
event.custom({
type: "createaddition:rolling",
input: ChemicalHelper.get(TagPrefix.rod, GTMaterials.BlueSteel, 1),
result: 'sns:metal/horseshoe/blue_steel'
}).id(`tfg:rolling/blue_steel_horseshoe`)
event.recipes.gtceu.bender('sns:horseshoe_red_steel_electric_only')
.itemInputs('#forge:rods/red_steel')
.itemOutputs('sns:metal/horseshoe/red_steel')
.circuit(4)
.duration(40)
.EUt(GTValues.VA[GTValues.LV])
event.custom({
type: "createaddition:rolling",
input: ChemicalHelper.get(TagPrefix.rod, GTMaterials.RedSteel, 1),
result: 'sns:metal/horseshoe/red_steel'
}).id(`tfg:rolling/red_steel_horseshoe`)
}

View file

@ -8,55 +8,11 @@
const registerTFCRecipes = (event) => {
removeTFCRecipes(event)
registerTFCMaterialsRecipes(event)
registerTFCMetalsRecipes(event)
registerTFCDyeRecipes(event)
// Добавление рецептов
const TFC_QUERN_POWDER_RECIPE_COMPONENTS = /** @type {const} */ ([
{ input: "#forge:dusts/coke", output: "4x tfc:powder/coke", name: "coke_powder" },
{ input: "#forge:dusts/amethyst", output: "4x tfc:powder/amethyst", name: "amethyst_powder" },
{ input: "#forge:dusts/diamond", output: "4x tfc:powder/diamond", name: "diamond_powder" },
{ input: "#forge:dusts/emerald", output: "4x tfc:powder/emerald", name: "emerald_powder" },
{ input: "#forge:dusts/lapis", output: "4x tfc:powder/lapis_lazuli", name: "lapis_powder" },
{ input: "#forge:dusts/opal", output: "4x tfc:powder/opal", name: "opal_powder" },
{ input: "#forge:dusts/pyrite", output: "4x tfc:powder/pyrite", name: "pyrite_powder" },
{ input: "#forge:dusts/ruby", output: "4x tfc:powder/ruby", name: "ruby_powder" },
{ input: "#forge:dusts/sapphire", output: "4x tfc:powder/sapphire", name: "sapphire_powder" },
{ input: "#forge:dusts/topaz", output: "4x tfc:powder/topaz", name: "topaz_powder" },
{ input: "#forge:dusts/gold", output: "4x tfc:powder/native_gold", name: "gold_powder" },
{ input: "#forge:dusts/silver", output: "4x tfc:powder/native_silver", name: "silver_powder" },
{ input: "#forge:dusts/copper", output: "4x tfc:powder/native_copper", name: "copper_powder" },
{ input: "#forge:dusts/cassiterite", output: "4x tfc:powder/cassiterite", name: "cassiterite_powder" },
{ input: "#forge:dusts/bismuth", output: "4x tfc:powder/bismuthinite", name: "bismuth_powder" },
{ input: "#forge:dusts/garnierite", output: "4x tfc:powder/garnierite", name: "garnierite_powder" },
{ input: "#forge:dusts/sphalerite", output: "4x tfc:powder/sphalerite", name: "sphalerite_powder" },
{ input: "#forge:dusts/magnetite", output: "4x tfc:powder/magnetite", name: "magnetite_powder" },
{ input: "#forge:dusts/tetrahedrite", output: "4x tfc:powder/tetrahedrite", name: "tetrahedrite_powder" },
{ input: "#forge:dusts/malachite", output: "4x tfc:powder/malachite", name: "malachite_powder" },
{ input: "#forge:dusts/yellow_limonite", output: "4x tfc:powder/limonite", name: "limonite_powder" },
{ input: "#forge:dusts/hematite", output: "4x tfc:powder/hematite", name: "hematite_powder" },
{ input: "#forge:dusts/sulfur", output: "4x tfc:powder/sulfur", name: "sulfur_powder" },
{ input: "#forge:dusts/saltpeter", output: "4x tfc:powder/saltpeter", name: "saltpeter_powder" },
{ input: "#forge:dusts/salt", output: "4x tfc:powder/salt", name: "salt_powder" },
{ input: "#forge:dusts/rock_salt", output: "4x tfc:powder/sylvite", name: "rock_salt" },
{ input: "#forge:dusts/graphite", output: "4x tfc:powder/graphite", name: "graphite_powder" },
{ input: "#forge:dusts/borax", output: "4x tfc:powder/flux", name: "flux_powder" },
{ input: "#forge:dusts/soda_ash", output: "4x tfc:powder/soda_ash", name: "soda_ash" },
{ input: "#forge:dusts/charcoal", output: "4x tfc:powder/charcoal", name: "charcoal" },
{ input: "tfc:ore/sylvite", output: "4x tfc:powder/sylvite", name: "sylvite" },
]);
event.remove({ mod: 'tfc', type: 'tfc:casting' });
TFC_QUERN_POWDER_RECIPE_COMPONENTS.forEach(element => {
event.recipes.gtceu.macerator(`tfg:${element.name}`)
.itemInputs(element.input)
.itemOutputs(element.output)
.duration(60)
.EUt(2)
event.recipes.tfc.quern(element.output, element.input)
.id(`tfg:quern/${element.name}`)
})
// Доменная печь
event.recipes.gtceu.shaped('tfc:blast_furnace', [
'AAA',

File diff suppressed because it is too large Load diff

View file

@ -48,68 +48,6 @@ function registerTFCMetalsRecipes(event) {
//#endregion
//#region Фикс рецептов колоколов
//#region Из золота
event.recipes.tfc.casting(`minecraft:bell`, 'tfc:ceramic/bell_mold', Fluid.of('gtceu:gold', 144), 1)
.id(`tfc:casting/gold_bell`)
event.recipes.tfc.heating(`minecraft:bell`, 1060)
.resultFluid(Fluid.of('gtceu:gold', 144))
.id(`tfc:heating/gold_bell`)
event.recipes.create.filling(
Item.of('tfc:ceramic/bell_mold', getFillingNBT(GTMaterials.Gold, 144)),
[
Fluid.of(GTMaterials.Gold.getFluid(), 144),
Item.of('tfc:ceramic/bell_mold').strongNBT()
]
).id(`tfg:tfc/filling/${GTMaterials.Gold.getName()}_bell_mold`)
//#endregion
//#region Из латуни
event.recipes.tfc.casting(`tfc:brass_bell`, 'tfc:ceramic/bell_mold', Fluid.of('gtceu:brass', 144), 1)
.id(`tfc:casting/brass_bell`)
event.recipes.tfc.heating(`tfc:brass_bell`, 930)
.resultFluid(Fluid.of('gtceu:brass', 144))
.id(`tfc:heating/brass_bell`)
event.recipes.create.filling(
Item.of('tfc:ceramic/bell_mold', getFillingNBT(GTMaterials.Brass, 144)),
[
Fluid.of(GTMaterials.Brass.getFluid(), 144),
Item.of('tfc:ceramic/bell_mold').strongNBT()
]
).id(`tfg:tfc/filling/${GTMaterials.Brass.getName()}_bell_mold`)
//#endregion
//#region Из бронзы
event.recipes.tfc.casting(`tfc:bronze_bell`, 'tfc:ceramic/bell_mold', Fluid.of('gtceu:bronze', 144), 1)
.id(`tfc:casting/bronze_bell`)
event.recipes.tfc.heating(`tfc:bronze_bell`, 930)
.resultFluid(Fluid.of('gtceu:bronze', 144))
.id(`tfc:heating/bronze_bell`)
event.recipes.create.filling(
Item.of('tfc:ceramic/bell_mold', getFillingNBT(GTMaterials.Bronze, 144)),
[
Fluid.of(GTMaterials.Bronze.getFluid(), 144),
Item.of('tfc:ceramic/bell_mold').strongNBT()
]
).id(`tfg:tfc/filling/${GTMaterials.Bronze.getName()}_bell_mold`)
//#endregion
//#endregion
//#region Рецепты ковки TFC слитков в GT машинах
// Сырая крица -> Укрепленная крица
@ -162,6 +100,8 @@ function registerTFCMetalsRecipes(event) {
.EUt(4)
// Слабая сталь + Чугун -> Высокоуглеродная черная сталь
event.recipes.tfc.welding('tfc:metal/ingot/high_carbon_black_steel', 'tfc:metal/ingot/weak_steel', 'tfc:metal/ingot/pig_iron', 4)
event.recipes.greate.compacting('tfc:metal/ingot/high_carbon_black_steel',
['tfc:metal/ingot/weak_steel', 'tfc:metal/ingot/pig_iron', 'tfc:powder/flux'])
.heated()
@ -175,6 +115,8 @@ function registerTFCMetalsRecipes(event) {
.EUt(4)
// Слабая синяя сталь + Черная сталь -> Высокоуглеродная синяя сталь
event.recipes.tfc.welding('tfc:metal/ingot/high_carbon_blue_steel', 'tfc:metal/ingot/weak_blue_steel', 'tfc:metal/ingot/black_steel', 5)
event.recipes.greate.compacting('tfc:metal/ingot/high_carbon_blue_steel',
['tfc:metal/ingot/weak_blue_steel', 'tfc:metal/ingot/black_steel', 'tfc:powder/flux'])
.heated()
@ -188,6 +130,8 @@ function registerTFCMetalsRecipes(event) {
.EUt(4)
// Слабая красная сталь + Черная сталь -> Высокоуглеродная красная сталь
event.recipes.tfc.welding('tfc:metal/ingot/high_carbon_red_steel', 'tfc:metal/ingot/weak_red_steel', 'tfc:metal/ingot/black_steel', 5)
event.recipes.greate.compacting('tfc:metal/ingot/high_carbon_red_steel',
['tfc:metal/ingot/weak_red_steel', 'tfc:metal/ingot/black_steel', 'tfc:powder/flux'])
.heated()
@ -370,33 +314,4 @@ function registerTFCMetalsRecipes(event) {
event.smelting('minecraft:iron_ingot', '#forge:ingots/wrought_iron')
.id('tfg:revert_wrought_iron_ingot')
// Melting powders
const METAL_POWDERS = [
{ powder: 'tfc:powder/native_copper', material: GTMaterials.Copper },
{ powder: 'tfc:powder/native_gold', material: GTMaterials.Gold },
{ powder: 'tfc:powder/hematite', material: GTMaterials.Hematite },
{ powder: 'tfc:powder/native_silver', material: GTMaterials.Silver },
{ powder: 'tfc:powder/cassiterite', material: GTMaterials.Cassiterite },
{ powder: 'tfc:powder/bismuthinite', material: GTMaterials.Bismuth },
{ powder: 'tfc:powder/garnierite', material: GTMaterials.Garnierite },
{ powder: 'tfc:powder/malachite', material: GTMaterials.Malachite },
{ powder: 'tfc:powder/magnetite', material: GTMaterials.Magnetite },
{ powder: 'tfc:powder/limonite', material: GTMaterials.YellowLimonite },
{ powder: 'tfc:powder/sphalerite', material: GTMaterials.Sphalerite },
{ powder: 'tfc:powder/tetrahedrite', material: GTMaterials.Tetrahedrite },
{ powder: 'tfc:powder/pyrite', material: GTMaterials.Pyrite }
]
METAL_POWDERS.forEach(x => {
const tfcProperty = x.material.getProperty(TFGPropertyKey.TFC_PROPERTY)
let outputMaterial = (tfcProperty.getOutputMaterial() === null) ? x.material : tfcProperty.getOutputMaterial()
event.recipes.tfc.heating(x.powder, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), global.calcAmountOfMetalProcessed(36, tfcProperty.getPercentOfMaterial())))
.id(`tfg:heating/powder/${x.material.getName()}`)
})
}

View file

@ -3,58 +3,47 @@
function removeTFCRecipes(event) {
// Удаление рецептов руд TFC
event.remove({ id: /tfc:heating\/ore\/poor_*/ })
event.remove({ id: /tfc:heating\/ore\/normal_*/ })
event.remove({ id: /tfc:heating\/ore\/rich_*/ })
global.TFC_DISABLED_ITEMS.forEach(item => {
event.remove({ input: item })
event.remove({ output: item })
})
event.remove({ mod: 'tfc', type: 'tfc:welding' })
event.remove({ id: /tfc:heating\/metal\/*/ })
event.remove({ id: /tfc:heating\/ore\/*/ })
// Удаление рецептов блоков
event.remove({ id: /tfc:crafting\/metal\/block\/*/ })
event.remove({ id: /tfc:heating\/metal\/*_block/ })
// Удаление рецептов ступеней
event.remove({ id: /tfc:crafting\/metal\/block\/*_stairs/ })
event.remove({ id: /tfc:heating\/metal\/*_block_stairs/ })
// Удалание рецептов полублоков
event.remove({ id: /tfc:crafting\/metal\/block\/*_slab/ })
event.remove({ id: /tfc:heating\/metal\/*_block_slab/ })
//#region Удаление рецептов для предметов из Cast Iron
// Блок
event.remove({ id: `tfc:crafting/metal/block/cast_iron` })
event.remove({ id: `tfc:heating/metal/cast_iron_block` })
// Ступень
event.remove({ id: `tfc:crafting/metal/block/cast_iron_stairs` })
event.remove({ id: `tfc:heating/metal/cast_iron_block_stairs` })
// Полублок
event.remove({ id: `tfc:crafting/metal/block/cast_iron_slab` })
event.remove({ id: `tfc:heating/metal/cast_iron_block_slab` })
// Слиток
event.remove({ id: `tfc:casting/cast_iron_ingot` })
event.remove({ id: `tfc:casting/cast_iron_fire_ingot` })
event.remove({ id: `tfc:heating/metal/cast_iron_ingot` })
event.remove({ id: `tfc:welding/cast_iron_double_ingot` })
event.remove({ id: `tfc:anvil/cast_iron_rod` })
// Двойной слиток
event.remove({ id: `tfc:heating/metal/cast_iron_double_ingot` })
event.remove({ id: `tfc:anvil/cast_iron_sheet` })
// Пластина
event.remove({ id: `tfc:heating/metal/cast_iron_sheet` })
event.remove({ id: `tfc:welding/cast_iron_double_sheet` })
// Двойная пластина
event.remove({ id: `tfc:heating/metal/cast_iron_double_sheet` })
// Стержень
event.remove({ id: `tfc:heating/metal/cast_iron_rod` })
//#endregion
@ -73,6 +62,18 @@ function removeTFCRecipes(event) {
event.remove({ id: 'tfc:quern/graphite' })
event.remove({ id: 'tfc:quern/lapis_lazuli' })
event.remove({ id: 'tfc:quern/lapis_lazuli_cut' })
event.remove({ id: 'tfc:quern/small_bismuthinite' })
event.remove({ id: 'tfc:quern/small_cassiterite' })
event.remove({ id: 'tfc:quern/small_garnierite' })
event.remove({ id: 'tfc:quern/small_hematite' })
event.remove({ id: 'tfc:quern/small_limonite' })
event.remove({ id: 'tfc:quern/small_magnetite' })
event.remove({ id: 'tfc:quern/small_malachite' })
event.remove({ id: 'tfc:quern/small_native_copper' })
event.remove({ id: 'tfc:quern/small_native_gold' })
event.remove({ id: 'tfc:quern/small_native_silver' })
event.remove({ id: 'tfc:quern/small_sphalerite' })
event.remove({ id: 'tfc:quern/small_tetrahedrite' })
event.remove({ id: 'tfc:quern/normal_bismuthinite' })
event.remove({ id: 'tfc:quern/normal_cassiterite' })
event.remove({ id: 'tfc:quern/normal_garnierite' })
@ -145,7 +146,7 @@ function removeTFCRecipes(event) {
event.remove({ id: `tfc:crafting/crankshaft` })
event.remove({ id: 'tfc:crafting/sandpaper' })
event.remove({ id: 'tfc:crafting/vanilla/redstone/observer' })
event.remove({ id: 'tfc:crafting/vanilla/brick_stairs' })
event.remove({ id: 'tfc:crafting/vanilla/redstone/steel_minecart' })
event.remove({ id: 'tfc:crafting/vanilla/redstone/minecart' })
event.remove({ id: 'tfc:crafting/cake' })

View file

@ -3,15 +3,19 @@
const registerTFCGroomingStationRecipes = (event) => {
global.TFC_EQUIPMENT_METALS.forEach(material => {
event.recipes.gtceu.shaped(`tfcgroomer:${material}_grooming_station`, [
global.TFC_EQUIPMENT_METALS.forEach(materialName => {
const trough = `tfcgroomer:${materialName}_grooming_station`;
event.recipes.gtceu.shaped(trough, [
'ABA',
'AAA',
'C C'
], {
A: `#forge:plates/${material}`,
A: `#forge:plates/${materialName}`,
B: '#forge:tools/hammers',
C: 'tfc:wattle'
}).addMaterialInfo().id(`tfcgroomer:${material}_grooming_station`)
}).addMaterialInfo().id(`tfcgroomer:${materialName}_grooming_station`)
addMaterialRecyclingNoTagPrefix(event, trough, GTMaterials.get(materialName), 'grooming_station', 5);
})
}

View file

@ -0,0 +1,8 @@
// priority: 0
"use strict";
function registerTFCScrapingKnivesRecipes(event) {
event.remove({ mod: 'tfcscraping', type: 'tfc:anvil' });
event.remove({ mod: 'tfcscraping', type: 'tfc:heating' });
event.remove({ mod: 'tfcscraping', type: 'tfc:casting' });
}

View file

@ -426,16 +426,18 @@ function registerTFGRockRecipes(event) {
// (spacing for region titles)
//
let CUT_GRIND = [
{ raw: 'minecraft:bricks', stair: 'minecraft:brick_stairs', slab: 'minecraft:brick_slab', wall: 'minecraft:brick_wall',
dust: 'gtceu:brick_dust', loose: null, stonecutting: false },
// #region Nether
// Deepslate
{ raw: 'minecraft:deepslate', stair: 'tfg:rock/deepslate_stairs', slab: 'tfg:rock/deepslate_slab', wall: 'tfg:rock/deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: null, stonecutting: false }, // Raw
{ raw: 'minecraft:deepslate', stair: 'tfg:rock/deepslate_stairs', slab: 'tfg:rock/deepslate_slab', wall: 'tfg:rock/deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: null, stonecutting: false }, // Raw
{ raw: 'minecraft:cobbled_deepslate', stair: 'minecraft:cobbled_deepslate_stairs', slab: 'minecraft:cobbled_deepslate_slab', wall: 'minecraft:cobbled_deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: 'tfg:loose/deepslate', stonecutting: false }, // Cobble
{ raw: 'minecraft:cobbled_deepslate', stair: 'minecraft:cobbled_deepslate_stairs', slab: 'minecraft:cobbled_deepslate_slab', wall: 'minecraft:cobbled_deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: 'tfg:loose/deepslate', stonecutting: false }, // Cobble
{ raw: 'tfg:rock/mossy_cobble_deepslate', stair: 'tfg:rock/mossy_cobble_deepslate_stairs', slab: 'tfg:rock/mossy_cobble_deepslate_slab', wall: 'tfg:rock/mossy_cobble_deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: null, stonecutting: true }, // Cobble - Mossy
{ raw: 'tfg:rock/mossy_cobble_deepslate', stair: 'tfg:rock/mossy_cobble_deepslate_stairs', slab: 'tfg:rock/mossy_cobble_deepslate_slab', wall: 'tfg:rock/mossy_cobble_deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: null, stonecutting: true }, // Cobble - Mossy
{ raw: 'minecraft:polished_deepslate', stair: 'minecraft:polished_deepslate_stairs', slab: 'minecraft:polished_deepslate_slab', wall: 'minecraft:polished_deepslate_wall',
dust: 'gtceu:deepslate_dust', loose: null, stonecutting: false }, // Smooth
@ -539,6 +541,8 @@ function registerTFGRockRecipes(event) {
{ raw: 'tfg:rock/mossy_bricks_nether', stair: 'tfg:rock/mossy_bricks_nether_stairs', slab: 'tfg:rock/mossy_bricks_nether_slab', wall: 'tfg:rock/mossy_bricks_nether_wall',
dust: 'gtceu:netherrack_dust', loose: null, stonecutting: true }, // Bricks - Mossy
{ raw: 'minecraft:nether_brick_wall', stair: null, slab: null, wall: 'minecraft:nether_brick_fence',
dust: null, loose: null, stonecutting: true },
// #endregion Nether
]

View file

@ -0,0 +1,527 @@
// priority: 0
"use strict";
// TODO: merge these two tag prefixes
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processSmallOre(event, material) {
if (!material.hasFlag(TFGMaterialFlags.HAS_SMALL_TFC_ORE))
return;
const smallOre = ChemicalHelper.get(TFGTagPrefix.oreSmall, material, 1);
const smallDust = ChemicalHelper.get(TagPrefix.dustSmall, material, 1);
let materialName = material.getName();
event.recipes.gtceu.macerator(`tfg:macerate_${materialName}_small_ore`)
.itemInputs(smallOre)
.itemOutputs(smallDust)
.duration(material.getMass())
.category(GTRecipeCategories.ORE_CRUSHING)
.EUt(GTValues.VA[GTValues.ULV])
event.recipes.tfc.quern(smallDust, smallOre)
.id(`tfg:quern/small_${materialName}`)
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
addTFCMelting(event, smallOre, material, 16, 'small_ore');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {*} oreProperty
* The material's ore property
* @param {number} multiplier
* How many ingots/gems/dusts each ore item should smelt into.
* Can be a non-integer, in which case it'll smelt into nuggets/small dusts etc.
* @param {Internal.ItemStack} oreItem
* The input item to be smelted
* @param {string} type
* The type of ore being smelted, used for recipe IDs
*/
function smeltOre(event, material, oreProperty, multiplier, oreItem, type) {
const smeltingMaterial = oreProperty.getDirectSmeltResult().isNull() ? material : oreProperty.getDirectSmeltResult();
if (!material.hasProperty(PropertyKey.BLAST) && !material.hasFlag(MaterialFlags.NO_ORE_SMELTING)) {
let ingotItem;
if (smeltingMaterial.hasProperty(PropertyKey.INGOT)) {
ingotItem = ChemicalHelper.getIngot(smeltingMaterial, GTValues.M * multiplier)
}
else if (smeltingMaterial.hasProperty(PropertyKey.GEM)) {
if (multiplier >= 1) {
ingotItem = ChemicalHelper.get(TagPrefix.gem, smeltingMaterial, multiplier)
}
else {
ingotItem = ChemicalHelper.get(TagPrefix.gemFlawed, smeltingMaterial, 1)
}
}
else {
ingotItem = ChemicalHelper.getDust(smeltingMaterial, GTValues.M * multiplier)
}
if (!ingotItem.isEmpty()) {
event.smelting(ingotItem, oreItem).id(`gtceu:smelting/smelt_${type}_${material.getName()}_ore_to_ingot`)
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPoorRawOre(event, material) {
const poorOreItem = ChemicalHelper.get(TFGTagPrefix.poorRawOre, material, 1)
const crushedOreItem = ChemicalHelper.get(TagPrefix.crushed, material, 1)
if (poorOreItem === null || crushedOreItem === null)
return;
const materialName = material.getName();
const oreProperty = material.getProperty(PropertyKey.ORE)
const multiplier = oreProperty.getOreMultiplier();
crushedOreItem.setCount(crushedOreItem.getCount() * multiplier)
// Forge hammer
let hammerRecipe = event.recipes.gtceu.forge_hammer(`hammer_poor_raw_${materialName}_to_crushed_ore`)
.itemInputs(poorOreItem)
.category(GTRecipeCategories.ORE_FORGING)
.duration(100)
.EUt(16)
if (material.hasProperty(PropertyKey.GEM)) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, crushedOreItem.getCount());
hammerRecipe.chancedOutput(gemItem, 7500, 950)
event.recipes.greate.pressing(Item.of(gemItem).withChance(0.75), poorOreItem)
.recipeTier(1)
.id(`greate:pressing/poor_raw_${materialName}_to_gem`)
let polishingCount = Math.max(crushedOreItem.getCount() / 2, 1);
event.recipes.create.sandpaper_polishing(gemItem.copyWithCount(polishingCount), poorOreItem)
.id(`tfg:polishing/poor_raw_${materialName}_to_gem`)
} else {
hammerRecipe.chancedOutput(crushedOreItem, 7500, 950)
event.recipes.greate.pressing(Item.of(crushedOreItem).withChance(0.75), poorOreItem)
.recipeTier(1)
.id(`greate:pressing/poor_raw_${materialName}_to_crushed_ore`)
}
// Macerator
let maceratorRecipe = event.recipes.gtceu.macerator(`macerate_poor_raw_${materialName}_ore_to_crushed_ore`)
.itemInputs(poorOreItem)
.category(GTRecipeCategories.ORE_CRUSHING)
.duration(400)
.EUt(2)
if (multiplier > 1) {
maceratorRecipe.itemOutputs(crushedOreItem.copyWithCount(multiplier / 2))
} else {
maceratorRecipe.chancedOutput(crushedOreItem, 5000, 750)
}
maceratorRecipe.chancedOutput(crushedOreItem.copyWithCount(1), 2500, 500)
maceratorRecipe.chancedOutput(crushedOreItem.copyWithCount(1), 1250, 250)
// Quern
if (multiplier > 1) {
event.recipes.tfc.quern(
crushedOreItem.copyWithCount(multiplier / 2),
poorOreItem
).id(`tfg:quern/${materialName}_crushed_ore_from_poor_raw_ore`)
} else {
event.recipes.tfc.quern(
ChemicalHelper.get(TagPrefix.dustSmall, material, 2),
poorOreItem
).id(`tfg:quern/${materialName}_crushed_ore_from_poor_raw_ore`)
}
// Smelting
smeltOre(event, material, oreProperty, multiplier / 2, poorOreItem, 'poor')
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, poorOreItem, material, global.calcAmountOfMetalProcessed(24, tfcProperty.getPercentOfMaterial()), 'poor_raw_ore');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processNormalRawOre(event, material) {
const oreProperty = material.getProperty(PropertyKey.ORE)
const multiplier = oreProperty.getOreMultiplier();
const normalOreItem = ChemicalHelper.get(TagPrefix.rawOre, material, 1)
const crushedOreItem = ChemicalHelper.get(TagPrefix.crushed, material, multiplier)
if (normalOreItem === null || crushedOreItem === null)
return;
const materialName = material.getName();
// Forge hammer
let hammerRecipe = event.recipes.gtceu.forge_hammer(`hammer_raw_${materialName}_to_crushed_ore`)
.itemInputs(normalOreItem)
.category(GTRecipeCategories.ORE_FORGING)
.duration(100)
.EUt(16)
if (material.hasProperty(PropertyKey.GEM)) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, crushedOreItem.getCount())
hammerRecipe.itemOutputs(gemItem)
event.recipes.greate.pressing(gemItem, normalOreItem)
.recipeTier(1)
.id(`greate:pressing/raw_${materialName}_to_gem`)
event.recipes.create.sandpaper_polishing(gemItem, normalOreItem)
.id(`tfg:polishing/raw_${materialName}_to_gem`)
} else {
hammerRecipe.itemOutputs(crushedOreItem)
event.recipes.greate.pressing(crushedOreItem, normalOreItem)
.recipeTier(1)
.id(`greate:pressing/raw_${materialName}_to_crushed_ore`)
}
event.remove({ id: `greate:milling/integration/gtceu/macerator/macerate_raw_${materialName}_ore_to_crushed_ore` })
// Macerator
event.recipes.gtceu.macerator(`macerate_raw_${materialName}_ore_to_crushed_ore`)
.itemInputs(normalOreItem)
.itemOutputs(crushedOreItem)
.chancedOutput(crushedOreItem.copyWithCount(1), 5000, 500)
.chancedOutput(crushedOreItem.copyWithCount(1), 2500, 250)
.chancedOutput(crushedOreItem.copyWithCount(1), 1250, 250)
.category(GTRecipeCategories.ORE_CRUSHING)
.duration(400)
.EUt(2)
// Quern
event.recipes.tfc.quern(crushedOreItem, normalOreItem)
.id(`tfg:quern/${materialName}_crushed_ore_from_normal_raw_ore`)
// Remove ore block recipes
event.remove({ id: `gtceu:compressor/compress_${materialName}_to_raw_ore_block` })
event.remove({ id: `gtceu:forge_hammer/decompress_${materialName}_to_raw_ore` })
// Smelting
smeltOre(event, material, oreProperty, multiplier, normalOreItem, 'raw')
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, normalOreItem, material, global.calcAmountOfMetalProcessed(36, tfcProperty.getPercentOfMaterial()), 'raw_ore');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processRichRawOre(event, material) {
const oreProperty = material.getProperty(PropertyKey.ORE)
const multiplier = oreProperty.getOreMultiplier() * 2;
const richOreItem = ChemicalHelper.get(TFGTagPrefix.richRawOre, material, 1)
const crushedOreItem = ChemicalHelper.get(TagPrefix.crushed, material, multiplier)
if (richOreItem === null || crushedOreItem === null)
return;
const materialName = material.getName();
// Forge hammer
let hammerRecipe = event.recipes.gtceu.forge_hammer(`hammer_rich_raw_${materialName}_to_crushed_ore`)
.itemInputs(richOreItem)
.category(GTRecipeCategories.ORE_FORGING)
.duration(100)
.EUt(16)
if (material.hasProperty(PropertyKey.GEM)) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, crushedOreItem.getCount())
hammerRecipe.itemOutputs(gemItem)
event.recipes.greate.pressing(gemItem, richOreItem)
.recipeTier(1)
.id(`greate:pressing/rich_raw_${materialName}_to_gem`)
event.recipes.create.sandpaper_polishing(gemItem, richOreItem)
.id(`tfg:polishing/rich_raw_${materialName}_to_gem`)
} else {
hammerRecipe.itemOutputs(crushedOreItem)
event.recipes.greate.pressing(crushedOreItem, richOreItem)
.recipeTier(1)
.id(`greate:pressing/rich_raw_${materialName}_to_crushed_ore`)
}
// Macerator
event.recipes.gtceu.macerator(`macerate_rich_raw_${materialName}_ore_to_crushed_ore`)
.itemInputs(richOreItem)
.itemOutputs(crushedOreItem)
.chancedOutput(crushedOreItem.copyWithCount(1), 5000, 750)
.chancedOutput(crushedOreItem.copyWithCount(1), 2500, 500)
.chancedOutput(crushedOreItem.copyWithCount(1), 1250, 250)
.category(GTRecipeCategories.ORE_CRUSHING)
.duration(400)
.EUt(2)
// Quern
event.recipes.tfc.quern(crushedOreItem, richOreItem)
.id(`tfg:quern/${materialName}_crushed_ore_from_rich_raw_ore`)
// Smelting
smeltOre(event, material, oreProperty, multiplier, richOreItem, 'rich')
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, richOreItem, material, global.calcAmountOfMetalProcessed(48, tfcProperty.getPercentOfMaterial()), 'rich_raw_ore');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processCrushedOre(event, material) {
const crushedOreItem = ChemicalHelper.get(TagPrefix.crushed, material, 1)
const impureDustItem = ChemicalHelper.get(TagPrefix.dustImpure, material, 1)
const pureOreItem = ChemicalHelper.get(TagPrefix.crushedPurified, material, 1)
const materialName = material.getName();
if (crushedOreItem !== null && pureOreItem !== null) {
// Bulk washing
let byproductMaterial = material.getProperty(PropertyKey.ORE).getOreByProduct(0, material);
const byproductItem = ChemicalHelper.get(TagPrefix.dust, byproductMaterial, 1)
event.recipes.greate.splashing([pureOreItem, Item.of(byproductItem).withChance(0.333), 'gtceu:stone_dust'], crushedOreItem)
.id(`tfg:splashing/${materialName}_purified_ore`)
// Dropping in water
event.custom({
type: "ae2:transform",
circumstance: {
type: "fluid",
tag: "tfc:any_water"
},
ingredients: [
crushedOreItem.toJson()
],
result: pureOreItem.toJson()
}).id(`tfg:ae_transform/${materialName}_purified_ore`)
event.recipes.tfc.barrel_instant()
.inputItem(crushedOreItem)
.inputFluid(Fluid.of("minecraft:water", 10))
.outputItem(pureOreItem)
.id(`tfg:instant_barrel/${materialName}_purified_ore`)
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, crushedOreItem, material, global.calcAmountOfMetalProcessed(80, tfcProperty.getPercentOfMaterial()), 'purified_ore');
}
}
if (crushedOreItem !== null && impureDustItem !== null) {
event.recipes.greate.pressing(impureDustItem, crushedOreItem)
.recipeTier(1)
.id(`greate:pressing/crushed_${materialName}_to_impure_dust`)
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPurifiedOre(event, material) {
const pureOreItem = ChemicalHelper.get(TagPrefix.crushedPurified, material, 1)
const pureDustItem = ChemicalHelper.get(TagPrefix.dustPure, material, 1)
if (pureOreItem !== null && pureDustItem !== null) {
event.recipes.greate.pressing(pureDustItem, pureOreItem)
.recipeTier(1)
.id(`greate:pressing/pure_crushed_${material.getName()}_to_pure_dust`)
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, pureOreItem, material, global.calcAmountOfMetalProcessed(100, tfcProperty.getPercentOfMaterial()), 'pure_crushed');
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processRefinedOre(event, material) {
const refinedOreItem = ChemicalHelper.get(TagPrefix.crushedRefined, material, 1)
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1)
if (refinedOreItem !== null && dustItem !== null) {
event.recipes.greate.pressing(dustItem, refinedOreItem)
.recipeTier(1)
.id(`greate:pressing/refined_${material.getName()}_to_dust`)
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, refinedOreItem, material, global.calcAmountOfMetalProcessed(110, tfcProperty.getPercentOfMaterial()), 'refined_crushed');
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processImpureDust(event, material) {
const impureDustItem = ChemicalHelper.get(TagPrefix.dustImpure, material, 1)
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1)
if (impureDustItem !== null && dustItem !== null) {
const materialName = material.getName();
// Bulk washing
event.recipes.greate.splashing(dustItem, impureDustItem)
.id(`tfg:splashing/${materialName}_dust_from_impure`)
event.recipes.tfc.barrel_instant()
.inputItem(impureDustItem)
.inputFluid(Fluid.of("minecraft:water", 10))
.outputItem(dustItem)
.id(`tfg:instant_barrel/${materialName}_dust_from_impure`)
// Centrifuging
let byproductMaterial = material.getProperty(PropertyKey.ORE).getOreByProduct(0, material);
event.recipes.vintageimprovements.centrifugation(
[dustItem, Item.of(ChemicalHelper.get(TagPrefix.dust, byproductMaterial, 1)).withChance(0.111)],
impureDustItem)
.processingTime(material.getMass() * 10 * global.VINTAGE_IMPROVEMENTS_DURATION_MULTIPLIER)
.id(`tfg:vi/centrifuge/${materialName}_dust_from_impure`)
// Dropping in water
event.custom({
type: "ae2:transform",
circumstance: {
type: "fluid",
tag: "tfc:any_water"
},
ingredients: [
impureDustItem.toJson()
],
result: dustItem.toJson()
}).id(`tfg:ae_transform/${materialName}_dust_from_impure`)
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, impureDustItem, material, global.calcAmountOfMetalProcessed(100, tfcProperty.getPercentOfMaterial()), 'impure_dust');
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPureDust(event, material) {
const pureDustItem = ChemicalHelper.get(TagPrefix.dustPure, material, 1);
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1);
if (pureDustItem !== null && dustItem !== null) {
const materialName = material.getName();
// Bulk washing
event.recipes.greate.splashing(dustItem, pureDustItem)
.id(`tfg:splashing/${materialName}_dust_from_pure`)
event.recipes.tfc.barrel_instant()
.inputItem(pureDustItem)
.inputFluid(Fluid.of("minecraft:water", 10))
.outputItem(dustItem)
.id(`tfg:instant_barrel/${materialName}_dust_from_pure`)
// Centrifuging
let byproductMaterial = material.getProperty(PropertyKey.ORE).getOreByProduct(1, material);
event.recipes.vintageimprovements.centrifugation(
[dustItem, Item.of(ChemicalHelper.get(TagPrefix.dust, byproductMaterial, 1)).withChance(0.111)],
pureDustItem)
.processingTime(material.getMass() * 10 * global.VINTAGE_IMPROVEMENTS_DURATION_MULTIPLIER)
.id(`tfg:vi/centrifuge/${materialName}_dust_from_pure`)
// Dropping in water
event.custom({
type: "ae2:transform",
circumstance: {
type: "fluid",
tag: "tfc:any_water"
},
ingredients: [
pureDustItem.toJson()
],
result: dustItem.toJson()
}).id(`tfg:ae_transform/${materialName}_dust_from_pure`)
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, pureDustItem, material, global.calcAmountOfMetalProcessed(120, tfcProperty.getPercentOfMaterial()), 'pure_dust');
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processGems(event, material) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, 1);
if (gemItem.isEmpty() || gemItem.hasTag('c:hidden_from_recipe_viewers'))
return;
const materialName = material.getName();
const budItem = ChemicalHelper.get(TFGTagPrefix.budIndicator, material, 1);
if (!budItem.isEmpty()) {
event.recipes.tfc.damage_inputs_shapeless_crafting(
event.shapeless(budItem, [gemItem, '#tfc:chisels']))
.id(`shapeless/${materialName}_bud_indicator`)
}
const chipped = ChemicalHelper.get(TagPrefix.gemChipped, material, 1)
const smallDust = ChemicalHelper.get(TagPrefix.dustSmall, material, 1)
if (!chipped.isEmpty()) {
event.shaped(smallDust, [
'A', 'B'
], {
A: chipped,
B: '#forge:tools/mortars'
}).id(`shapeless/mortar_chipped_${materialName}`)
}
const amount = getMaterialAmount(TagPrefix.block, material);
event.recipes.greate.pressing(ChemicalHelper.get(TagPrefix.gem, material, amount), ChemicalHelper.get(TagPrefix.block, material, 1))
.recipeTier(0)
.id(`greate:pressing/unpacking_${materialName}_block`)
event.recipes.tfc.quern(ChemicalHelper.get(TagPrefix.dust, material, 1), gemItem)
.id(`tfg:quern/${materialName}_gem_to_dust`)
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, ChemicalHelper.get(TagPrefix.gemChipped, material, 1), material, global.calcAmountOfMetalProcessed(144 / 4, tfcProperty.getPercentOfMaterial()), 'gem_chipped');
addTFCMelting(event, ChemicalHelper.get(TagPrefix.gemFlawed, material, 1), material, global.calcAmountOfMetalProcessed(144 / 2, tfcProperty.getPercentOfMaterial()), 'gem_flawed');
addTFCMelting(event, gemItem, material, global.calcAmountOfMetalProcessed(144, tfcProperty.getPercentOfMaterial()), 'gem');
addTFCMelting(event, ChemicalHelper.get(TagPrefix.gemFlawless, material, 1), material, global.calcAmountOfMetalProcessed(144 * 2, tfcProperty.getPercentOfMaterial()), 'gem_flawless');
addTFCMelting(event, ChemicalHelper.get(TagPrefix.gemExquisite, material, 1), material, global.calcAmountOfMetalProcessed(144 * 4, tfcProperty.getPercentOfMaterial()), 'gem_exquisite');
}
}

View file

@ -0,0 +1,576 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processDust(event, material) {
// Melting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
const tinyDust = ChemicalHelper.get(TagPrefix.dustTiny, material, 1);
addTFCMelting(event, tinyDust, material, global.calcAmountOfMetalProcessed(144 / 9, tfcProperty.getPercentOfMaterial()), 'tiny_dust');
const smallDust = ChemicalHelper.get(TagPrefix.dustSmall, material, 1);
addTFCMelting(event, smallDust, material, global.calcAmountOfMetalProcessed(144 / 4, tfcProperty.getPercentOfMaterial()), 'small_dust');
const dust = ChemicalHelper.get(TagPrefix.dust, material, 1);
addTFCMelting(event, dust, material, global.calcAmountOfMetalProcessed(144, tfcProperty.getPercentOfMaterial()), 'dust');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPowder(event, material) {
const powderItem = ChemicalHelper.get(TFGTagPrefix.powder, material, 1);
if (powderItem.isEmpty())
return;
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1);
const materialName = material.getName();
event.recipes.gtceu.macerator(`tfg:${materialName}_to_powder`)
.itemInputs(dustItem)
.itemOutputs(powderItem.withCount(4))
.duration(60)
.EUt(2)
event.recipes.tfc.quern(powderItem.withCount(4), dustItem)
.id(`tfg:quern/${materialName}`)
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, powderItem, material, global.calcAmountOfMetalProcessed(144 / 4, tfcProperty.getPercentOfMaterial()), 'powder');
}
if (material.hasProperty(PropertyKey.FLUID)) {
event.recipes.gtceu.extractor(`tfg:${materialName}_powder`)
.itemInputs(powderItem)
.outputFluids(Fluid.of(material.getFluid(), global.calcAmountOfMetalProcessed(144 / 4, tfcProperty.getPercentOfMaterial())))
.duration(material.getMass() / 4)
.category(GTRecipeCategories.EXTRACTOR_RECYCLING)
.EUt(getFluidRecipeEUt(material))
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processIngot(event, material) {
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
if (ingotItem.isEmpty()
|| ingotItem.hasTag('c:hidden_from_recipe_viewers')
|| material === GTMaterials.Stone)
return;
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
addTFCMelting(event, ingotItem, material, 144, 'ingot');
addMaterialCasting(event, ingotItem, 'tfc:ceramic/ingot_mold', false, null, material, 'ingot', 144);
addMaterialCasting(event, ingotItem, 'tfc:ceramic/fire_ingot_mold', true, null, material, 'ingot', 144);
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processIngotDouble(event, material) {
if (!material.hasFlag(TFGMaterialFlags.GENERATE_DOUBLE_INGOTS))
return;
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
const doubleIngotItem = ChemicalHelper.get(TFGTagPrefix.ingotDouble, material, 1);
addMaterialRecycling(event, doubleIngotItem, material, "double_ingot", TFGTagPrefix.ingotDouble);
addMaterialWelding(event, doubleIngotItem, ingotItem, ingotItem, material, 5, 1);
event.recipes.gtceu.bender(`tfg:bend_${material.getName()}_double_ingot_electric_only`)
.itemInputs(ingotItem.withCount(2))
.itemOutputs(doubleIngotItem)
.duration(material.getMass() * 6)
.EUt(GTValues.VA[GTValues.LV])
.circuit(3)
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processBlock(event, material) {
const blockItem = ChemicalHelper.get(TagPrefix.block, material, 1);
if (blockItem.isEmpty()
|| blockItem.hasTag('c:hidden_from_recipe_viewers')
|| GTMaterials.Stone === material
|| material.hasProperty(PropertyKey.POLYMER))
return;
const matAmount = getMaterialAmount(TagPrefix.block, material);
const materialName = material.getName();
if (material.hasProperty(PropertyKey.INGOT)) {
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
let ingotArray = [];
for (let i = 0; i < matAmount; i++)
ingotArray.push(ingotItem)
event.recipes.greate.compacting(blockItem, ingotArray)
.recipeTier(1)
.circuitNumber(9)
.heated()
.id(`greate:compacting/${materialName}_block`)
}
else if (material.hasProperty(PropertyKey.GEM)) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, 1);
let gemArray = [];
for (let i = 0; i < matAmount; i++)
gemArray.push(gemItem)
event.recipes.greate.compacting(blockItem, gemArray)
.recipeTier(1)
.circuitNumber(9)
.id(`greate:compacting/${materialName}_block`)
}
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
addTFCMelting(event, blockItem, material, 144 * matAmount, 'block');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPlate(event, material) {
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1)
if (plateItem.isEmpty() || plateItem.hasTag('c:hidden_from_recipe_viewers'))
return;
const materialName = material.getName();
event.remove({ id: `gtceu:shaped/plate_${materialName}` })
if (material === GTMaterials.Stone
|| material === GTMaterials.Wood
|| material === GTMaterials.TreatedWood
|| material.hasProperty(PropertyKey.POLYMER))
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, plateItem, material, 144, 'plate');
const doubleIngotItem = ChemicalHelper.get(TFGTagPrefix.ingotDouble, material, 1);
addAnvilRecipe(event, plateItem, doubleIngotItem, ['hit_last', 'hit_second_last', 'hit_third_last'], false, material, 'sheet');
}
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
if (!ingotItem.isEmpty()) {
event.custom({
type: "createaddition:rolling",
input: ingotItem,
result: plateItem,
//processingTime: material.getMass() // TODO - controlled by a global config argh
}).id(`tfg:rolling/${materialName}_plate`)
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPlateDouble(event, material) {
const doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1)
if (doublePlateItem.isEmpty() || doublePlateItem.hasTag('c:hidden_from_recipe_viewers'))
return;
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
event.remove({ id: `gtceu:shaped/plate_double_${material.getName()}` })
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
addTFCMelting(event, doublePlateItem, material, 288, 'double_plate');
// If it's a TFC-era material, allow double plates in LV
event.remove({ id: `gtceu:bender/bend_${material.getName()}_plate_to_double_plate` })
event.recipes.gtceu.bender(`tfg:bend_${material.getName()}_plate_to_double_plate_electric_only`)
.itemInputs(plateItem.withCount(2))
.itemOutputs(doublePlateItem)
.circuit(2)
.duration(material.getMass() * 2)
.EUt(24)
}
addMaterialWelding(event, doublePlateItem, plateItem, plateItem, material, 4, 2);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processFoil(event, material) {
const foilItem = ChemicalHelper.get(TagPrefix.foil, material, 4)
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1)
if (plateItem.isEmpty() || foilItem.isEmpty() || plateItem.hasTag('c:hidden_from_recipe_viewers'))
return;
event.custom({
type: "createaddition:rolling",
input: plateItem,
result: foilItem,
// TODO - processing time is controlled by a global config instead of setting it per-recipe...
//processingTime: material.getMass()
}).id(`tfg:rolling/${material.getName()}_foil`)
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processRod(event, material) {
if (material === GTMaterials.Wood || material === GTMaterials.TreatedWood)
return;
// Short rods
const shortRodItem = ChemicalHelper.get(TagPrefix.rod, material, 1)
if (shortRodItem.isEmpty() || shortRodItem.hasTag('c:hidden_from_recipe_viewers'))
return;
const materialName = material.getName();
addMaterialCasting(event, shortRodItem, 'tfg:rod_mold', true, null, material, 'rod', 144 / 2);
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, shortRodItem, material, 144 / 2, 'rod');
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1)
addAnvilRecipe(event, shortRodItem.withCount(2), ingotItem, ['draw_last'], false, material, 'rod');
}
// Every material with a short rod also has a long rod
const longRodItem = ChemicalHelper.get(TagPrefix.rodLong, material, 1)
if (longRodItem.isEmpty() || longRodItem.hasTag('c:hidden_from_recipe_viewers'))
return;
event.remove({ id: `gtceu:shaped/stick_long_stick_${materialName}` })
if (tfcProperty !== null) {
addTFCMelting(event, longRodItem, material, 144, 'long_rod');
}
addMaterialWelding(event, longRodItem, shortRodItem, shortRodItem, material, 4, 1);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processBolt(event, material) {
if (material === GTMaterials.Wood || material === GTMaterials.TreatedWood)
return;
const boltItem = ChemicalHelper.get(TagPrefix.bolt, material, 1);
if (boltItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, boltItem, material, getMaterialAmount(TagPrefix.bolt, material) * 144, 'bolt');
const rodItem = ChemicalHelper.get(TagPrefix.rod, material, 1)
addAnvilRecipe(event, boltItem.withCount(4), rodItem, ['punch_last', 'draw_second_last', 'draw_third_last'], false, material, 'bolt');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processScrew(event, material) {
if (material === GTMaterials.Wood || material === GTMaterials.TreatedWood)
return;
const screwItem = ChemicalHelper.get(TagPrefix.screw, material, 1);
if (screwItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, screwItem, material, getMaterialAmount(TagPrefix.screw, material) * 144, 'screw');
const rodItem = ChemicalHelper.get(TagPrefix.rod, material, 1);
addAnvilRecipe(event, screwItem.withCount(4), rodItem, ['punch_last', 'punch_second_last', 'shrink_third_last'], false, material, 'screw');
}
}
function processRing(event, material) {
const ringItem = ChemicalHelper.get(TagPrefix.ring, material, 1)
if (ringItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null) {
addTFCMelting(event, ringItem, material, getMaterialAmount(TagPrefix.ring, material) * 144, 'ring');
const rodItem = ChemicalHelper.get(TagPrefix.rod, material, 1);
addAnvilRecipe(event, ringItem.withCount(2), rodItem, ['hit_last', 'hit_second_last', 'hit_third_last'], false, material, 'ring');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processAnvil(event, material) {
const anvilItem = ChemicalHelper.get(TFGTagPrefix.anvil, material, 1)
if (anvilItem.isEmpty())
return;
addMaterialRecycling(event, anvilItem, material, 'anvil', TFGTagPrefix.anvil);
addMaterialCasting(event, anvilItem, null, false, 'gtceu:anvil_casting_mold', material, 'anvil', getMaterialAmount(TFGTagPrefix.anvil, material) * 144);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processLamp(event, material) {
const finishedLampItem = ChemicalHelper.get(TFGTagPrefix.lamp, material, 1)
const unfinishedLampItem = ChemicalHelper.get(TFGTagPrefix.lampUnfinished, material, 1)
if (finishedLampItem.isEmpty() || unfinishedLampItem.isEmpty())
return;
const materialName = material.getName();
// Unfinished lamp
let matMap = { 'glass': 1 };
matMap[materialName] = 1;
TFGHelpers.registerMaterialInfo(finishedLampItem, matMap);
addTFCMelting(event, finishedLampItem, material, 144, 'lamp');
addMaterialRecycling(event, unfinishedLampItem, material, 'unfinished_lamp', TFGTagPrefix.lampUnfinished);
addMaterialCasting(event, unfinishedLampItem, null, false, 'tfg:lamp_casting_mold', material, 'unfinished_lamp', getMaterialAmount(TFGTagPrefix.lampUnfinished, material) * 144);
// Finished lamp
event.recipes.gtceu.packer(`tfg:${materialName}_lamp`)
.itemInputs("tfc:lamp_glass", unfinishedLampItem)
.itemOutputs(finishedLampItem)
.duration(100)
.EUt(GTValues.VA[GTValues.LV])
event.recipes.gtceu.fluid_solidifier(`tfg:${materialName}_lamp_from_liquid`)
.itemInputs(unfinishedLampItem)
.inputFluids(Fluid.of(GTMaterials.Glass.getFluid(), 144))
.itemOutputs(finishedLampItem)
.duration(100)
.EUt(GTValues.VA[GTValues.LV])
event.recipes.gtceu.macerator(`tfg:macerate_${materialName}_lamp`)
.itemInputs(finishedLampItem)
.itemOutputs(`#forge:dusts/${materialName}`, `#forge:dusts/glass`)
.category(GTRecipeCategories.MACERATOR_RECYCLING)
.duration(material.getMass())
.EUt(2);
event.recipes.gtceu.arc_furnace(`tfg:arc_${materialName}_lamp`)
.itemInputs(finishedLampItem)
.itemOutputs(`#forge:ingots/${materialName}`)
.category(GTRecipeCategories.ARC_FURNACE_RECYCLING)
.duration(material.getMass())
.EUt(30);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processTrapdoor(event, material) {
const trapdoorItem = ChemicalHelper.get(TFGTagPrefix.trapdoor, material, 1)
if (trapdoorItem.isEmpty())
return;
addMaterialRecycling(event, trapdoorItem, material, 'trapdoor', TFGTagPrefix.trapdoor);
addMaterialCasting(event, trapdoorItem, null, false, 'tfg:trapdoor_casting_mold', material, 'trapdoor', getMaterialAmount(TFGTagPrefix.trapdoor, material) * 144);
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
addAnvilRecipe(event, trapdoorItem, plateItem, ['bend_last', 'draw_second_last', 'draw_third_last'], false, material, 'trapdoor');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processBell(event, material) {
const bellItem = ChemicalHelper.get(TFGTagPrefix.bell, material, 1)
if (bellItem.isEmpty())
return;
const materialName = material.getName();
event.remove({ id: `tfc:heating/${materialName}_bell` })
addMaterialRecycling(event, bellItem, material, 'bell', TFGTagPrefix.bell);
addMaterialCasting(event, bellItem, 'tfc:ceramic/bell_mold', false, 'tfg:bell_casting_mold', material, 'bell', getMaterialAmount(TFGTagPrefix.bell, material) * 144);
}
function processChain(event, material) {
const chainItem = ChemicalHelper.get(TFGTagPrefix.chain, material, 1);
if (chainItem.isEmpty())
return;
addMaterialRecycling(event, chainItem, material, 'chain', TFGTagPrefix.chain);
addMaterialCasting(event, chainItem.withCount(16), null, false, 'tfg:chain_casting_mold', material, 'chain', 144);
}
function processBars(event, material) {
const barsItem = ChemicalHelper.get(TFGTagPrefix.bars, material, 1);
if (barsItem.isEmpty())
return;
addMaterialRecycling(event, barsItem, material, 'bars', TFGTagPrefix.bars);
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
event.stonecutting(barsItem.withCount(4), ingotItem);
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
addAnvilRecipe(event, barsItem.withCount(4), ingotItem, ['upset_last', 'punch_second_last', 'punch_third_last'], false, material, 'bars');
const doubleIngotItem = ChemicalHelper.get(TFGTagPrefix.ingotDouble, material, 1);
addAnvilRecipe(event, barsItem.withCount(8), doubleIngotItem, ['upset_last', 'punch_second_last', 'punch_third_last'], false, material, 'bars_double');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processBuzzsawBlade(event, material) {
const buzzsawBladeItem = ChemicalHelper.get(TagPrefix.toolHeadBuzzSaw, material, 1)
const doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1)
if (buzzsawBladeItem.isEmpty() || doublePlateItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
const materialName = material.getName();
event.recipes.gtceu.lathe(`buzzsaw_gear_${materialName}`)
.itemInputs(doublePlateItem)
.itemOutputs(buzzsawBladeItem)
.duration(material.getMass() * 6)
.EUt(GTValues.VA[tfcProperty !== null ? GTValues.LV : GTValues.MV])
if (tfcProperty !== null) {
addAnvilRecipe(event, buzzsawBladeItem, doublePlateItem, ['bend_last', 'hit_second_last', 'draw_third_last'], false, material, 'buzzsaw_blade');
event.recipes.vintageimprovements.polishing(buzzsawBladeItem, doublePlateItem)
.speedLimits(0)
.processingTime(material.getMass() * global.VINTAGE_IMPROVEMENTS_DURATION_MULTIPLIER)
.id(`tfg:vi/lathe/${materialName}_buzzsaw`)
}
addMaterialRecycling(event, buzzsawBladeItem, material, 'buzz_saw_blade', TagPrefix.toolHeadBuzzSaw);
event.remove({ id: `gtceu:shaped/buzzsaw_blade_${materialName}` })
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processSpring(event, material) {
const springItem = ChemicalHelper.get(TagPrefix.spring, material, 1);
const materialName = material.getName();
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (springItem !== null) {
event.remove({ id: `gtceu:shaped/spring_${materialName}` });
if (tfcProperty !== null) {
addTFCMelting(event, springItem, material, getMaterialAmount(TagPrefix.spring, material) * 144, 'spring');
const longRodItem = ChemicalHelper.get(TagPrefix.rodLong, material, 1);
addAnvilRecipe(event, springItem, longRodItem, ['hit_last', 'bend_second_last', 'bend_third_last'], false, material, 'spring');
}
}
const smallSpringItem = ChemicalHelper.get(TagPrefix.springSmall, material, 1);
if (smallSpringItem !== null) {
event.remove({ id: `gtceu:shaped/spring_small_${materialName}` });
if (tfcProperty !== null) {
addTFCMelting(event, smallSpringItem, material, getMaterialAmount(TagPrefix.springSmall, material) * 144, 'spring_small');
const rodItem = ChemicalHelper.get(TagPrefix.rod, material, 1);
addAnvilRecipe(event, smallSpringItem, rodItem, ['hit_last', 'bend_second_last', 'bend_third_last'], false, material, 'small_spring');
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processNugget(event, material) {
const nuggetItem = ChemicalHelper.get(TagPrefix.nugget, material, 1);
if (nuggetItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty !== null) {
addTFCMelting(event, nuggetItem, material, 144 / 9, 'nugget');
addMaterialCasting(event, nuggetItem.withCount(4), 'tfg:nugget_mold', false, null, material, 'nugget', 144 * (4/9));
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
addAnvilRecipe(event, nuggetItem.withCount(9), ingotItem, ['punch_last', 'hit_second_last', 'punch_third_last'], false, material, 'nugget');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processSmallGear(event, material) {
const smallGearItem = ChemicalHelper.get(TagPrefix.gearSmall, material, 1);
if (smallGearItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty !== null) {
addTFCMelting(event, smallGearItem, material, 144, 'small_gear');
addMaterialCasting(event, smallGearItem, 'tfg:small_gear_mold', true, null, material, 'small_gear', 144);
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
addAnvilRecipe(event, smallGearItem, ingotItem, ['hit_last', 'shrink_second_last', 'draw_third_last'], false, material, 'small_gear');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processLargeGear(event, material) {
const gearItem = ChemicalHelper.get(TagPrefix.gear, material, 1);
if (gearItem.isEmpty())
return;
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty !== null) {
addTFCMelting(event, gearItem, material, 144 * 4, 'gear');
let doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1)
addMaterialWelding(event, gearItem, doublePlateItem, doublePlateItem, material, 4, 1);
}
}

View file

@ -0,0 +1,298 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processTFCArmor(event, material) {
const materialName = material.getName();
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
const doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1);
// Helmet
const unfinishedHelmet = `tfc:metal/unfinished_helmet/${materialName}`;
const finishedHelmet = `tfc:metal/helmet/${materialName}`;
addAnvilRecipe(event, unfinishedHelmet, doublePlateItem, ['hit_last', 'bend_second_last', 'bend_third_last'], true, material, 'unfinished_helmet');
addTFCMelting(event, unfinishedHelmet, material, 144 * 2, 'unfinished_helmet');
addTFCMelting(event, finishedHelmet, material, 144 * 3, 'helmet');
addMaterialWelding(event, finishedHelmet, unfinishedHelmet, plateItem, material, 4, 0);
// Chestplate
const unfinishedChestplate = `tfc:metal/unfinished_chestplate/${materialName}`;
const finishedChestplate = `tfc:metal/chestplate/${materialName}`;
addAnvilRecipe(event, unfinishedChestplate, doublePlateItem, ['hit_last', 'hit_second_last', 'upset_third_last'], true, material, 'unfinished_chestplate');
addTFCMelting(event, unfinishedChestplate, material, 144 * 2, 'unfinished_chestplate');
addTFCMelting(event, finishedChestplate, material, 144 * 4, 'chestplate');
addMaterialWelding(event, finishedChestplate, unfinishedChestplate, doublePlateItem, material, 4, 0);
// Greaves
const unfinishedGreaves = `tfc:metal/unfinished_greaves/${materialName}`;
const finishedGreaves = `tfc:metal/greaves/${materialName}`;
addAnvilRecipe(event, unfinishedGreaves, doublePlateItem, ['bend_any', 'draw_any', 'hit_any'], true, material, 'unfinished_greaves');
addTFCMelting(event, unfinishedGreaves, material, 144 * 2, 'unfinished_greaves');
addTFCMelting(event, finishedGreaves, material, 144 * 3, 'greaves');
addMaterialWelding(event, finishedGreaves, unfinishedGreaves, plateItem, material, 4, 0);
// Boots
const unfinishedBoots = `tfc:metal/unfinished_boots/${materialName}`;
const finishedBoots = `tfc:metal/boots/${materialName}`;
addAnvilRecipe(event, unfinishedBoots, plateItem, ['bend_last', 'bend_second_last', 'shrink_third_last'], true, material, 'unfinished_boots');
addTFCMelting(event, unfinishedBoots, material, 144, 'unfinished_boots');
addTFCMelting(event, finishedBoots, material, 144 * 2, 'boots');
addMaterialWelding(event, finishedBoots, unfinishedBoots, plateItem, material, 4, 0);
}
/**
* Processes the TFC items for the TFC "tool material" metals
* @param {Internal.RecipesEventJS} event
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processTFCTool(event, material) {
const materialName = material.getName();
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
const doubleIngotItem = ChemicalHelper.get(TFGTagPrefix.ingotDouble, material, 1);
const doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1);
const knifeHead = ChemicalHelper.get(TFGTagPrefix.toolHeadKnife, material, 1)
// Helper methods
function addExtruderRecipe(outputItem, inputItem, mold, id) {
event.recipes.vintageimprovements.curving(outputItem, inputItem)
.head(mold)
.id(`tfg:vi/curving/${materialName}_${id}`)
event.recipes.gtceu.extruder(`tfg:${materialName}_${id}`)
.itemInputs(inputItem)
.notConsumable(mold)
.itemOutputs(outputItem)
.duration(material.getMass() * 6)
.EUt(GTValues.VA[GTValues.LV])
}
// For tools that are pure TFC
if (material.hasFlag(TFGMaterialFlags.HAS_TFC_TOOL)) {
// Tuyere
let tuyere = `tfc:metal/tuyere/${materialName}`;
addTFCMelting(event, tuyere, material, 144 * 2, 'tuyere');
addExtruderRecipe(tuyere, doublePlateItem, 'gtceu:bottle_extruder_mold', 'tuyere');
addAnvilRecipe(event, tuyere, doublePlateItem, ['bend_last', 'bend_second_last'], true, material, 'tuyere');
// Shield
let shield = `tfc:metal/shield/${materialName}`;
addTFCMelting(event, shield, material, 144 * 2, 'shield');
addExtruderRecipe(shield, doublePlateItem, 'gtceu:plate_extruder_mold', 'shield');
addAnvilRecipe(event, shield, doublePlateItem, ['upset_last', 'bend_second_last', 'bend_third_last'], true, material, 'shield');
// Horse armor
let horseArmor = `tfc:metal/horse_armor/${materialName}`;
addTFCMelting(event, horseArmor, material, 144 * 6, 'horse_armor');
// Fish hook
let fishHook = `tfc:metal/fish_hook/${materialName}`;
addAnvilRecipe(event, fishHook, ingotItem, ['bend_any', 'hit_any', 'draw_not_last'], false, material, 'fish_hook');
addTFCMelting(event, `tfc:metal/fishing_rod/${materialName}`, material, 144, 'fishing_rod');
// Mace
let mace = `tfc:metal/mace/${materialName}`;
addTFCMelting(event, mace, material, 144 * 2, 'mace');
// Mattock
event.remove({ id: `rnr:heating/metal/${materialName}_mattock` })
event.remove({ id: `rnr:heating/metal/${materialName}_mattock_head` })
let mattock = `rnr:metal/mattock/${materialName}`;
addTFCMelting(event, mattock, material, 144, 'mattock');
// Shears
let shears = `tfc:metal/shears/${materialName}`;
addMaterialWelding(event, shears, knifeHead, knifeHead, material, 4, 1);
addTFCMelting(event, shears, material, 144 * 2, 'shears');
event.recipes.gtceu.forge_hammer(`tfg:shears/${materialName}`)
.itemInputs(knifeHead.withCount(2))
.itemOutputs(shears)
.duration(40)
.EUt(7);
// Prospector pick
let propick = `tfc:metal/propick/${materialName}`;
addTFCMelting(event, propick, material, 144, 'propick');
// Chisel
let chisel = `tfc:metal/chisel/${materialName}`;
addTFCMelting(event, chisel, material, 144, 'chisel');
// Javelin
let javelin = `tfc:metal/javelin/${materialName}`;
addTFCMelting(event, javelin, material, 144, 'javelin');
// Scraping knife
let scrapingKnife = `tfcscraping:metal/scraping_knife/${materialName}`;
let scrapingKnifeBlade = `tfcscraping:metal/scraping_knife_blade/${materialName}`;
addAnvilRecipe(event, scrapingKnifeBlade, doubleIngotItem, ['hit_last','draw_not_last', 'draw_second_last'], true, material, 'scraping_knife_blade');
addTFCMelting(event, scrapingKnife, material, 144 * 2, 'scraping_knife');
addMaterialRecyclingNoTagPrefix(event, scrapingKnifeBlade, material, 'scraping_knife_blade', 2);
addMaterialCasting(event, scrapingKnifeBlade, 'tfcscraping:ceramic/scraping_knife_blade_mold', false, null, material, 'scraping_knife_blade', 144 * 2);
// Tongs
let tongPart = `tfchotornot:tong_part/${materialName}`;
let tong = `tfchotornot:tongs/${materialName}`;
addExtruderRecipe(tongPart, ChemicalHelper.get(TagPrefix.rodLong, material, 1), 'gtceu:rod_extruder_mold', 'tong_part');
addMaterialRecyclingNoTagPrefix(event, tongPart, material, 'tong_part', 1);
addTFCMelting(event, tong, material, 144 * 2, 'tong');
event.recipes.tfc.advanced_shaped_crafting(
TFC.isp.of(tong).copyForgingBonus(), [
'AA',
'BC'
], {
A: tongPart,
B: Ingredient.of('#forge:bolts').subtract('gtceu:wood_bolt'),
C: '#forge:tools/hammers'
}, 0, 0).id(`tfchotornot:crafting/tongs/${materialName}`)
event.recipes.gtceu.forge_hammer(tong)
.itemInputs(`2x ${tongPart}`)
.itemOutputs(tong)
.duration(material.getMass())
.EUt(GTValues.VA[GTValues.ULV])
event.remove({ id: `tfchotornot:heating/tongs/${materialName}` })
event.remove({ id: `tfchotornot:heating/tong_part/${materialName}` })
}
// Sword
const swordBlade = ChemicalHelper.get(TFGTagPrefix.toolHeadSword, material, 1);
event.remove({ id: `tfc:crafting/metal/sword/${materialName}` })
addAnvilRecipe(event, swordBlade, doubleIngotItem, ['punch_last', 'bend_not_last', 'draw_not_last'], true, material, 'sword_blade');
// Butchery Knife
const butcheryKnifeHead = ChemicalHelper.get(TFGTagPrefix.toolHeadButcheryKnife, material, 1);
addAnvilRecipe(event, butcheryKnifeHead, ingotItem, ['punch_last', 'bend_not_last', 'bend_not_last'], true, material, 'knife_butchery_head');
// Mining Hammer
const miningHammerHead = ChemicalHelper.get(TFGTagPrefix.toolHeadMiningHammer, material, 1);
addAnvilRecipe(event, miningHammerHead, doubleIngotItem, ['punch_last', 'shrink_not_last'], true, material, 'mining_hammer_head');
// Spade
const spadeHead = ChemicalHelper.get(TFGTagPrefix.toolHeadSpade, material, 1);
addAnvilRecipe(event, spadeHead, doubleIngotItem, ['punch_last', 'hit_not_last'], true, material, 'spade_head');
// Pickaxe
const pickaxeHead = ChemicalHelper.get(TFGTagPrefix.toolHeadPickaxe, material, 1);
event.remove({ id: `tfc:crafting/metal/pickaxe/${materialName}` });
addAnvilRecipe(event, pickaxeHead, ingotItem, ['punch_last', 'bend_not_last', 'draw_not_last'], true, material, 'pickaxe_head');
// Screwdriver
const screwdriverHead = ChemicalHelper.get(TagPrefix.toolHeadScrewdriver, material, 1);
addAnvilRecipe(event, screwdriverHead, ingotItem, ['draw_last', 'hit_second_last', 'hit_third_last'], true, material, 'screwdriver_tip');
// Wrench
const wrenchHead = ChemicalHelper.get(TagPrefix.toolHeadWrench, material, 1);
addAnvilRecipe(event, wrenchHead, doubleIngotItem, ['draw_last', 'hit_second_last', 'hit_third_last'], true, material, 'wrench_tip');
// Crowbar
const crowbar = ToolHelper.get(GTToolType.CROWBAR, material);
addTFCMelting(event, crowbar, material, 144 * 1.5, 'crowbar');
// Wire cutters
const wireCutterHead = ChemicalHelper.get(TagPrefix.toolHeadWireCutter, material, 1);
addAnvilRecipe(event, wireCutterHead, doubleIngotItem, ['draw_last', 'hit_second_last', 'hit_third_last'], true, material, 'wire_cutter_head');
// Axe
const axeHead = ChemicalHelper.get(TFGTagPrefix.toolHeadAxe, material, 1);
event.remove({ id: `tfc:crafting/metal/axe/${materialName}` });
addAnvilRecipe(event, axeHead, ingotItem, ['punch_last', 'hit_second_last', 'upset_third_last'], true, material, 'axe_head');
// Shovel
const shovelHead = ChemicalHelper.get(TFGTagPrefix.toolHeadShovel, material, 1);
event.remove({ id: `tfc:crafting/metal/shovel/${materialName}` });
addAnvilRecipe(event, shovelHead, ingotItem, ['punch_last', 'hit_not_last'], true, material, 'shovel_head');
// Hoe
const hoeHead = ChemicalHelper.get(TFGTagPrefix.toolHeadHoe, material, 1);
event.remove({ id: `tfc:crafting/metal/hoe/${materialName}` });
addAnvilRecipe(event, hoeHead, ingotItem, ['punch_last', 'hit_not_last', 'bend_not_last'], true, material, 'hoe_head');
// Hammer
const hammerHead = ChemicalHelper.get(TFGTagPrefix.toolHeadHammer, material, 1);
event.remove({ id: `tfc:crafting/metal/hammer/${materialName}` });
addAnvilRecipe(event, hammerHead, ingotItem, ['punch_last', 'shrink_not_last'], true, material, 'hammer_head');
// Saw
const sawHead = ChemicalHelper.get(TFGTagPrefix.toolHeadSaw, material, 1);
event.remove({ id: `tfc:crafting/metal/saw/${materialName}` });
addAnvilRecipe(event, sawHead, ingotItem, ['hit_last', 'hit_second_last'], true, material, 'saw_blade');
// Scythe
const scytheHead = ChemicalHelper.get(TFGTagPrefix.toolHeadScythe, material, 1);
event.remove({ id: `tfc:crafting/metal/scythe/${materialName}` })
addAnvilRecipe(event, scytheHead, ingotItem, ['punch_last', 'bend_not_last', 'draw_not_last'], true, material, 'scythe_blade');
// File
const fileHead = ChemicalHelper.get(TFGTagPrefix.toolHeadFile, material, 1);
addAnvilRecipe(event, fileHead, ingotItem, ['upset_last', 'bend_not_last', 'punch_not_last'], true, material, 'file_head');
// Knife
addAnvilRecipe(event, knifeHead, ingotItem, ['punch_last', 'bend_not_last', 'draw_not_last'], true, material, 'knife_blade');
}
/**
* @param {Internal.RecipesEventJS} event
* @param {GTMaterial} material
*/
function processPlatedBlock(event, material) {
const platedBlock = ChemicalHelper.get(TFGTagPrefix.blockPlated, material, 1);
if (platedBlock === null)
return;
const platedSlab = ChemicalHelper.get(TFGTagPrefix.slabPlated, material, 1);
const platedStair = ChemicalHelper.get(TFGTagPrefix.stairPlated, material, 1);
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
const materialName = material.getName();
event.shapeless(platedBlock, ['#forge:stone_bricks', plateItem, '#forge:tools/hammers'])
.id(`tfg:shapeless/${materialName}_plated_block`)
event.recipes.gtceu.assembler(`tfg:${materialName}_plated_block`)
.itemInputs('#forge:stone_bricks', plateItem)
.itemOutputs(platedBlock)
.circuit(10)
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
addMaterialRecycling(event, platedBlock, material, 'plated_block', TFGTagPrefix.blockPlated);
event.shapeless(platedSlab.withCount(2), ['2x #tfg:brick_slabs', plateItem, '#forge:tools/hammers'])
.id(`tfg:item_application/${materialName}_plated_slab`)
event.recipes.gtceu.assembler(`tfg:${materialName}_plated_slab`)
.itemInputs('2x #tfg:brick_slabs', plateItem)
.itemOutputs(platedSlab.withCount(2))
.circuit(10)
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
addMaterialRecycling(event, platedSlab, material, 'plated_slab', TFGTagPrefix.slabPlated);
event.shapeless(platedStair, ['#tfg:brick_stairs', plateItem, '#forge:tools/hammers'])
.id(`tfg:item_application/${materialName}_plated_stair`)
event.recipes.gtceu.assembler(`tfg:${materialName}_plated_stair`)
.itemInputs('#tfg:brick_stairs', plateItem)
.itemOutputs(platedStair)
.circuit(10)
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
addMaterialRecycling(event, platedStair, material, 'plated_stair', TFGTagPrefix.stairPlated);
}

View file

@ -0,0 +1,186 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
* @param {GTToolType} toolType
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processToolMortar(event, toolType, material) {
const toolItem = ToolHelper.get(toolType, material)
if (toolItem.isEmpty())
return;
const usableItem = ChemicalHelper.get(TagPrefix.ingot, material, 1)
if (usableItem.isEmpty())
return;
event.recipes.tfc.damage_inputs_shaped_crafting(
event.shaped(toolItem, [
'CA ',
' B '
], {
A: usableItem,
B: '#tfc:rock/raw',
C: '#tfc:chisels'
})
).id(`gtceu:shaped/mortar_${material.getName()}`);
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty !== null) {
addTFCMelting(event, toolItem, material, 144, 'mortar');
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {GTToolType} toolType
* @param {String} tagPrefixName
* @param {TagPrefix} headTagPrefix
* @param {Internal.ItemStack} extruderMold
* @param {Internal.ItemStack} ceramicMold
* @param {number} circuitMeta
* Used for the laser engraver recipes for gem tools.
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processGTToolHead(event, toolType, tagPrefixName, headTagPrefix, extruderMold, ceramicMold, circuitMeta, material) {
const toolItem = ToolHelper.get(toolType, material);
const toolHeadItem = ChemicalHelper.get(headTagPrefix, material, 1);
if (toolItem.isEmpty() || toolHeadItem.isEmpty())
return;
// Skip this one because it has a duping bug, and you can't remove the macerator/arc furnace iron pick recipes
if (material === GTMaterials.Iron)
return;
const materialName = material.getName();
if (toolType === GTToolType.WRENCH) {
event.recipes.tfc.advanced_shaped_crafting(
TFC.itemStackProvider.of(toolItem).copyForgingBonus().copyHeat(), [
'ABC',
'DB '
], {
A: toolHeadItem,
B: `#forge:rods/${materialName}`,
C: '#forge:tools/screwdrivers',
D: `#forge:bolts/${materialName}`
}, 0, 0)
.id(`gtceu:shaped/${toolType.name}_${materialName}`);
} else if (toolType === GTToolType.WIRE_CUTTER) {
event.recipes.tfc.advanced_shaped_crafting(
TFC.itemStackProvider.of(toolItem).copyForgingBonus().copyHeat(), [
' AD',
'CBC'
], {
A: toolHeadItem,
B: `#forge:small_springs`,
C: `#forge:rods/${materialName}`,
D: '#forge:tools/screwdrivers'
}, 0, 1)
.id(`gtceu:shaped/${toolType.name}_${materialName}`);
} else {
event.recipes.tfc.advanced_shapeless_crafting(
TFC.itemStackProvider.of(toolItem).copyForgingBonus().copyHeat(),
[toolHeadItem, '#forge:rods/wooden'],
toolHeadItem
)
.id(`gtceu:shaped/${toolType.name}_${materialName}`);
}
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty !== null) {
const materialAmount = getMaterialAmount(headTagPrefix, material);
addTFCMelting(event, toolItem, material, materialAmount * 144, toolType.name);
}
processToolHead(event, headTagPrefix, tagPrefixName, extruderMold, ceramicMold, circuitMeta, material);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {TagPrefix} headTagPrefix
* @param {String} tagPrefixName
* @param {Internal.ItemStack} extruderMold
* @param {Internal.ItemStack} ceramicMold
* @param {number} circuitMeta
* Used for the laser engraver recipes for gem tools.
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processToolHead(event, headTagPrefix, tagPrefixName, extruderMold, ceramicMold, circuitMeta, material) {
const toolHeadItem = ChemicalHelper.get(headTagPrefix, material, 1);
if (toolHeadItem.isEmpty())
return;
event.remove({ mod: 'gtceu', type: 'minecraft:crafting_shaped', output: toolHeadItem })
const materialName = material.getName();
const materialAmount = getMaterialAmount(headTagPrefix, material);
// Metal-based tools
if (material.hasProperty(PropertyKey.INGOT)) {
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1);
if (ingotItem.hasTag('c:hidden_from_recipe_viewers'))
return
event.recipes.gtceu.extruder(`tfg:extrude_${materialName}_ingot_to_${tagPrefixName}`)
.itemInputs(ingotItem.copyWithCount(materialAmount))
.notConsumable(extruderMold)
.itemOutputs(toolHeadItem)
.duration(material.getMass() * 6)
.EUt(GTValues.VA[GTValues.LV])
let input_array = [];
for (let i = 0; i < materialAmount; i++) {
input_array.push(ingotItem);
}
event.recipes.vintageimprovements.curving(toolHeadItem, input_array)
.head(extruderMold)
.id(`tfg:vi/curving/${materialName}_ingot_to_${tagPrefixName}`)
if (material.hasFlag(TFGMaterialFlags.CAN_BE_UNMOLDED) && ceramicMold !== null) {
addMaterialCasting(event, toolHeadItem, ceramicMold, false, null, material, tagPrefixName, materialAmount * 144);
}
}
// Gem tools
else if (material.hasProperty(PropertyKey.GEM)) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, materialAmount)
if (gemItem.isEmpty() || gemItem.hasTag('c:hidden_from_recipe_viewers'))
return
event.recipes.gtceu.laser_engraver(`tfg:engrave_${materialName}_gem_to_${tagPrefixName}`)
.itemInputs(gemItem)
.notConsumable(ChemicalHelper.get(TagPrefix.lens, GTMaterials.Glass, 1))
.circuit(circuitMeta)
.itemOutputs(toolHeadItem)
.duration(material.getMass() * 6)
.EUt(GTValues.VA[GTValues.LV])
}
addMaterialRecycling(event, toolHeadItem, material, tagPrefixName, headTagPrefix);
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function modifyRecyclingAmounts(material) {
TagPrefix.toolHeadWrench.modifyMaterialAmount(material, 2);
TagPrefix.toolHeadBuzzSaw.modifyMaterialAmount(material, 2);
TagPrefix.toolHeadScrewdriver.modifyMaterialAmount(material, 1);
TagPrefix.toolHeadWireCutter.modifyMaterialAmount(material, 2);
TFGTagPrefix.toolHeadSword.modifyMaterialAmount(material, 2);
TFGTagPrefix.toolHeadButcheryKnife.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadMiningHammer.modifyMaterialAmount(material, 2);
TFGTagPrefix.toolHeadSpade.modifyMaterialAmount(material, 2);
TFGTagPrefix.toolHeadPickaxe.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadAxe.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadShovel.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadHoe.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadHammer.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadSaw.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadFile.modifyMaterialAmount(material, 1);
TFGTagPrefix.toolHeadKnife.modifyMaterialAmount(material, 1);
}

View file

@ -1,28 +1,352 @@
// priority: 0
// priority: 0
"use strict";
//function getMaterialRecyclingExtractorEUt(material) {
// // Special case for bis/black bronze because removing the blast property doesn't change the tier of
// // the extractor recipes retroactively
// return material.hasProperty(PropertyKey.BLAST) && material !== GTMaterials.BismuthBronze && material !== GTMaterials.BlackBronze
// ? GTValues.VA[GTValues.MV]
// : GTValues.VA[GTValues.LV];
//}
//function addMaterialRecycling(event, item, materialMap) {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function getFluidRecipeEUt(material) {
// Special case for bis/black bronze because removing the blast property doesn't change the tier of
// the extractor recipes retroactively
return material.hasProperty(PropertyKey.BLAST) && material !== GTMaterials.BismuthBronze && material !== GTMaterials.BlackBronze
? GTValues.VA[GTValues.MV]
: GTValues.VA[GTValues.LV];
}
// const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
// if (tfcProperty !== null) {
// const outputMaterial = (tfcProperty.getOutputMaterial() === null) ? material : tfcProperty.getOutputMaterial();
/**
* @param {TagPrefix} tagPrefix
*/
function getMaterialAmount(tagPrefix, material) {
return tagPrefix.getMaterialAmount(material) / GTValues.M;
}
// event.recipes.tfc.heating(ingotItem, tfcProperty.getMeltTemp())
// .resultFluid(Fluid.of(outputMaterial.getFluid(), 144))
// .id(`tfc:heating/metal/${material.getName()}_ingot`)
// }
//}
/**
* @param {Internal.RecipesEventJS} event
* @param {Internal.ItemStack} inputItem
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {number} mbAmount
* @param {String} recipeIdSuffix
*/
function addTFCMelting(event, inputItem, material, mbAmount, recipeIdSuffix) {
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
const outputMaterial = (tfcProperty.getOutputMaterial() === null) ? material : tfcProperty.getOutputMaterial();
if (!outputMaterial.hasProperty(PropertyKey.FLUID))
return;
event.recipes.tfc.heating(inputItem, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), mbAmount))
.useDurability(true)
.id(`tfg:heating/metal/${material.getName()}_${recipeIdSuffix}`);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {Internal.ItemStack} outputItem
* @param {Internal.ItemStack} inputItem
* @param {String[]} steps
* @param {boolean} bonus
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {String} recipeIdSuffix
*/
function addAnvilRecipe(event, outputItem, inputItem, steps, bonus, material, recipeIdSuffix) {
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
event.recipes.tfc.anvil(outputItem, inputItem, steps)
.tier(tfcProperty.getTier())
.bonus(bonus)
.id(`tfc:anvil/${material.getName()}_${recipeIdSuffix}`);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {Internal.ItemStack} inputItem
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {String} tagPrefixName
* @param {TagPrefix} tagPrefix
*/
function addMaterialRecycling(event, inputItem, material, tagPrefixName, tagPrefix) {
const ingotAmount = getMaterialAmount(tagPrefix, material);
addMaterialRecyclingNoTagPrefix(event, inputItem, material, tagPrefixName, ingotAmount);
}
/**
* @param {Internal.RecipesEventJS} event
* @param {Internal.ItemStack} inputItem
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {String} recipeSuffix
* @param {number} ingotAmount
*/
function addMaterialRecyclingNoTagPrefix(event, inputItem, material, recipeSuffix, ingotAmount) {
const materialName = material.getName();
const mbAmount = ingotAmount * 144;
if (material.hasProperty(PropertyKey.FLUID)) {
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
addTFCMelting(event, inputItem, material, mbAmount, recipeSuffix);
}
// Add an extractor recipe
event.recipes.gtceu.extractor(`gtceu:extract_${materialName}_${recipeSuffix}`)
.itemInputs(inputItem)
.outputFluids(Fluid.of(material.getFluid(), mbAmount))
.category(GTRecipeCategories.EXTRACTOR_RECYCLING)
.duration(material.getMass() * ingotAmount)
.EUt(getFluidRecipeEUt(material));
}
// Remove existing macerator recipes because Greate
removeMaceratorRecipe(event, `macerate_${materialName}_${recipeSuffix}`);
const maceratorOutput = ChemicalHelper.getDust(material, GTValues.M * ingotAmount);
if (!maceratorOutput.isEmpty()) {
event.recipes.gtceu.macerator(`tfg:macerate_${materialName}_${recipeSuffix}`)
.itemInputs(inputItem)
.itemOutputs(maceratorOutput)
.category(GTRecipeCategories.MACERATOR_RECYCLING)
.duration(material.getMass() * ingotAmount)
.EUt(2);
}
const arcOutput = ChemicalHelper.getIngot(material, GTValues.M * ingotAmount);
if (!arcOutput.isEmpty()) {
event.recipes.gtceu.arc_furnace(`tfg:arc_${materialName}_${recipeSuffix}`)
.itemInputs(inputItem)
.itemOutputs(arcOutput)
.category(GTRecipeCategories.ARC_FURNACE_RECYCLING)
.duration(material.getMass() * ingotAmount)
.EUt(30);
}
let matmap = {};
matmap[materialName] = ingotAmount;
TFGHelpers.registerMaterialInfo(inputItem, matmap);
}
/**
* Function to get fluid filling NBT.
*
* @param {string} material
* Fluid
* @param {number} amount
* mB
* @returns {{ tank: { FluidName: string; Amount: number; }; }}
*/
const getFillingNBT = (material, amount) => {
return {
tank: {
FluidName: Fluid.of(material.getFluid()).getId(),
Amount: amount
}
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {Internal.ItemStack} outputItem
* @param {String} ceramicMold
* @param {boolean} isFireMold
* @param {String} gtMold
* The mold item for the fluid solidifier/alloy smelter.
* Pass null for built-in GT molds, since GT already generates recipes for those
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {String} tagPrefixName
* @param {number} mbAmount
*/
function addMaterialCasting(event, outputItem, ceramicMold, isFireMold, gtMold, material, tagPrefixName, mbAmount) {
const materialName = material.getName();
// If it's a TFC material, add ceramic mold casting + create spouting
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
if (tfcProperty !== null
&& ceramicMold !== null
&& material !== GTMaterials.WroughtIron
&& material.hasFlag(TFGMaterialFlags.CAN_BE_UNMOLDED))
{
const outputMaterial = (tfcProperty.getOutputMaterial() === null) ? material : tfcProperty.getOutputMaterial();
const id = `${materialName}_${tagPrefixName}_${isFireMold ? 'fire' : 'ceramic'}`;
event.recipes.tfc.casting(outputItem, ceramicMold, Fluid.of(outputMaterial.getFluid(), mbAmount), isFireMold ? 0.01 : 0.1)
.id(`tfg:casting/${id}`);
event.recipes.create.filling(Item.of(ceramicMold, getFillingNBT(outputMaterial, mbAmount)), [
Fluid.of(outputMaterial.getFluid(), mbAmount),
Item.of(ceramicMold).strongNBT()
]).id(`tfg:filling/${id}`);
}
// If there's a gregtech mold, add alloy smelter/fluid solidifier recipes.
if (gtMold !== null) {
const ingotAmount = mbAmount / 144;
event.recipes.gtceu.alloy_smelter(`tfg:cast_${materialName}_${tagPrefixName}`)
.itemInputs(ChemicalHelper.get(TagPrefix.ingot, material, ingotAmount))
.notConsumable(gtMold)
.itemOutputs(outputItem)
.duration(material.getMass() * 2 * ingotAmount)
.EUt(getFluidRecipeEUt(material))
.category(GTRecipeCategories.INGOT_MOLDING)
event.recipes.gtceu.fluid_solidifier(`tfg:solidify_${materialName}_${tagPrefixName}`)
.inputFluids(Fluid.of(material.getFluid(), mbAmount))
.notConsumable(gtMold)
.itemOutputs(outputItem)
.duration(material.getMass() * 2 * ingotAmount)
.EUt(getFluidRecipeEUt(material))
}
}
/**
* @param {Internal.RecipesEventJS} event
* @param {Internal.ItemStack} outputItem
* @param {Internal.ItemStack} inputItem1
* @param {Internal.ItemStack} inputItem2
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @param {number} tierThreshold
* Should be 4 for everything except double ingots, which should be 5
* @param {number} nonTfcTier
* What recipe tier should non-tfc materials use? 0 for ulv, 1 for lv, etc
*/
function addMaterialWelding(event, outputItem, inputItem1, inputItem2, material, tierThreshold, nonTfcTier) {
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY);
const id = `${material.getName()}_${linuxUnfucker(outputItem)}`;
let compactingTier = nonTfcTier;
if (tfcProperty !== null) {
event.recipes.tfc.welding(outputItem, inputItem1, inputItem2, tfcProperty.getTier() - 1)
.id(`tfc:welding/${id}`);
compactingTier = tfcProperty.getTier() < tierThreshold ? 0 : 1;
}
event.recipes.greate.compacting(outputItem, [inputItem1, inputItem2, 'tfc:powder/flux'])
.heated()
.recipeTier(compactingTier)
.circuitNumber(0)
.id(`tfg:compacting/${id}`);
event.recipes.gtceu.forming_press(`tfg:${id}`)
.itemInputs(inputItem1, inputItem2, 'tfc:powder/flux')
.itemOutputs(outputItem)
.duration(material.getMass())
.EUt(GTValues.VA[compactingTier]);
}
/**
* @param {Internal.RecipesEventJS} event
*/
function registerTFGMaterialRecipes(event) {
const $GreateMaterials = Java.loadClass("electrolyte.greate.registry.GreateMaterials")
forEachMaterial(material => {
// greate moment
if (material === $GreateMaterials.AndesiteAlloy
|| material === $GreateMaterials.RefinedRadiance
|| material === $GreateMaterials.ShadowSteel
|| material === $GreateMaterials.ChromaticCompound
|| material === GTMaterials.DamascusSteel)
{ return; }
if (material.hasProperty(PropertyKey.DUST)) {
processDust(event, material)
processPowder(event, material)
}
const toolProperty = material.getProperty(PropertyKey.TOOL)
if (toolProperty !== null) {
modifyRecyclingAmounts(material)
let circuit = 1;
processGTToolHead(event, GTToolType.SWORD, "sword_head", TFGTagPrefix.toolHeadSword, 'tfg:sword_head_extruder_mold', 'tfc:ceramic/sword_blade_mold', circuit++, material)
processGTToolHead(event, GTToolType.PICKAXE, "pickaxe_head", TFGTagPrefix.toolHeadPickaxe, 'tfg:pickaxe_head_extruder_mold', 'tfc:ceramic/pickaxe_head_mold', circuit++, material)
processGTToolHead(event, GTToolType.AXE, "axe_head", TFGTagPrefix.toolHeadAxe, 'tfg:axe_head_extruder_mold', 'tfc:ceramic/axe_head_mold', circuit++, material)
processGTToolHead(event, GTToolType.SHOVEL, "shovel_head", TFGTagPrefix.toolHeadShovel, 'tfg:shovel_head_extruder_mold', 'tfc:ceramic/shovel_head_mold', circuit++, material)
processGTToolHead(event, GTToolType.HOE, "hoe_head", TFGTagPrefix.toolHeadHoe, 'tfg:hoe_head_extruder_mold', 'tfc:ceramic/hoe_head_mold', circuit++, material)
processGTToolHead(event, GTToolType.KNIFE, "knife_head", TFGTagPrefix.toolHeadKnife, 'tfg:knife_head_extruder_mold', 'tfc:ceramic/knife_blade_mold', circuit++, material)
processGTToolHead(event, GTToolType.FILE, "file_head", TFGTagPrefix.toolHeadFile, 'tfg:file_head_extruder_mold', null, circuit++, material)
processGTToolHead(event, GTToolType.SAW, "saw_head", TFGTagPrefix.toolHeadSaw, 'tfg:saw_head_extruder_mold', 'tfc:ceramic/saw_blade_mold', circuit++, material)
processGTToolHead(event, GTToolType.SPADE, "spade_head", TFGTagPrefix.toolHeadSpade, 'tfg:spade_head_extruder_mold', null, circuit++, material)
processGTToolHead(event, GTToolType.MINING_HAMMER, "mining_hammer_head", TFGTagPrefix.toolHeadMiningHammer, 'tfg:mining_hammer_head_extruder_mold', null, circuit++, material)
processGTToolHead(event, GTToolType.SCYTHE, "scythe_head", TFGTagPrefix.toolHeadScythe, 'tfg:scythe_head_extruder_mold', 'tfc:ceramic/scythe_blade_mold', circuit++, material)
processGTToolHead(event, GTToolType.HARD_HAMMER, "hammer_head", TFGTagPrefix.toolHeadHammer, 'tfg:hammer_head_extruder_mold', 'tfc:ceramic/hammer_head_mold', circuit++, material)
processGTToolHead(event, GTToolType.BUTCHERY_KNIFE, "butchery_knife_head", TFGTagPrefix.toolHeadButcheryKnife, 'tfg:butchery_knife_head_extruder_mold', null, circuit++, material)
processGTToolHead(event, GTToolType.SCREWDRIVER, "screwdriver_tip", TagPrefix.toolHeadScrewdriver, 'tfg:screwdriver_tip_extruder_mold', null, circuit++, material)
processGTToolHead(event, GTToolType.WRENCH, "wrench_tip", TagPrefix.toolHeadWrench, 'tfg:wrench_tip_extruder_mold', null, circuit++, material)
processGTToolHead(event, GTToolType.WIRE_CUTTER, "wire_cutter_head", TagPrefix.toolHeadWireCutter, 'tfg:wire_cutter_head_extruder_mold', null, circuit++, material)
processToolMortar(event, GTToolType.MORTAR, material)
processToolHead(event, TFGTagPrefix.toolHeadPropick, "propick_head", 'tfg:propick_head_extruder_mold', 'tfc:ceramic/propick_head_mold', circuit++, material)
processToolHead(event, TFGTagPrefix.toolHeadJavelin, "javelin_head", 'tfg:javelin_head_extruder_mold', 'tfc:ceramic/javelin_head_mold', circuit++, material)
processToolHead(event, TFGTagPrefix.toolHeadChisel, "chisel_head", 'tfg:chisel_head_extruder_mold', 'tfc:ceramic/chisel_head_mold', circuit++, material)
processToolHead(event, TFGTagPrefix.toolHeadMace, "mace_head", 'tfg:mace_head_extruder_mold', 'tfc:ceramic/mace_head_mold', circuit++, material)
processToolHead(event, TFGTagPrefix.toolHeadMattock, "mattock_head", 'tfg:mattock_head_extruder_mold', null, circuit++, material)
processToolHead(event, TFGTagPrefix.toolHeadHook, "fish_hook", 'tfg:fish_hook_extruder_mold', null, circuit++, material)
}
if (material.hasProperty(PropertyKey.INGOT)) {
processIngot(event, material)
processIngotDouble(event, material)
processPlate(event, material)
processPlateDouble(event, material)
processBlock(event, material)
processFoil(event, material)
processRod(event, material)
processBars(event, material)
processBolt(event, material)
processScrew(event, material)
processRing(event, material)
processSpring(event, material)
processNugget(event, material)
processSmallGear(event, material)
processLargeGear(event, material)
processBuzzsawBlade(event, material)
processPlatedBlock(event, material)
}
if (material.hasProperty(PropertyKey.GEM)) {
processGems(event, material)
processPlate(event, material)
processBlock(event, material)
processRod(event, material)
processBolt(event, material)
processScrew(event, material)
processSmallGear(event, material)
processLargeGear(event, material)
processBuzzsawBlade(event, material)
}
if (material.hasProperty(TFGPropertyKey.TFC_PROPERTY)) {
processAnvil(event, material)
processLamp(event, material)
processTrapdoor(event, material)
processChain(event, material)
processBell(event, material)
}
if (material.hasFlag(TFGMaterialFlags.HAS_TFC_ARMOR)) {
processTFCArmor(event, material)
}
if (material.hasFlag(TFGMaterialFlags.HAS_TFC_TOOL) || material.hasFlag(TFGMaterialFlags.HAS_GT_TOOL)) {
processTFCTool(event, material)
}
const oreProperty = material.getProperty(PropertyKey.ORE);
if (oreProperty !== null) {
processSmallOre(event, material)
processPoorRawOre(event, material)
processNormalRawOre(event, material)
processRichRawOre(event, material)
processCrushedOre(event, material)
processPurifiedOre(event, material)
processRefinedOre(event, material)
processImpureDust(event, material)
processPureDust(event, material)
// Indicators
event.replaceInput({ id: `gtceu:shaped/${material.getName()}_surface_indicator` }, 'minecraft:gravel', '#tfc:rock/gravel')
}
})
}

View file

@ -9,6 +9,7 @@ const registerGTCEuMaterialModification = (event) => {
const $INGOT_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.IngotProperty')
const $DUST_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.DustProperty');
const $BLAST_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.BlastProperty')
const $FLUID_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidProperty')
const $ITEM_PIPE_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.ItemPipeProperties')
const $FLUID_PIPE_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.FluidPipeProperties')
const $HAZARD_PROPERTY = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.HazardProperty')
@ -17,6 +18,7 @@ const registerGTCEuMaterialModification = (event) => {
const $MATERIAL_FLAGS = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.info.MaterialFlags')
const $FluidStorageKeys = Java.loadClass('com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys')
const $FluidBuilder = Java.loadClass('com.gregtechceu.gtceu.api.fluids.FluidBuilder');
const $GreateMaterials = Java.loadClass("electrolyte.greate.registry.GreateMaterials")
@ -29,7 +31,6 @@ const registerGTCEuMaterialModification = (event) => {
GENERATE_BELL,
GENERATE_DOUBLE_INGOTS,
HAS_SMALL_TFC_ORE,
HAS_SMALL_NATIVE_TFC_ORE,
GENERATE_DUSTY_ORES,
} = TFGMaterialFlags
@ -86,7 +87,6 @@ const registerGTCEuMaterialModification = (event) => {
GTToolType.CROWBAR,
]
/* TFC Проперти для материалов */
// TFC_PROPERTY = (forging temp, welding temp, melt temp, material, tier, percent of material)
// OR = (forging temp, welding temp, melt temp, tier)
@ -116,7 +116,7 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Iron.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3));
GTMaterials.Hematite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3, 90));
GTMaterials.YellowLimonite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3, 90));
GTMaterials.Limonite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3, 90));
GTMaterials.Magnetite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3, 90));
GTMaterials.Pyrite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3, 90));
GTMaterials.Goethite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(921, 1228, 1535, GTMaterials.Iron, 3, 90));
@ -153,26 +153,7 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Pollucite.setProperty(TFGPropertyKey.TFC_PROPERTY, new $TFC_PROPERTY(1540, 1540, 1540, AlSi, 1, 25))
GTMaterials.Gold.addFlags(GENERATE_BELL);
GTMaterials.Brass.addFlags(GENERATE_BELL);
GTMaterials.Bronze.addFlags(GENERATE_BELL);
//
//
// /* Имеют двойные слитки */
GTMaterials.Iron.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Gold.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Bismuth.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Brass.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Nickel.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.RoseGold.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Silver.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Tin.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Zinc.addFlags(GENERATE_DOUBLE_INGOTS, GENERATE_BOLT_SCREW);
GTMaterials.SterlingSilver.addFlags(GENERATE_DOUBLE_INGOTS);
//#region Generate Dusty Ores for Infinite Ores
// Generate Dusty Ores for Infinite Ores
GTMaterials.Goethite.addFlags(GENERATE_DUSTY_ORES);
GTMaterials.Diamond.addFlags(GENERATE_DUSTY_ORES);
GTMaterials.CertusQuartz.addFlags(GENERATE_DUSTY_ORES);
@ -188,9 +169,7 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Uraninite.addFlags(GENERATE_DUSTY_ORES);
GTMaterials.Hematite.addFlags(GENERATE_DUSTY_ORES);
//#endregion
//
// /* Castable stuff */
// Castable stuff
GTMaterials.Copper.addFlags(CAN_BE_UNMOLDED);
GTMaterials.BismuthBronze.addFlags(CAN_BE_UNMOLDED);
GTMaterials.BlackBronze.addFlags(CAN_BE_UNMOLDED);
@ -208,8 +187,8 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Lead.addFlags(CAN_BE_UNMOLDED);
GTMaterials.Potin.addFlags(CAN_BE_UNMOLDED);
GTMaterials.Iron.addFlags(CAN_BE_UNMOLDED);
//
// /* Имеют инструменты, броню TFC, двойные слитки */
// TFC tool tiers
GTMaterials.Copper.addFlags(GENERATE_DOUBLE_INGOTS, HAS_TFC_TOOL, HAS_TFC_ARMOR, HAS_TFC_UTILITY);
GTMaterials.BismuthBronze.addFlags(GENERATE_DOUBLE_INGOTS, HAS_TFC_TOOL, HAS_TFC_ARMOR, HAS_TFC_UTILITY);
GTMaterials.Bronze.addFlags(GENERATE_DOUBLE_INGOTS, HAS_TFC_TOOL, HAS_TFC_ARMOR, HAS_TFC_UTILITY);
@ -219,25 +198,34 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.BlackSteel.addFlags(GENERATE_DOUBLE_INGOTS, GENERATE_ROTOR, HAS_TFC_TOOL, HAS_TFC_ARMOR, HAS_TFC_UTILITY);
GTMaterials.RedSteel.addFlags(GENERATE_DOUBLE_INGOTS, HAS_TFC_TOOL, HAS_TFC_ARMOR, HAS_TFC_UTILITY);
GTMaterials.BlueSteel.addFlags(GENERATE_DOUBLE_INGOTS, HAS_TFC_TOOL, HAS_TFC_ARMOR, HAS_TFC_UTILITY);
//
// /* Имеют маленькие куски руды TFC */
// TFC ores
GTMaterials.Bismuth.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Cassiterite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Garnierite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Hematite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.YellowLimonite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Limonite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Magnetite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Malachite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Sphalerite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Tetrahedrite.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Chromite.addFlags(HAS_SMALL_TFC_ORE);
//
// /* Имеют маленькие чистые куски руды TFC */
GTMaterials.Copper.addFlags(HAS_SMALL_NATIVE_TFC_ORE);
GTMaterials.Gold.addFlags(HAS_SMALL_NATIVE_TFC_ORE);
GTMaterials.Silver.addFlags(HAS_SMALL_NATIVE_TFC_ORE);
//
// /* Имеют двойные слитки */
GTMaterials.Copper.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Gold.addFlags(HAS_SMALL_TFC_ORE);
GTMaterials.Silver.addFlags(HAS_SMALL_TFC_ORE);
// Other materials that are compatible with TFC
GTMaterials.Iron.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Gold.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Bismuth.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Brass.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Nickel.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.RoseGold.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Silver.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Tin.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Zinc.addFlags(GENERATE_DOUBLE_INGOTS, GENERATE_BOLT_SCREW);
GTMaterials.SterlingSilver.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.RedAlloy.addFlags(GENERATE_DOUBLE_INGOTS, GENERATE_SMALL_GEAR);
GTMaterials.TinAlloy.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.Lead.addFlags(GENERATE_DOUBLE_INGOTS);
@ -245,8 +233,8 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Potin.addFlags(GENERATE_DOUBLE_INGOTS, );
GTMaterials.Cobalt.addFlags(GENERATE_DOUBLE_INGOTS);
GTMaterials.CobaltBrass.addFlags(GENERATE_DOUBLE_INGOTS, HAS_GT_TOOL);
//
// /* Superconductors */
// Superconductors
GTMaterials.ManganesePhosphide.addFlags(GENERATE_FINE_WIRE);
GTMaterials.MagnesiumDiboride.addFlags(GENERATE_FINE_WIRE);
GTMaterials.MercuryBariumCalciumCuprate.addFlags(GENERATE_FINE_WIRE);
@ -256,18 +244,31 @@ const registerGTCEuMaterialModification = (event) => {
//GTMaterials.UraniumRhodiumDinaquadide.addFlags();
//GTMaterials.EnrichedNaquadahTriniumEuropiumDuranide.addFlags();
GTMaterials.RutheniumTriniumAmericiumNeutronate.addFlags(GENERATE_FINE_WIRE);
//
// /* Другое (Other) */
// TODO: Exception needs to check the wizardry
// Ores
GTMaterials.Bismuth.setProperty(PropertyKey.ORE, new $ORE_PROPERTY());
GTMaterials.EXT2_METAL.forEach(tag => GTMaterials.Bismuth.addFlags(tag))
GTMaterials.Borax.setProperty(PropertyKey.ORE, new $ORE_PROPERTY());
let rose_quartz = $GreateMaterials.RoseQuartz;
rose_quartz.setProperty(PropertyKey.ORE, new $ORE_PROPERTY());
rose_quartz.getProperty(PropertyKey.ORE).setOreByProducts(rose_quartz, GTMaterials.Redstone, rose_quartz);
// Change byproducts so you can't get certus from normal quartzite
GTMaterials.Quartzite.getProperty(PropertyKey.ORE).setOreByProducts(GTMaterials.NetherQuartz, GTMaterials.Barite, GTMaterials.NetherQuartz);
GTMaterials.CertusQuartz.getProperty(PropertyKey.ORE).setOreByProducts(GTMaterials.CertusQuartz, GTMaterials.Quartzite, GTMaterials.CertusQuartz);
// Change Beryllium to add Chemical Bath recipe and Thorium byproduct
GTMaterials.Beryllium.getProperty(PropertyKey.ORE).setOreByProducts(GTMaterials.Emerald, GTMaterials.Emerald, GTMaterials.Thorium, GTMaterials.Thorium);
GTMaterials.Beryllium.getProperty(PropertyKey.ORE).setWashedIn(GTMaterials.SodiumPersulfate);
// Other flags
GTMaterials.CertusQuartz.addFlags(GENERATE_ROD);
GTMaterials.NetherQuartz.addFlags(GENERATE_ROD);
GTMaterials.Gold.addFlags(GENERATE_BELL);
GTMaterials.Brass.addFlags(GENERATE_BELL);
GTMaterials.Bronze.addFlags(GENERATE_BELL);
GTMaterials.Copper.addFlags(GENERATE_FRAME);
GTMaterials.BlackBronze.addFlags(GENERATE_FRAME);
GTMaterials.BismuthBronze.addFlags(GENERATE_FRAME);
@ -304,7 +305,8 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.TinAlloy.addFlags(GENERATE_RING);
GTMaterials.SterlingSilver.addFlags(GENERATE_RING);
GTMaterials.IronMagnetic.addFlags(GENERATE_PLATE)
GTMaterials.Bismuth.addFlags(GENERATE_PLATE, GENERATE_ROD, GENERATE_BOLT_SCREW);
GTMaterials.IronMagnetic.addFlags(GENERATE_PLATE);
GTMaterials.Silicon.addFlags(GENERATE_DENSE);
GTMaterials.RTMAlloy.addFlags(GENERATE_DENSE, GENERATE_SPRING);
@ -315,7 +317,7 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.TreatedWood.addFlags(GENERATE_LONG_ROD);
// Hide ore processing tab for plutonium
GTMaterials.Plutonium239.addFlags(GENERATE_ROD, NO_ORE_PROCESSING_TAB, NO_ORE_SMELTING)
GTMaterials.Plutonium239.addFlags(GENERATE_ROD, GENERATE_LONG_ROD, NO_ORE_PROCESSING_TAB, NO_ORE_SMELTING)
GTMaterials.Thorium.addFlags(NO_ORE_SMELTING)
// Unhiding elements
@ -323,7 +325,7 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Zirconium.setProperty(PropertyKey.INGOT, new $INGOT_PROPERTY());
GTMaterials.Zirconium.setProperty(PropertyKey.BLAST, new $BLAST_PROPERTY(4200, 'mid', GTValues.VA[GTValues.EV], 1300, GTValues.VA[GTValues.HV], 14.7*20));
GTMaterials.Zirconium.addFlags(GENERATE_FINE_WIRE, GENERATE_PLATE, NO_ORE_SMELTING);
// Tools
GTMaterials.Stone.setProperty(PropertyKey.TOOL, ToolProperty.Builder.of(1.2, 1.0, 8, 1, [
GTToolType.AXE,
@ -385,14 +387,10 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.RedSteel.getProperty(PropertyKey.BLAST).setBlastTemperature(1000)
GTMaterials.BlueSteel.getProperty(PropertyKey.BLAST).setBlastTemperature(1000)
// Change byproducts so you can't get certus from normal quartzite
GTMaterials.Quartzite.getProperty(PropertyKey.ORE).setOreByProducts(GTMaterials.NetherQuartz, GTMaterials.Barite, GTMaterials.NetherQuartz);
GTMaterials.CertusQuartz.getProperty(PropertyKey.ORE).setOreByProducts(GTMaterials.CertusQuartz, GTMaterials.Quartzite, GTMaterials.CertusQuartz);
// Change Beryllium to add Chemical Bath recipe and Thorium byproduct
GTMaterials.Beryllium.getProperty(PropertyKey.ORE).setOreByProducts(GTMaterials.Emerald, GTMaterials.Emerald, GTMaterials.Thorium, GTMaterials.Thorium);
GTMaterials.Beryllium.getProperty(PropertyKey.ORE).setWashedIn(GTMaterials.SodiumPersulfate);
// BLAST property
let zirconium_diboride = TFGHelpers.getMaterial('zirconium_diboride');
zirconium_diboride.setProperty(PropertyKey.BLAST, new $BLAST_PROPERTY(4500, "high", GTValues.VA[GTValues.EV], 2700, GTValues.VA[GTValues.HV], 12.5*20));
// Color Adjustments
GTMaterials.BismuthBronze.setMaterialARGB(0x5A966E)
GTMaterials.BismuthBronze.setMaterialSecondaryARGB(0x203E2A)
@ -404,7 +402,6 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.RedSteel.setMaterialSecondaryARGB(0xE12323)
GTMaterials.BlueSteel.setMaterialARGB(0xA0B6EC)
GTMaterials.BlueSteel.setMaterialSecondaryARGB(0x2B5CD8)
GTMaterials.Bismuth.setMaterialARGB(0x66847E)
GTMaterials.Bismuth.setMaterialSecondaryARGB(0x25465B)
GTMaterials.Iron.setMaterialARGB(0x503d32)
@ -446,22 +443,22 @@ const registerGTCEuMaterialModification = (event) => {
GTMaterials.Diamond.setMaterialARGB(0x4AEDD9)
GTMaterials.Diamond.setMaterialSecondaryARGB(0x1AAAA7)
// Fluids
global.MINECRAFT_DYE_NAMES.forEach(colorName => {
let material = GTMaterials.get(`gtceu:${colorName}_dye`);
let property = material.getProperty(PropertyKey.FLUID);
property.getStorage().store($FluidStorageKeys.LIQUID, () => Fluid.of(`tfc:${colorName}_dye`).fluid, null);
});
let lyeFluidProperty = new $FLUID_PROPERTY();
lyeFluidProperty.getStorage().store($FluidStorageKeys.LIQUID, () => Fluid.of('tfc:lye').fluid, null);
GTMaterials.SodiumHydroxide.setProperty(PropertyKey.FLUID, lyeFluidProperty);
let rose_quartz = $GreateMaterials.RoseQuartz;
rose_quartz.setProperty(PropertyKey.ORE, new $ORE_PROPERTY());
rose_quartz.getProperty(PropertyKey.ORE).setOreByProducts(rose_quartz, GTMaterials.Redstone, rose_quartz);
rose_quartz.setMaterialIconSet(GTMaterialIconSet.getByName('nether_quartz'))
//let bismuthFluidProperty = new $FLUID_PROPERTY();
//bismuthFluidProperty.getStorage().enqueueRegistration($FluidStorageKeys.LIQUID, new $FluidBuilder());
//GTMaterials.Bismuth.setProperty(PropertyKey.FLUID, bismuthFluidProperty);
let zirconium_diboride = TFGHelpers.getMaterial('zirconium_diboride');
zirconium_diboride.setProperty(PropertyKey.BLAST, new $BLAST_PROPERTY(4500, "high", GTValues.VA[GTValues.EV], 2700, GTValues.VA[GTValues.HV], 12.5*20));
// Components and formulas
GTMaterials.CertusQuartz.setComponents('1x unknown', '1x silicon', '2x oxygen')
GTMaterials.Glowstone.setComponents('1x gold', '1x redstone')
GTMaterials.GraniteRed.setComponents([])

View file

@ -69,7 +69,7 @@ function modifyTFGIconSets(event) {
GTMaterials.Garnierite.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_garnierite'))
GTMaterials.Nickel.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_garnierite'))
GTMaterials.Hematite.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_hematite'))
GTMaterials.YellowLimonite.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_limonite'))
GTMaterials.Limonite.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_limonite'))
GTMaterials.Magnetite.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_magnetite'))
GTMaterials.Malachite.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_malachite'))
GTMaterials.Copper.setMaterialIconSet(GTMaterialIconSet.getByName('tfc_copper'))
@ -151,4 +151,7 @@ function modifyTFGIconSets(event) {
GTMaterials.RutheniumTriniumAmericiumNeutronate.setMaterialIconSet(GTMaterialIconSet.getByName('chonky'))
GTMaterials.Zirconium.setMaterialIconSet(GTMaterialIconSet.getByName('chonky'))
const $GreateMaterials = Java.loadClass("electrolyte.greate.registry.GreateMaterials")
$GreateMaterials.RoseQuartz.setMaterialIconSet(GTMaterialIconSet.getByName('nether_quartz'))
}