bioline materials (#2191)

* materials

* lang

* materials

* utility linting

* data and linting

* lang
This commit is contained in:
Redeix 2025-11-08 03:40:26 -06:00 committed by GitHub
parent 324847ccde
commit 7ee6ff2c04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 346 additions and 59 deletions

View file

@ -85,10 +85,12 @@ function generateGreenHouseRecipe(event, input, fluid, fluid_amount, output, id,
.duration(36000) // 30 mins
.EUt(EUt)
if (dimension !== null)
if (dimension !== null) {
r.dimension(dimension)
if (output_secondary !== null)
}
if (output_secondary !== null) {
r.chancedOutput(output_secondary, 750, 0)
}
// С удобрением (With fertilizer)
@ -103,10 +105,12 @@ function generateGreenHouseRecipe(event, input, fluid, fluid_amount, output, id,
.duration(12000) // 10 mins
.EUt(EUt)
if (dimension !== null)
if (dimension !== null) {
r.dimension(dimension)
if (output_secondary !== null)
}
if (output_secondary !== null) {
r.chancedOutput(output_secondary, 4000, 0)
}
}
//#endregion
@ -137,21 +141,21 @@ const getFillingNBT = (material, amount) => {
*/
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()
const tfcProperty = material.getProperty(TFGPropertyKey.TFC_PROPERTY)
const outputMaterial = (tfcProperty === null || tfcProperty.getOutputMaterial() === null) ? material : tfcProperty.getOutputMaterial()
let plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
const plateItem = ChemicalHelper.get(TagPrefix.plate, material, 1);
let platedBlock = ChemicalHelper.get(TFGTagPrefix.blockPlated, material, 1);
let platedSlab = ChemicalHelper.get(TFGTagPrefix.slabPlated, material, 1);
let platedStair = ChemicalHelper.get(TFGTagPrefix.stairPlated, 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
if (platedBlock === null) return;
let tfcMetalName = material.getName();
if (tfcMetalName === "iron")
if (tfcMetalName === "iron") {
tfcMetalName = "cast_iron";
}
event.shapeless(platedBlock, ['#forge:stone_bricks', plateItem, '#forge:tools/hammers'])
.id(`tfg:shapeless/${material.getName()}_plated_block`)
@ -247,7 +251,7 @@ function generatePlatedBlockRecipe(event, material) {
* @param {(material: com.gregtechceu.gtceu.api.data.chemical.material.Material_) => void} iterator
*/
function forEachMaterial(iterator) {
for (let material of GTCEuAPI.materialManager.getRegisteredMaterials()) {
for (const material of GTCEuAPI.materialManager.getRegisteredMaterials()) {
iterator(material)
}
}
@ -280,7 +284,7 @@ function addCircuitToRecipe(event, recipeId, circuitNumber) {
};
event.findRecipes({ id: recipeId }).forEach(recipe => {
let inputsEl = recipe.json.get("inputs");
const inputsEl = recipe.json.get("inputs");
let inputsObj;
if (inputsEl === null || inputsEl.isJsonNull()) {
inputsObj = new JsonObject();
@ -291,7 +295,7 @@ function addCircuitToRecipe(event, recipeId, circuitNumber) {
}
// Cache existing item inputs.
let itemEl = inputsObj.get("item");
const itemEl = inputsObj.get("item");
let itemArray;
if (itemEl === null || itemEl === undefined || itemEl.isJsonNull()) {
itemArray = new JsonArray();
@ -317,7 +321,7 @@ function addCircuitToRecipe(event, recipeId, circuitNumber) {
let hasCircuit = false;
for (let i = 0; i < itemArray.size(); i++) {
const el = itemArray.get(i);
if (!el.isJsonObject()) continue;
if (!el.isJsonObject()) {continue;}
const obj = el.getAsJsonObject();
const content = obj.get("content");
if (content && content.isJsonObject()) {
@ -383,7 +387,7 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
}
if (logs && lumber && name) {
event.shapeless(`8x ${lumber}`,
event.shapeless(`8x ${lumber}`,
[logs, '#forge:tools/saws']
).id(`tfg:shapeless/${name}_lumber_from_log`)
@ -391,7 +395,7 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
}
if (plank && lumber && name) {
event.shapeless(`4x ${lumber}`,
event.shapeless(`4x ${lumber}`,
[plank, '#forge:tools/saws']
).id(`tfg:shapeless/${name}_lumber_from_plank`)
@ -401,15 +405,15 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
'AA',
'AA'
], {
A: lumber,
A: lumber
}).id(`tfg:shaped/${name}_plank_from_lumber`)
}
if (slab && lumber && name) {
event.shapeless(`2x ${lumber}`,
event.shapeless(`2x ${lumber}`,
[slab, '#forge:tools/saws']
).id(`tfg:shapeless/${name}_lumber_from_slab`)
generateCutterRecipe(event, slab, `2x ${lumber}`, 50, 7, `cutter_${name}_lumber_from_slab`)
}
@ -417,12 +421,12 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
event.shaped(`6x ${slab}`, [
'AAA'
], {
A: plank,
A: plank
}).id(`tfg:shaped/${name}_slab_from_plank`)
}
if (stair && lumber && name) {
event.shapeless(`3x ${lumber}`,
event.shapeless(`3x ${lumber}`,
[stair, '#forge:tools/saws']
).id(`tfg:shapeless/${name}_lumber_from_stair`)
@ -435,51 +439,51 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
'AA ',
'AAA'
], {
A: plank,
A: plank
}).id(`tfg:shaped/${name}_stair_from_plank`)
}
if (door && lumber && name) {
event.shaped(`2x ${door}`, [
'AA',
'AA',
'AA'
], {
A: lumber,
A: lumber
}).id(`tfg:shaped/${name}_door_from_lumber`)
}
if (trapdoor && lumber && name) {
event.shaped(`3x ${trapdoor}`, [
'AAA',
'AAA'
], {
A: lumber,
A: lumber
}).id(`tfg:shaped/${name}_trapdoor_from_lumber_and_plank`)
}
if (fence && lumber && plank && name) {
event.shaped(`8x ${fence}`, [
'ABA',
'ABA'
], {
A: lumber,
B: plank,
B: plank
}).id(`tfg:shaped/${name}_fence_from_lumber_and_plank`)
}
if (fence_gate && lumber && plank && name) {
event.shaped(`2x ${fence_gate}`, [
'ABA',
'ABA'
], {
A: plank,
B: lumber,
B: lumber
}).id(`tfg:shaped/${name}_fence_gate_from_lumber_and_plank`)
}
if (support && logs && name) {
event.shapeless(`8x ${support}`,
event.shapeless(`8x ${support}`,
[`2x ${logs}`, '#forge:tools/saws']
).id(`tfg:shapeless/${name}_support_from_logs`)
@ -490,7 +494,7 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
.circuit(4)
.EUt(GTValues.VA[GTValues.ULV])
}
if (pressure_plate && slab && name) {
event.shaped(pressure_plate, [
' B ',
@ -500,7 +504,7 @@ function woodBuilder(event, name, lumber, logs, log, stripped_log, plank, stair,
A: slab,
B: '#forge:tools/hammers',
C: '#forge:springs',
D: '#forge:tools/screwdrivers',
D: '#forge:tools/screwdrivers'
}).id(`tfg:shaped/${name}_pressure_plate`)
event.recipes.gtceu.assembler(`tfg:assembler/${name}_pressure_plate`)
@ -546,30 +550,39 @@ function sterilizeItem(event, input, output, multiplier, cleanroom) {
// If there are any errors, log them all and throw once.
if (errors.length > 0) {
const message = "sterilizeItem errors:\n - " + errors.join("\n - ");
const message = `sterilizeItem errors:\n - ${ errors.join("\n - ")}`;
throw new TypeError(message);
};
// Set default multiplier.
let recipe_multiplier = 1;
if (multiplier !== undefined) recipe_multiplier = multiplier;
if (multiplier !== undefined) {
recipe_multiplier = multiplier;
}
// Create recipes.
let ethanol_recipe = event.recipes.gtceu.chemical_bath(`tfg:ethanol_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
const ethanol_recipe = event.recipes.gtceu.chemical_bath(`tfg:ethanol_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
.itemInputs(input)
.inputFluids(Fluid.of('gtceu:ethanol', 500*recipe_multiplier))
.itemOutputs(output)
.duration(10*20*recipe_multiplier)
.EUt(GTValues.VA[GTValues.MV]);
let hydrogen_peroxide_recipe = event.recipes.gtceu.chemical_bath(`tfg:hydrogen_peroxide_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
const hydrogen_peroxide_recipe = event.recipes.gtceu.chemical_bath(`tfg:hydrogen_peroxide_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
.itemInputs(input)
.inputFluids(Fluid.of('gtceu:hydrogen_peroxide', 200*recipe_multiplier))
.itemOutputs(output)
.duration(10*20*recipe_multiplier)
.EUt(GTValues.VA[GTValues.MV]);
let autoclave_recipe = event.recipes.gtceu.autoclave(`tfg:autoclave_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
const sodium_dodecyl_sulfate_recipe = event.recipes.gtceu.chemical_bath(`tfg:sodium_dodecyl_sulfate_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
.itemInputs(input)
.inputFluids(Fluid.of('tfg:sodium_dodecyl_sulfate', 50*recipe_multiplier))
.itemOutputs(output)
.duration(10*20*recipe_multiplier)
.EUt(GTValues.VA[GTValues.MV]);
const autoclave_recipe = event.recipes.gtceu.autoclave(`tfg:autoclave_cleaning/${input.replace(':', '_')}_to_${output.replace(':', '_')}`)
.itemInputs(input)
.perTick(true)
.inputFluids(Fluid.of('gtceu:steam', 100*recipe_multiplier))
@ -581,6 +594,7 @@ function sterilizeItem(event, input, output, multiplier, cleanroom) {
if (cleanroom) {
ethanol_recipe.cleanroom(cleanroom);
hydrogen_peroxide_recipe.cleanroom(cleanroom);
sodium_dodecyl_sulfate_recipe.cleanroom(cleanroom);
autoclave_recipe.cleanroom(cleanroom);
};
};

View file

@ -12,6 +12,8 @@ function registerTFCDataForTFG(event) {
registerTFGFauna(event);
}
//#region Heat Data
/** @param {Internal.TFCDataEventJS} event */
function registerTFGHeatData(event) {
event.itemHeat("tfg:latex_soaked_gloves", 1, null, null);
@ -40,6 +42,9 @@ function registerTFGHeatData(event) {
event.itemHeat('betterend:cave_pumpkin_pie', 1.0, null, null);
}
//#endregion
//#region Item Size
/** @param {Internal.TFCDataEventJS} event */
function registerTFGItemSize(event) {
/**
@ -139,7 +144,7 @@ function registerTFGItemSize(event) {
"gtceu:red_granite",
"gtceu:light_concrete",
"gtceu:dark_concrete",
"create:cardboard_block",
"create:cardboard_block"
])
),
"large",
@ -228,7 +233,7 @@ function registerTFGItemSize(event) {
"ae2:cable_anchor",
"ae2:level_emitter",
"ae2:energy_level_emitter",
"expatternprovider:threshold_level_emitter",
"expatternprovider:threshold_level_emitter"
]),
"tiny",
"very_light",
@ -271,7 +276,7 @@ function registerTFGItemSize(event) {
"expatternprovider:precise_export_bus",
"expatternprovider:precise_storage_bus",
"expatternprovider:threshold_export_bus",
"expatternprovider:oversize_interface_part",
"expatternprovider:oversize_interface_part"
]),
"very_small",
"very_light",
@ -289,6 +294,9 @@ function registerTFGItemSize(event) {
event.itemSize("tfg:vial", "tiny", "light", "tfg/vial");
}
//#endregion
//#region Support Data
//up, down, horizontal
/** @param {Internal.TFCDataEventJS} event */
function registerTFGSupportData(event) {
@ -310,6 +318,10 @@ function registerTFGSupportData(event) {
event.support(`tfg:${wood.name}_support_horizontal`, 2, 2, 4, `${wood.name}_support`);
});
}
//#endregion
//#region Food Data
/** @param {Internal.TFCDataEventJS} event */
function registerTFGFoodData(event) {
// meats
@ -705,8 +717,34 @@ function registerTFGFoodData(event) {
effect.duration(200);
});
});
event.foodItem("tfg:progenitor_cells", (food) => {
food.decayModifier(1);
});
event.foodItem("tfg:rough_endoplasmic_reticula", (food) => {
food.decayModifier(0.5);
});
event.foodItem("tfg:smooth_endoplasmic_reticula", (food) => {
food.decayModifier(0.5);
});
event.drinkable("tfg:proto_growth_medium", (data) => {
data.thirst(10);
data.food(food => {
food.dairy(5);
food.protein(1);
});
data.effect("minecraft:absorption", (effect) => {
effect.amplifier(2);
effect.chance(0.25);
effect.duration(1200);
});
});
}
//#endregion
//#region Crop Data
/** @param {Internal.TFCDataEventJS} event */
function registerTFGCropRanges(event) {
// Earth
@ -793,6 +831,9 @@ function registerTFGCropRanges(event) {
}, "betterend:shadow_berry");
}
//#endregion
//#region Planter Data
/** @param {Internal.TFCDataEventJS} event */
function registerTFGFLPlanters(event) {
event.firmalifePlantable(
@ -808,7 +849,7 @@ function registerTFGFLPlanters(event) {
"tfg:block/crop/sunflower_greenhouse_0",
"tfg:block/crop/sunflower_greenhouse_1",
"tfg:block/crop/sunflower_greenhouse_2",
"tfg:block/crop/sunflower_greenhouse_3",
"tfg:block/crop/sunflower_greenhouse_3"
],
null
);
@ -826,7 +867,7 @@ function registerTFGFLPlanters(event) {
"tfg:block/crop/rapeseed_greenhouse_0",
"tfg:block/crop/rapeseed_greenhouse_1",
"tfg:block/crop/rapeseed_greenhouse_2",
"tfg:block/crop/rapeseed_greenhouse_3",
"tfg:block/crop/rapeseed_greenhouse_3"
],
null
);
@ -844,7 +885,7 @@ function registerTFGFLPlanters(event) {
"tfg:block/crop/flax_age_0",
"tfg:block/crop/flax_age_1",
"tfg:block/crop/flax_age_5_top",
"tfg:block/crop/flax_age_6_top",
"tfg:block/crop/flax_age_6_top"
],
null
);
@ -862,7 +903,7 @@ function registerTFGFLPlanters(event) {
"betterend:block/amber_root_0",
"betterend:block/amber_root_1",
"betterend:block/amber_root_2",
"betterend:block/amber_root_3",
"betterend:block/amber_root_3"
],
null
);
@ -880,7 +921,7 @@ function registerTFGFLPlanters(event) {
"betterend:block/blossom_berry_seed_0",
"betterend:block/blossom_berry_seed_1",
"betterend:block/blossom_berry_seed_2",
"betterend:block/blossom_berry_seed_3",
"betterend:block/blossom_berry_seed_3"
],
null
);
@ -898,7 +939,7 @@ function registerTFGFLPlanters(event) {
"betterend:block/bolux_mushroom_greenhouse_0",
"betterend:block/bolux_mushroom_greenhouse_1",
"betterend:block/bolux_mushroom_greenhouse_2",
"betterend:block/bolux_mushroom_greenhouse_3",
"betterend:block/bolux_mushroom_greenhouse_3"
],
null
);
@ -916,7 +957,7 @@ function registerTFGFLPlanters(event) {
"betterend:block/chorus_mushroom_0",
"betterend:block/chorus_mushroom_1",
"betterend:block/chorus_mushroom_2",
"betterend:block/chorus_mushroom_3",
"betterend:block/chorus_mushroom_3"
],
null
);
@ -934,7 +975,7 @@ function registerTFGFLPlanters(event) {
"betterend:block/cave_pumpkin_greenhouse_0",
"betterend:block/cave_pumpkin_greenhouse_1",
"betterend:block/cave_pumpkin_greenhouse_2",
"betterend:block/cave_pumpkin_greenhouse_3",
"betterend:block/cave_pumpkin_greenhouse_3"
],
"betterend:block/cave_pumpkin_top"
);
@ -952,12 +993,14 @@ function registerTFGFLPlanters(event) {
"betterend:block/shadow_berry_greenhouse_0",
"betterend:block/shadow_berry_greenhouse_1",
"betterend:block/shadow_berry_greenhouse_2",
"betterend:block/shadow_berry_greenhouse_3",
"betterend:block/shadow_berry_greenhouse_3"
],
null
);
}
//#endregion
//#region Fauna Data
/** @param {Internal.TFCDataEventJS} event */
function registerTFGFauna(event) {
@ -1063,4 +1106,6 @@ function registerTFGFauna(event) {
faunaData.solidGround(true)
},
"wan_ancient_beasts:glider")
}
}
//#endregion