Refactor & update to gt7

* gt7 removed credits/coins

* port gregtech additions to java

* add eslint locally

* add style linting

* switch target ECMA standard

* run linter

* clean up a bunch of linter errors

* remove outdated greate API calls

* forgot about the TFC multi compat issue

* reverted greate recipe removals

* some more linting stuff

* fix some issues with greenhouse recipes

* fix up some material stuff

* fix recipe types

* - Fixed single block machine rendering (#1465)

* minor fixes and changes

---------

Signed-off-by: Pyritie <pyritie@gmail.com>
Co-authored-by: Pyritie <pyritie@gmail.com>
Co-authored-by: Redeix <59435925+Redeix@users.noreply.github.com>
This commit is contained in:
Gustavo 2025-07-28 12:27:06 +10:00 committed by GitHub
parent d0af2cd96f
commit f3dfa471ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
249 changed files with 2359 additions and 792 deletions

View file

@ -29,7 +29,7 @@ const registerGTCEUHeats = (event) => {
forEachMaterial(material => {
let tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty != null) {
if (tfcProperty !== null) {
makeItemHeatByTagPrefix(TagPrefix.dustTiny, material, tfcProperty, 0.357)
makeItemHeatByTagPrefix(TagPrefix.dustSmall, material, tfcProperty, 0.714)
makeItemHeatByTagPrefix(TagPrefix.dust, material, tfcProperty, 1.429)

View file

@ -2,7 +2,7 @@
PlayerEvents.tick((event) => {
const { player } = event;
if (player.age % 100 == 0 && player.legsArmorItem == 'gtceu:nanomuscle_leggings') {
if (player.age % 100 === 0 && player.legsArmorItem === 'gtceu:nanomuscle_leggings') {
player.potionEffects.add("minecraft:speed", 350, 1, true, false);
}
});

View file

@ -168,19 +168,14 @@ const registerGTCEULoots = (event) => {
// I LOVE LOOTJS I LOVE LOOTJS I LOVE LOOTJS
let rawOreBlock = `:${ChemicalHelper.get(TagPrefix.rawOreBlock, material, 1).getItem()}`;
if (material == GTMaterials.Copper || material == GTMaterials.Gold || material == GTMaterials.Iron)
{
rawOreBlock = "minecraft" + rawOreBlock;
}
else if (material == TFGHelpers.getMaterial('desh')
|| material == TFGHelpers.getMaterial('ostrum')
|| material == TFGHelpers.getMaterial('calorite'))
{
rawOreBlock = "ad_astra" + rawOreBlock;
}
else
{
rawOreBlock = "gtceu" + rawOreBlock;
if (material === GTMaterials.Copper || material === GTMaterials.Gold || material === GTMaterials.Iron) {
rawOreBlock = `minecraft${ rawOreBlock}`;
} else if (material === TFGHelpers.getMaterial('desh')
|| material === TFGHelpers.getMaterial('ostrum')
|| material === TFGHelpers.getMaterial('calorite')) {
rawOreBlock = `ad_astra${ rawOreBlock}`;
} else {
rawOreBlock = `gtceu${ rawOreBlock}`;
}
event.addBlockLootModifier(rawOreBlock)
@ -198,10 +193,10 @@ const registerGTCEULoots = (event) => {
let stoneTypeMaterial = TFGHelpers.getMaterial(stoneType)
// Material doesn't work here because of reasons
if (stoneTypeMaterial == null) {
if (stoneType == "pyroxenite")
if (stoneTypeMaterial === null) {
if (stoneType === "pyroxenite")
stoneTypeMaterial = GTMaterials.Blackstone;
else if (stoneType == "deepslate")
else if (stoneType === "deepslate")
stoneTypeMaterial = GTMaterials.Deepslate;
}

View file

@ -1010,11 +1010,11 @@ const registerGTCEURecipes = (event) => {
forEachMaterial(material => {
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
if (tfcProperty == null)
if (tfcProperty === null)
return;
const outputMaterial = tfcProperty.getOutputMaterial() == null ? material : tfcProperty.getOutputMaterial()
if (outputMaterial == GTMaterials.Iron) {
const outputMaterial = tfcProperty.getOutputMaterial() === null ? material : tfcProperty.getOutputMaterial()
if (outputMaterial === GTMaterials.Iron) {
event.recipes.gtceu.steam_bloomery(`steam_raw_iron_bloom_coal_${material.getName()}`)
.itemInputs(ChemicalHelper.get(TagPrefix.dust, material, 1), '#tfc:steam_bloomery_basic_fuels')
.itemOutputs('tfc:raw_iron_bloom')
@ -1131,48 +1131,12 @@ const registerGTCEURecipes = (event) => {
//#endregion
//#region Credits
event.remove({ id: 'gtceu:forming_press/credit_cupronickel' })
event.recipes.gtceu.forming_press('gtceu:copper_credit')
.itemInputs('#forge:ingots/copper')
.notConsumable('gtceu:credit_casting_mold')
.itemOutputs('8x gtceu:copper_credit')
.duration(50)
.EUt(2)
event.recipes.tfc.anvil('8x gtceu:copper_credit', '#forge:ingots/copper', ['bend_last', 'punch_not_last', 'draw_not_last'])
.tier(1)
.id(`tfc:anvil/copper_credit`)
event.recipes.tfc.heating('gtceu:copper_credit', GTMaterials.Copper.getProperty(TFGPropertyKey.TFC_PROPERTY).getMeltTemp())
.resultFluid(Fluid.of(GTMaterials.Copper.getFluid(), 144 / 8))
.id(`tfc:heating/copper_credit`)
event.custom({
type: 'vintageimprovements:curving',
ingredients: [{ tag: 'forge:ingots/copper' }],
itemAsHead: 'gtceu:credit_casting_mold',
results: [{ item: 'gtceu:copper_credit', count: 8 }],
processingTime: 50
}).id(`tfg:vi/curving/copper_credit`)
event.recipes.gtceu.extractor('gtceu:copper_credit')
.itemInputs('gtceu:copper_credit')
.outputFluids(Fluid.of(GTMaterials.Copper.getFluid(), 144 / 8))
.category(GTRecipeCategories.EXTRACTOR_RECYCLING)
.duration(10)
.EUt(2)
//#endregion
//#region GT Facades
event.shapeless(Item.of('gtceu:facade_cover', 8, '{Facade: {Count:1b,id:"minecraft:stone"}}'), ['3x #forge:plates/iron', "#tfg:whitelisted/facades"])
.modifyResult((craftingGrid, result) => {
let blockID = craftingGrid.find(Ingredient.of("#tfg:whitelisted/facades")).id
let facadeNBT = "{Facade: {Count:1b,id:" + "'" + blockID + "'" + "}}"
let facadeNBT = `{Facade: {Count:1b,id:` + `'${ blockID }'` + `}}`
result.nbt = facadeNBT
return result;
}).id('gtceu:facade_cover');
@ -1181,7 +1145,7 @@ const registerGTCEURecipes = (event) => {
.modifyResult((craftingGrid, result) => {
let blockID = craftingGrid.find(Ingredient.of("#tfg:whitelisted/facades")).id
let facadeNBT = "{Facade: {Count:1b,id:" + "'" + blockID + "'" + "}}"
let facadeNBT = `{Facade: {Count:1b,id:` + `'${ blockID }'` + `}}`
result.nbt = facadeNBT
return result;
}).id('gtceu:facade_cover32');

View file

@ -1,6 +1,9 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
*/
function registerGTCEuMachineRecipes(event) {
//#region Выход: Filter Casing

View file

@ -1,22 +1,32 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
*/
function registerGTCEUMetalRecipes(event) {
const makeToolRecipe = (toolType, headTagPrefix, extruderMold, cirucitMeta, material) => {
/**
* @param {GTToolType} toolType
* @param {TagPrefix} headTagPrefix
* @param {Internal.ItemStack} extruderMold
* @param {number} circuitMeta
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
* @returns
*/
function makeToolRecipe(toolType, headTagPrefix, extruderMold, circuitMeta, material) {
const toolItem = ToolHelper.get(toolType, material)
if (toolItem.isEmpty())
return
if (toolItem.isEmpty()) return
const toolHeadItem = ChemicalHelper.get(headTagPrefix, material, 1)
if (toolHeadItem.isEmpty())
return
if (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;
if (material === GTMaterials.Iron) return;
if (toolType == GTToolType.WRENCH) {
if (toolType === GTToolType.WRENCH) {
event.recipes.tfc.advanced_shaped_crafting(
TFC.itemStackProvider.of(toolItem).copyForgingBonus().copyHeat(), [
'ABC',
@ -28,8 +38,7 @@ function registerGTCEUMetalRecipes(event) {
D: `#forge:bolts/${material.getName()}`
}, 0, 0)
.id(`gtceu:shaped/${toolType.name}_${material.getName()}`)
}
else if (toolType == GTToolType.WIRE_CUTTER) {
} else if (toolType === GTToolType.WIRE_CUTTER) {
event.recipes.tfc.advanced_shaped_crafting(
TFC.itemStackProvider.of(toolItem).copyForgingBonus().copyHeat(), [
' AD',
@ -41,18 +50,24 @@ function registerGTCEUMetalRecipes(event) {
D: '#forge:tools/screwdrivers'
}, 0, 1)
.id(`gtceu:shaped/${toolType.name}_${material.getName()}`)
}
else {
} else {
event.recipes.tfc.advanced_shapeless_crafting(
TFC.itemStackProvider.of(toolItem).copyForgingBonus().copyHeat(),
[toolHeadItem, '#forge:rods/wooden'], toolHeadItem)
.id(`gtceu:shaped/${toolType.name}_${material.getName()}`)
}
processToolHead(headTagPrefix, extruderMold, cirucitMeta, material)
processToolHead(headTagPrefix, extruderMold, circuitMeta, material)
}
const processToolHead = (headTagPrefix, extruderMold, cirucitMeta, material) => {
/**
* @param {TagPrefix} headTagPrefix
* @param {Internal.ItemStack} extruderMold
* @param {number} circuitMeta
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processToolHead(headTagPrefix, extruderMold, circuitMeta, material) {
const toolHeadItem = ChemicalHelper.get(headTagPrefix, material, 1)
if (toolHeadItem.isEmpty())
return
@ -61,10 +76,10 @@ function registerGTCEUMetalRecipes(event) {
if (material.hasProperty(PropertyKey.INGOT)) {
const ingotItem = ChemicalHelper.get(TagPrefix.ingot, material, 1)
if (ingotItem.isEmpty() || ingotItem.hasTag('c:hidden_from_recipe_viewers'))
if (ingotItem.isEmpty() || ingotItem.hasTag('c:hidden_from_recipe_viewers'))
return
const materialAmount = Math.floor(headTagPrefix.materialAmount() / GTValues.M) == 1 ? 1 : 2;
const materialAmount = Math.floor(headTagPrefix.materialAmount() / GTValues.M) === 1 ? 1 : 2;
event.recipes.gtceu.extruder(`tfg:extrude_${material.getName()}_ingot_to_${new String(headTagPrefix.name).toLowerCase()}_head`)
.itemInputs(ingotItem.copyWithCount(materialAmount))
@ -74,7 +89,7 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.LV])
let ingotArray = [];
for (var i = 0; i < materialAmount; i++)
for (let i = 0; i < materialAmount; i++)
ingotArray.push(ingotItem)
event.custom({
@ -99,7 +114,7 @@ function registerGTCEUMetalRecipes(event) {
.category(GTRecipeCategories.ARC_FURNACE_RECYCLING)
.EUt(GTValues.VA[GTValues.LV])
if (GTMaterials.Stone != material) {
if (GTMaterials.Stone !== material) {
event.recipes.gtceu.extractor(`tfg:extract_${material.getName()}_${new String(headTagPrefix.name).toLowerCase()}_head`)
.itemInputs(toolHeadItem)
.outputFluids(Fluid.of(material.getFluid(), materialAmount * 144))
@ -117,7 +132,7 @@ function registerGTCEUMetalRecipes(event) {
event.recipes.gtceu.laser_engraver(`tfg:engrave_${material.getName()}_gem_to_${new String(headTagPrefix.name).toLowerCase()}_head`)
.itemInputs(gemItem.copyWithCount(Math.floor(headTagPrefix.materialAmount() / GTValues.M)))
.notConsumable(ChemicalHelper.get(TagPrefix.lens, GTMaterials.Glass, 1))
.circuit(cirucitMeta)
.circuit(circuitMeta)
.itemOutputs(toolHeadItem)
.duration(material.getMass() * 6)
.EUt(GTValues.VA[GTValues.LV])
@ -132,7 +147,11 @@ function registerGTCEUMetalRecipes(event) {
// else: ignore :3
}
const processToolMortar = (toolType, material) => {
/**
* @param {GTToolType} toolType
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processToolMortar(toolType, material) {
const toolItem = ToolHelper.get(toolType, material)
if (toolItem.isEmpty())
return
@ -155,14 +174,16 @@ function registerGTCEUMetalRecipes(event) {
).id(`gtceu:shaped/mortar_${material.getName()}`)
}
const processIngot = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processIngot(material) {
const ingotStack = ChemicalHelper.get(TagPrefix.ingot, material, 1)
if (material.hasFlag(MaterialFlags.GENERATE_PLATE)
&& material != GTMaterials.Wood
&& material != GTMaterials.TreatedWood
&& !material.hasProperty(PropertyKey.POLYMER))
{
&& material !== GTMaterials.Wood
&& material !== GTMaterials.TreatedWood
&& !material.hasProperty(PropertyKey.POLYMER)) {
const plateStack = ChemicalHelper.get(TagPrefix.plate, material, 1)
const blockStack = ChemicalHelper.get(TagPrefix.block, material, 1)
@ -177,9 +198,9 @@ function registerGTCEUMetalRecipes(event) {
//processingTime: material.getMass() // TODO - controlled by a global config argh
}).id(`tfg:rolling/${material.getName()}_plate`)
if (!blockStack.isEmpty() && GTMaterials.Stone != material) {
if (!blockStack.isEmpty() && GTMaterials.Stone !== material) {
let ingotArray = [];
for (var i = 0; i < matAmount; i++)
for (let i = 0; i < matAmount; i++)
ingotArray.push(ingotStack)
// 9х Слиток -> Блок
@ -189,8 +210,7 @@ function registerGTCEUMetalRecipes(event) {
.heated()
.id(`greate:compacting/${material.getName()}_block`)
}
}
else {
} else {
if (!blockStack.isEmpty() && !blockStack.hasTag('c:hidden_from_recipe_viewers')) {
// Блок из гемов -> 9 Пластин
event.recipes.greate.cutting(plateStack.withCount(matAmount), blockStack)
@ -201,23 +221,27 @@ function registerGTCEUMetalRecipes(event) {
}
}
const processPlate = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPlate(material) {
const item = ChemicalHelper.get(TagPrefix.plate, material, 1)
if (item.isEmpty())
return
if (item.isEmpty()) return
event.remove({ id: `gtceu:shaped/plate_${material.getName()}` })
}
const processPlateDouble = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processPlateDouble(material) {
const doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1)
if (doublePlateItem.isEmpty() || doublePlateItem.hasTag('c:hidden_from_recipe_viewers'))
return
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 == GTMaterials.CobaltBrass) {
if (material === GTMaterials.CobaltBrass) {
event.recipes.greate.compacting(doublePlateItem, [plateItem, plateItem, 'tfc:powder/flux'])
.heated()
.recipeTier(1)
@ -229,8 +253,7 @@ function registerGTCEUMetalRecipes(event) {
.circuit(2)
.duration(20 * 5.8)
.EUt(24)
}
else if (material.getProperty(TFGPropertyKey.TFC_PROPERTY) == null) {
} else if (material.getProperty(TFGPropertyKey.TFC_PROPERTY) === null) {
event.recipes.greate.compacting(doublePlateItem, [plateItem, plateItem, 'tfc:powder/flux'])
.heated()
.recipeTier(2)
@ -238,7 +261,10 @@ function registerGTCEUMetalRecipes(event) {
}
}
const processBlock = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processBlock(material) {
const item = ChemicalHelper.get(TagPrefix.block, material, 1)
if (item.isEmpty())
return
@ -246,11 +272,14 @@ function registerGTCEUMetalRecipes(event) {
event.remove({ id: `gtceu:compressor/compress_${material.getName()}_to_block` })
}
const processFoil = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processFoil(material) {
const foilItem = ChemicalHelper.get(TagPrefix.foil, material, 4)
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1)
if (plateItem != null && foilItem != null && !plateItem.hasTag('c:hidden_from_recipe_viewers')) {
if (plateItem !== null && foilItem !== null && !plateItem.hasTag('c:hidden_from_recipe_viewers')) {
event.custom({
type: "createaddition:rolling",
input: plateItem,
@ -261,9 +290,12 @@ function registerGTCEUMetalRecipes(event) {
}
}
const processRodLong = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processRodLong(material) {
const longRodItem = ChemicalHelper.get(TagPrefix.rodLong, material, 1)
if (longRodItem.isEmpty() || longRodItem.hasTag('c:hidden_from_recipe_viewers'))
if (longRodItem.isEmpty() || longRodItem.hasTag('c:hidden_from_recipe_viewers'))
return
const shortRodItem = ChemicalHelper.get(TagPrefix.rod, material, 1)
if (shortRodItem.isEmpty() || shortRodItem.hasTag('c:hidden_from_recipe_viewers'))
@ -272,7 +304,7 @@ function registerGTCEUMetalRecipes(event) {
event.remove({ id: `gtceu:shaped/stick_long_stick_${material.getName()}` })
// Rod welding recipes for all of the other non-tfc materials, since those were handled in tfc/recipes.materials.js
if (material.getProperty(TFGPropertyKey.TFC_PROPERTY) == null) {
if (material.getProperty(TFGPropertyKey.TFC_PROPERTY) === null) {
event.recipes.greate.compacting(longRodItem, [shortRodItem, shortRodItem, 'tfc:powder/flux'])
.heated()
.recipeTier(1)
@ -280,7 +312,10 @@ function registerGTCEUMetalRecipes(event) {
}
}
const processIngotDouble = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processIngotDouble(material) {
if (!material.hasFlag(TFGMaterialFlags.GENERATE_DOUBLE_INGOTS))
return;
@ -321,7 +356,10 @@ function registerGTCEUMetalRecipes(event) {
.circuit(3)
}
const processSmallOre = (material) => {
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
function processSmallOre(material) {
if (!material.hasFlag(TFGMaterialFlags.HAS_SMALL_TFC_ORE)) return;
const smallOre = ChemicalHelper.get(TFGTagPrefix.oreSmall, material, 1);
@ -335,6 +373,9 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processSmallNativeOre = (material) => {
if (!material.hasFlag(TFGMaterialFlags.HAS_SMALL_NATIVE_TFC_ORE)) return;
@ -349,24 +390,23 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processPoorRawOre = (material) => {
const poorOreItem = ChemicalHelper.get(TFGTagPrefix.poorRawOre, material, 1)
const crushedOreItem = ChemicalHelper.get(TagPrefix.crushed, material, 1)
if (poorOreItem == null || crushedOreItem == null)
return;
if (poorOreItem === null || crushedOreItem === null) return;
const oreProperty = material.getProperty(PropertyKey.ORE)
const smeltingMaterial = oreProperty.getDirectSmeltResult() == null ? material : oreProperty.getDirectSmeltResult();
const smeltingMaterial = oreProperty.getDirectSmeltResult() === null ? material : oreProperty.getDirectSmeltResult();
const multiplier = oreProperty.getOreMultiplier();
let ingotItem = null;
if (smeltingMaterial.hasProperty(PropertyKey.INGOT))
ingotItem = ChemicalHelper.get(TagPrefix.nugget, smeltingMaterial, 5)
else if (smeltingMaterial.hasProperty(PropertyKey.GEM))
ingotItem = ChemicalHelper.get(TagPrefix.gemFlawed, smeltingMaterial, 1)
else
ingotItem = ChemicalHelper.get(TagPrefix.dustSmall, smeltingMaterial, 1)
let ingotItem;
if (smeltingMaterial.hasProperty(PropertyKey.INGOT)) ingotItem = ChemicalHelper.get(TagPrefix.nugget, smeltingMaterial, 5)
else if (smeltingMaterial.hasProperty(PropertyKey.GEM)) ingotItem = ChemicalHelper.get(TagPrefix.gemFlawed, smeltingMaterial, 1)
else ingotItem = ChemicalHelper.get(TagPrefix.dustSmall, smeltingMaterial, 1)
ingotItem.setCount(ingotItem.getCount() * multiplier)
crushedOreItem.setCount(crushedOreItem.getCount() * multiplier)
@ -382,18 +422,17 @@ function registerGTCEUMetalRecipes(event) {
const gemItem = ChemicalHelper.get(TagPrefix.gem, material, crushedOreItem.getCount());
hammerRecipe.chancedOutput(gemItem, 7500, 950)
event.recipes.greate.pressing(TieredOutputItem.of(gemItem).withChance(0.75).withExtraTierChance(0.095), poorOreItem)
event.recipes.greate.pressing(Item.of(gemItem).withChance(0.75), poorOreItem)
.recipeTier(1)
.id(`greate:pressing/poor_raw_${material.getName()}_to_gem`)
let polishingCount = Math.max(crushedOreItem.getCount() / 2, 1);
event.recipes.create.sandpaper_polishing(gemItem.copyWithCount(polishingCount), poorOreItem)
.id(`tfg:polishing/poor_raw_${material.getName()}_to_gem`)
}
else {
} else {
hammerRecipe.chancedOutput(crushedOreItem, 7500, 950)
event.recipes.greate.pressing(TieredOutputItem.of(crushedOreItem).withChance(0.75).withExtraTierChance(0.095), poorOreItem)
event.recipes.greate.pressing(Item.of(crushedOreItem).withChance(0.75), poorOreItem)
.recipeTier(1)
.id(`greate:pressing/poor_raw_${material.getName()}_to_crushed_ore`)
}
@ -407,8 +446,7 @@ function registerGTCEUMetalRecipes(event) {
if (multiplier > 1) {
maceratorRecipe.itemOutputs(crushedOreItem.copyWithCount(multiplier / 2))
}
else {
} else {
maceratorRecipe.chancedOutput(crushedOreItem, 5000, 750)
}
maceratorRecipe.chancedOutput(crushedOreItem.copyWithCount(1), 2500, 500)
@ -420,8 +458,7 @@ function registerGTCEUMetalRecipes(event) {
crushedOreItem.copyWithCount(multiplier / 2),
poorOreItem
).id(`tfg:quern/${material.getName()}_crushed_ore_from_poor_raw_ore`)
}
else {
} else {
event.recipes.tfc.quern(
ChemicalHelper.get(TagPrefix.dustSmall, material, 2),
poorOreItem
@ -429,23 +466,26 @@ function registerGTCEUMetalRecipes(event) {
}
// Smelting
if (!material.hasProperty(PropertyKey.BLAST)) {
if (!material.hasProperty(PropertyKey.BLAST) && !ingotItem.isEmpty()) {
event.smelting(ingotItem, poorOreItem).id(`gtceu:smelting/smelt_poor_raw_${material.getName()}_ore_to_ingot`)
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processNormalRawOre = (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)
if (normalOreItem === null || crushedOreItem === null)
return;
const smeltingMaterial = oreProperty.getDirectSmeltResult() == null ? material : oreProperty.getDirectSmeltResult();
const smeltingMaterial = oreProperty.getDirectSmeltResult() === null ? material : oreProperty.getDirectSmeltResult();
let ingotItem = null;
let ingotItem;
if (smeltingMaterial.hasProperty(PropertyKey.INGOT))
ingotItem = ChemicalHelper.get(TagPrefix.ingot, smeltingMaterial, multiplier)
else if (smeltingMaterial.hasProperty(PropertyKey.GEM))
@ -470,8 +510,7 @@ function registerGTCEUMetalRecipes(event) {
event.recipes.create.sandpaper_polishing(gemItem, normalOreItem)
.id(`tfg:polishing/raw_${material.getName()}_to_gem`)
}
else {
} else {
hammerRecipe.itemOutputs(crushedOreItem)
event.recipes.greate.pressing(crushedOreItem, normalOreItem)
@ -497,7 +536,7 @@ function registerGTCEUMetalRecipes(event) {
.id(`tfg:quern/${material.getName()}_crushed_ore_from_normal_raw_ore`)
// Smelting
if (!material.hasProperty(PropertyKey.BLAST)) {
if (!material.hasProperty(PropertyKey.BLAST) && !ingotItem.isEmpty()) {
event.smelting(ingotItem, normalOreItem).id(`gtceu:smelting/smelt_raw_${material.getName()}_ore_to_ingot`)
}
@ -506,18 +545,21 @@ function registerGTCEUMetalRecipes(event) {
event.remove({ id: `gtceu:forge_hammer/decompress_${material.getName()}_to_raw_ore` })
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processRichRawOre = (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)
if (richOreItem === null || crushedOreItem === null)
return;
const smeltingMaterial = oreProperty.getDirectSmeltResult() == null ? material : oreProperty.getDirectSmeltResult();
const smeltingMaterial = oreProperty.getDirectSmeltResult() === null ? material : oreProperty.getDirectSmeltResult();
let ingotItem = null;
let ingotItem;
if (smeltingMaterial.hasProperty(PropertyKey.INGOT))
ingotItem = ChemicalHelper.get(TagPrefix.ingot, smeltingMaterial, multiplier)
else if (smeltingMaterial.hasProperty(PropertyKey.GEM))
@ -542,8 +584,7 @@ function registerGTCEUMetalRecipes(event) {
event.recipes.create.sandpaper_polishing(gemItem, richOreItem)
.id(`tfg:polishing/rich_raw_${material.getName()}_to_gem`)
}
else {
} else {
hammerRecipe.itemOutputs(crushedOreItem)
event.recipes.greate.pressing(crushedOreItem, richOreItem)
@ -567,23 +608,26 @@ function registerGTCEUMetalRecipes(event) {
.id(`tfg:quern/${material.getName()}_crushed_ore_from_rich_raw_ore`)
// Smelting
if (!material.hasProperty(PropertyKey.BLAST)) {
if (!material.hasProperty(PropertyKey.BLAST) && !ingotItem.isEmpty()) {
event.smelting(ingotItem, richOreItem).id(`gtceu:smelting/smelt_rich_raw_${material.getName()}_ore_to_ingot`)
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processCrushedOre = (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)
if (crushedOreItem != null && pureOreItem != null) {
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, TieredOutputItem.of(byproductItem).withChance(0.333), 'gtceu:stone_dust'], crushedOreItem)
event.recipes.greate.splashing([pureOreItem, Item.of(byproductItem).withChance(0.333), 'gtceu:stone_dust'], crushedOreItem)
.id(`tfg:splashing/${material.getName()}_purified_ore`)
// Dropping in water
@ -600,40 +644,49 @@ function registerGTCEUMetalRecipes(event) {
}).id(`tfg:ae_transform/${material.getName()}_purified_ore`)
}
if (crushedOreItem != null && impureDustItem != null) {
if (crushedOreItem !== null && impureDustItem !== null) {
event.recipes.greate.pressing(impureDustItem, crushedOreItem)
.recipeTier(1)
.id(`greate:pressing/crushed_${material.getName()}_to_impure_dust`)
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processPurifiedOre = (material) => {
const pureOreItem = ChemicalHelper.get(TagPrefix.crushedPurified, material, 1)
const pureDustItem = ChemicalHelper.get(TagPrefix.dustPure, material, 1)
if (pureOreItem != null && pureDustItem != null) {
if (pureOreItem !== null && pureDustItem !== null) {
event.recipes.greate.pressing(pureDustItem, pureOreItem)
.recipeTier(1)
.id(`greate:pressing/pure_crushed_${material.getName()}_to_pure_dust`)
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processRefinedOre = (material) => {
const refinedOreItem = ChemicalHelper.get(TagPrefix.crushedRefined, material, 1)
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1)
if (refinedOreItem != null && dustItem != null) {
if (refinedOreItem !== null && dustItem !== null) {
event.recipes.greate.pressing(dustItem, refinedOreItem)
.recipeTier(1)
.id(`greate:pressing/refined_${material.getName()}_to_dust`)
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processImpureDust = (material) => {
const impureDustItem = ChemicalHelper.get(TagPrefix.dustImpure, material, 1)
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1)
if (impureDustItem != null && dustItem != null) {
if (impureDustItem !== null && dustItem !== null) {
// Bulk washing
event.recipes.greate.splashing(dustItem, impureDustItem)
@ -666,11 +719,14 @@ function registerGTCEUMetalRecipes(event) {
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processPureDust = (material) => {
const pureDust = ChemicalHelper.get(TagPrefix.dustPure, material, 1)
const dustItem = ChemicalHelper.get(TagPrefix.dust, material, 1)
if (pureDust != null && dustItem != null) {
if (pureDust !== null && dustItem !== null) {
// Bulk washing
event.recipes.greate.splashing(dustItem, pureDust)
@ -703,6 +759,9 @@ function registerGTCEUMetalRecipes(event) {
}
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processGems = (material) => {
let gem = ChemicalHelper.get(TagPrefix.gem, material, 1);
if (gem.hasTag('c:hidden_from_recipe_viewers'))
@ -721,7 +780,7 @@ function registerGTCEUMetalRecipes(event) {
.id(`shapeless/mortar_chipped_${material.getName()}`)
let amount = 9;
if (material == GTMaterials.NetherQuartz || material == GTMaterials.Amethyst)
if (material === GTMaterials.NetherQuartz || material === GTMaterials.Amethyst)
amount = 4;
event.recipes.greate.pressing(ChemicalHelper.get(TagPrefix.gem, material, amount), ChemicalHelper.get(TagPrefix.block, material, 1))
@ -729,10 +788,12 @@ function registerGTCEUMetalRecipes(event) {
.id(`greate:pressing/unpacking_${material.getName()}_block`)
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processAnvil = (material) => {
const anvilStack = ChemicalHelper.get(TFGTagPrefix.anvil, material, 1)
if (anvilStack == null)
return;
if (anvilStack === null) return;
event.recipes.gtceu.macerator(`tfg:macerate_${material.getName()}_anvil`)
.itemInputs(anvilStack)
@ -771,10 +832,12 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processLamp = (material) => {
const finishedLampStack = ChemicalHelper.get(TFGTagPrefix.lamp, material, 1)
if (finishedLampStack == null)
return;
if (finishedLampStack === null) return;
const materialDustStack = ChemicalHelper.get(TagPrefix.dust, material, 1)
const materialIngotStack = ChemicalHelper.get(TagPrefix.ingot, material, 1)
@ -847,10 +910,12 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processTrapdoor = (material) => {
const trapdoorStack = ChemicalHelper.get(TFGTagPrefix.trapdoor, material, 1)
if (trapdoorStack == null)
return;
if (trapdoorStack === null) return;
const materialDustStack = ChemicalHelper.get(TagPrefix.dust, material, 1)
const materialIngotStack = ChemicalHelper.get(TagPrefix.ingot, material, 1)
@ -892,10 +957,12 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processChain = (material) => {
const chainStack = ChemicalHelper.get(TFGTagPrefix.chain, material, 1)
if (chainStack == null)
return;
if (chainStack === null) return;
const chain2Stack = ChemicalHelper.get(TFGTagPrefix.chain, material, 2)
@ -940,10 +1007,12 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processBell = (material) => {
const bellStack = ChemicalHelper.get(TFGTagPrefix.bell, material, 1)
if (bellStack == null)
return;
if (bellStack === null) return;
const materialDustStack = ChemicalHelper.get(TagPrefix.dust, material, 1)
const materialIngotStack = ChemicalHelper.get(TagPrefix.ingot, material, 1)
@ -985,11 +1054,13 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.ULV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processBars = (material) => {
const barsStack = ChemicalHelper.get(TFGTagPrefix.bars, material, 4)
const ingotStack = ChemicalHelper.get(TagPrefix.ingot, material, 1)
if (barsStack == null)
return;
if (barsStack === null) return;
event.recipes.gtceu.cutter(`tfg:${material.getName()}_bars`)
.itemInputs(ingotStack)
@ -998,13 +1069,15 @@ function registerGTCEUMetalRecipes(event) {
.EUt(GTValues.VA[GTValues.LV])
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const processBuzzsawBlade = (material) => {
const buzzsawBladeItem = ChemicalHelper.get(TagPrefix.toolHeadBuzzSaw, material, 1)
const doublePlateItem = ChemicalHelper.get(TagPrefix.plateDouble, material, 1)
if (buzzsawBladeItem == null || doublePlateItem == null)
return;
if (buzzsawBladeItem === null || doublePlateItem === null) return;
var isLowTier = material == GTMaterials.CobaltBrass || material.hasProperty(TFGPropertyKey.TFC_PROPERTY)
let isLowTier = material === GTMaterials.CobaltBrass || material.hasProperty(TFGPropertyKey.TFC_PROPERTY)
event.recipes.gtceu.lathe(`buzzsaw_gear_${material.getName()}`)
.itemInputs(doublePlateItem)
@ -1024,6 +1097,9 @@ function registerGTCEUMetalRecipes(event) {
event.remove({ id: `gtceu:shaped/buzzsaw_blade_${material.getName()}` })
}
/**
* @param {com.gregtechceu.gtceu.api.data.chemical.material.Material_} material
*/
const removePowerToolRecycling = (material) => {
removeMaceratorRecipe(event, `macerate_lv_${material.getName()}_wrench`)
event.remove({ id: `gtceu:arc_furnace/arc_lv_${material.getName()}_wrench` })
@ -1059,8 +1135,7 @@ function registerGTCEUMetalRecipes(event) {
const toolProperty = material.getProperty(PropertyKey.TOOL)
const ingotProperty = material.getProperty(PropertyKey.INGOT)
const oreProperty = material.getProperty(PropertyKey.ORE)
if (toolProperty != null) {
if (toolProperty !== null) {
let circuit = 1;
makeToolRecipe(GTToolType.SWORD, TFGTagPrefix.toolHeadSword, 'tfg:sword_head_extruder_mold', circuit++, material)
makeToolRecipe(GTToolType.PICKAXE, TFGTagPrefix.toolHeadPickaxe, 'tfg:pickaxe_head_extruder_mold', circuit++, material)
@ -1086,12 +1161,12 @@ function registerGTCEUMetalRecipes(event) {
processToolHead(TFGTagPrefix.toolHeadChisel, 'tfg:chisel_head_extruder_mold', circuit++, material)
processToolHead(TFGTagPrefix.toolHeadMace, 'tfg:mace_head_extruder_mold', circuit++, material)
processToolHead(TFGTagPrefix.toolHeadMattock, 'tfg:mattock_head_extruder_mold', circuit++, material)
processToolHead(TFGTagPrefix.toolHeadHook, 'tfg:fish_hook_extruder_mold', circuit++, material)
processToolHead(TFGTagPrefix.toolHeadHook, 'tfg:fish_hook_extruder_mold', circuit, material)
removePowerToolRecycling(material)
}
if (ingotProperty != null) {
if (ingotProperty !== null) {
processIngot(material)
processPlate(material)
processPlateDouble(material)
@ -1112,7 +1187,7 @@ function registerGTCEUMetalRecipes(event) {
event.remove({ id: `gtceu:shaped/spring_small_${material.getName()}` })
}
if (oreProperty != null) {
if (oreProperty !== null) {
processSmallOre(material)
processSmallNativeOre(material)
processPoorRawOre(material)

View file

@ -1,6 +1,9 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
*/
function registerGTCEURecyclingRecipes(event) {
// Tantalum Capacitor

View file

@ -1,6 +1,9 @@
// priority: 0
"use strict";
/**
* @param {Internal.RecipesEventJS} event
*/
function removeGTCEURecipes(event) {
event.replaceInput({ input: 'gtceu:wood_drum' }, 'gtceu:wood_drum', 'minecraft:glass')

View file

@ -1,8 +1,10 @@
// priority: 0
"use strict";
function registerGTCEuTFCMetalsRecipes(event)
{
/**
* @param {Internal.RecipesEventJS} event
*/
function registerGTCEuTFCMetalsRecipes(event) {
//#region LV hull
event.replaceInput('gtceu:shaped/lv_machine_hull', '#forge:plates/wrought_iron', '#forge:plates/red_steel')

View file

@ -60,8 +60,7 @@ const registerGTCEUItemTags = (event) => {
event.add('tfg:sugars', 'afc:birch_sugar')
event.add('tfg:sugars', 'afc:maple_sugar')
global.MINECRAFT_DYE_NAMES.forEach(dyeName =>
{
global.MINECRAFT_DYE_NAMES.forEach(dyeName => {
event.remove('ae2:p2p_attunements/fluid_p2p_tunnel', `gtceu:${dyeName}_dye_bucket`)
})

View file

@ -29,7 +29,7 @@ const generateMixerRecipe = (event, input, fluid_input, output, circuit, fluid_o
/**
* Applies if circuit param is not empty
*/
if (circuit != null) {
if (circuit !== null) {
recipe.circuit(circuit)
}
}
@ -47,13 +47,13 @@ const generateMixerRecipe = (event, input, fluid_input, output, circuit, fluid_o
* @param {string} id -Recipe ID
*/
const generateCutterRecipe = (event, input, output, duration, EUt, id) => {
event.recipes.gtceu.cutter(`tfg:${id}`)
.itemInputs(input)
.itemOutputs(output)
.duration(duration)
.EUt(EUt)
}
//#endregion
//#region Green House
@ -67,12 +67,13 @@ const generateCutterRecipe = (event, input, output, duration, EUt, id) => {
* @param {string} id -Recipe ID
* @param {string} dimension -Dimension ID
* @param {number} fertiliser_count
* @param {string} output_seconday -Item (Optional, if there should be a third output)
* @param {string} tier - GTValues.VA[] (Optional, defaults to LV)
* @param {string|null} output_seconday -Item (Optional, if there should be a third output)
* @param {number} EUt
*/
const generateGreenHouseRecipe = (event, input, fluid_amount, output, id, dimension, fertiliser_count, output_secondary, tier) => {
// Без удобрения (Without fertilizer)
function generateGreenHouseRecipe(event, input, fluid_amount, output, id, dimension, fertiliser_count, output_secondary, EUt) {
if (EUt === undefined || output_secondary === undefined || fertiliser_count === undefined || dimension === undefined) {
throw new TypeError(`Call to generateGreenHouseRecipe for id ${id} is missing args`);
}
let r = event.recipes.gtceu.greenhouse(id)
.notConsumable(input)
.circuit(1)
@ -82,17 +83,11 @@ const generateGreenHouseRecipe = (event, input, fluid_amount, output, id, dimens
.chancedOutput(input, 500, 0)
.duration(36000) // 30 mins
if (dimension != null){
r.dimension(dimension)
}
if (output_secondary != null){
r.chancedOutput(output_secondary, 750, 0)
}
if (tier != null){
r.EUt(tier)
} else {
r.EUt(GTValues.VA[GTValues.LV])
}
if (dimension !== null)r.dimension(dimension)
if (output_secondary !== null) r.chancedOutput(output_secondary, 750, 0)
r.EUt(EUt)
// С удобрением (With fertilizer)
r = event.recipes.gtceu.greenhouse(`${id}_fertilized`)
@ -105,17 +100,9 @@ const generateGreenHouseRecipe = (event, input, fluid_amount, output, id, dimens
.chancedOutput(input, 3000, 0)
.duration(12000) // 10 mins
if (dimension != null){
r.dimension(dimension)
}
if (output_secondary != null){
r.chancedOutput(output_secondary, 4000, 0)
}
if (tier != null){
r.EUt(tier)
} else {
r.EUt(GTValues.VA[GTValues.LV])
}
if (dimension !== null) r.dimension(dimension)
if (output_secondary !== null) r.chancedOutput(output_secondary, 4000, 0)
r.EUt(EUt)
}
//#endregion
@ -142,12 +129,12 @@ const getFillingNBT = (material, amount) => {
* Function for generating plated block recipes.
*
* @param {*} event
* @param {GTMaterials} material
* @param {GTMaterial} material
*/
function generatePlatedBlockRecipe(event, material) {
// firmaciv plated blocks don't have this property
let tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
let outputMaterial = (tfcProperty == null || tfcProperty.getOutputMaterial() == null) ? material : tfcProperty.getOutputMaterial()
let outputMaterial = (tfcProperty === null || tfcProperty.getOutputMaterial() === null) ? material : tfcProperty.getOutputMaterial()
let plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
@ -155,11 +142,11 @@ function generatePlatedBlockRecipe(event, material) {
let platedSlab = ChemicalHelper.get(TFGTagPrefix.slabPlated, material, 1);
let platedStair = ChemicalHelper.get(TFGTagPrefix.stairPlated, material, 1);
if (platedBlock == null)
if (platedBlock === null)
return
let tfcMetalName = material.getName();
if (tfcMetalName == "iron")
if (tfcMetalName === "iron")
tfcMetalName = "cast_iron";
event.recipes.create.item_application(platedBlock, ['#forge:stone_bricks', plateItem])
@ -173,7 +160,7 @@ function generatePlatedBlockRecipe(event, material) {
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
if (tfcProperty != null) {
if (tfcProperty !== null) {
event.recipes.tfc.heating(platedBlock, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), 144))
.id(`tfc:heating/metal/${tfcMetalName}_block`)
@ -203,7 +190,7 @@ function generatePlatedBlockRecipe(event, material) {
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
if (tfcProperty != null) {
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))
@ -234,7 +221,7 @@ function generatePlatedBlockRecipe(event, material) {
.duration(50)
.EUt(GTValues.VA[GTValues.ULV])
if (tfcProperty != null) {
if (tfcProperty !== null) {
event.recipes.tfc.heating(platedStair, tfcProperty.getMeltTemp())
.resultFluid(Fluid.of(outputMaterial.getFluid(), 144))
.id(`tfc:heating/metal/${tfcMetalName}_block_stairs`)
@ -259,10 +246,10 @@ function generatePlatedBlockRecipe(event, material) {
* Function for iterating through registered materials
* {@link https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java}
*
* @param {GTCEuAPI.materialManager.getRegisteredMaterials} iterator -Material
* @param {(material: com.gregtechceu.gtceu.api.data.chemical.material.Material_) => void} iterator
*/
function forEachMaterial(iterator) {
for (var material of GTCEuAPI.materialManager.getRegisteredMaterials()) {
for (let material of GTCEuAPI.materialManager.getRegisteredMaterials()) {
iterator(material)
}
}