582 lines
26 KiB
JavaScript
Executable File
582 lines
26 KiB
JavaScript
Executable File
//FIXME: broken andesite mixing recipe creates no output
|
|
//FIXME: test create shaft and cog recipes again
|
|
//FIXME: Figure out what the original create wool and concrete coloring recipes were, add mixer variants
|
|
//FIXME: Create a water mixer route to turn concrete powder to concrete
|
|
ServerEvents.recipes(event => {
|
|
// Metal tiers:
|
|
// Copper, iron, tin, nickel, gold, zinc, brass, invar, bronze - Pre-basic build tier, the only ores that don't require a pulverizer or smelter to process
|
|
// gold, silver, lead - gated behind crushing wheels
|
|
// platinum, iridum, osmium - Gated behind the pulverizer
|
|
// lumium, enderium, electrum, signalum, steel - Alloys are gated behind the smelter as well
|
|
// uranium - requires basic energetic grist to energize into ingots
|
|
|
|
// Gear tiers:
|
|
// copper, iron, tin, nickel, zinc, brass, bronze - Pre-gear die tier
|
|
// invar, bronze, brass - the only alloys you can make without grist
|
|
// constantan - requires 1 build grist to make the dust alloy
|
|
// invar, gold, silver, electrum, signalum, lead, steel - Gated behind gear die
|
|
// lumium, enderium, other alloys - Gated behind heavy duty gear die
|
|
|
|
let rawForms = (metal) => {
|
|
let ret = null;
|
|
AlmostUnified.getItemIds(`forge:raw_materials/${metal}`).forEach(id => {
|
|
if (ret == null) {
|
|
ret = Ingredient.of(id);
|
|
} else {
|
|
ret = ret.or(id);
|
|
}
|
|
});
|
|
return ret;
|
|
}
|
|
|
|
let metalForm = global.metalForm;
|
|
|
|
let alloyIngredients = (forms, ingredients) => {
|
|
let real_ingredients = [];
|
|
for (const ingredient of ingredients.slice(1)) {
|
|
let real_item = Item.of(ingredient);
|
|
if (real_item.id == 'minecraft:air') {
|
|
let real_ingredient = null;
|
|
for (const form of forms) {
|
|
let parts = ingredient.split(' ');
|
|
if (parts.length == 1) {
|
|
real_item = metalForm(parts[0], form);
|
|
} else {
|
|
real_item = metalForm(parts[1], form).withCount(parts[0].split('x')[0]);
|
|
}
|
|
if (real_item.id == 'minecraft:air') {
|
|
console.error(`Unknown or invalid alloy ${form} ingredient: ${ingredient}`);
|
|
} else {
|
|
if (real_ingredient == null) {
|
|
real_ingredient = Ingredient.of(real_item);
|
|
} else {
|
|
real_ingredient = real_ingredient.or(real_item);
|
|
}
|
|
//real_ingredients.push(real_item);
|
|
}
|
|
}
|
|
//console.error(`Ingredients: ${real_ingredients}`);
|
|
//real_ingredients.push(Ingredient.apply(null, real_ingredients));
|
|
real_ingredients.push(real_ingredient);
|
|
} else {
|
|
real_ingredients.push(real_item);
|
|
}
|
|
}
|
|
return real_ingredients;
|
|
};
|
|
|
|
// Progression
|
|
// Vanilla age -> Ore hammer for crushing tin to make andesite alloy
|
|
// Andesite age -> Mixer from andesite allow allows creating early alloys: bronze, brass, invar, constantan
|
|
// Invar age -> induction smelter from invar gears (which now require grist) allows higher level alloys: constantan
|
|
// Alloy age -> Higher level alloys unlock the rest of Thermal
|
|
|
|
// New metal tiers:
|
|
// Primitive: Copper - The only ore you can smelt directly in an oven. Also can be processed in a crafting table.
|
|
// Vanilla: Iron, tin, nickel, gold, zinc, brass, bronze, invar - The ores require a ore hammer to create 2x crushed ore, which can be smelted into ingots. The metals can be processed in a crafting table.
|
|
// Modded (requires build grist): invar
|
|
|
|
// Progression recipes:
|
|
// Constantan:
|
|
|
|
/*
|
|
|
|
Metal progression:
|
|
Primitive tier: Stone pickaxe to mine, raw ore can be immediately smelted
|
|
Copper
|
|
Vanilla tier: Stone pickaxe to mine, ore hammer to crush, then smelted. Only one alloy, and it can be crated on the crafting table
|
|
Iron, Tin, Gold, Zinc: Ores
|
|
Andesite alloy: 2x andesite + tin dust
|
|
Progression: Find tin, crush it, create andesite alloy to start making create mod items
|
|
Andesite age: Iron pickaxe to mine, crushing wheels to crush, then the crushed ore is smelted normally. Alloys require the create mixer. Ore washing to double crushed ore is unlocked, but fans require invar instead of iron. Gears can be crafted on a crafting table
|
|
Silver, Aluminium, Lead: Ores
|
|
Bronze - tin + copper
|
|
Brass - tin + 3x copper
|
|
Rose gold - copper + gold
|
|
Progression: Make some brass, craft a gear on the crafting table with build grist, create an induction furnace
|
|
Mechanical/grist age: Ores require diamond pick, crushed in the pulverizer, and crushed ore is smelted normally. Alloys require the induction furnace. 4x ore centrifuge is unlocked after creating a constantan gear on the crafting table. Other gears require the press.
|
|
Uranium, Platinum, Iridium?, Nickel, Osmium
|
|
Electrum - gold + silver
|
|
Invar - 2x iron + nickel
|
|
Constantan - Copper + nickel
|
|
Netherite - 4x netherite scrap, 4x gold
|
|
Progression: Create the gear die
|
|
Industrial age: Alloys require basic grists, gears can only be made with a gear die
|
|
Redium - 4x redstone powder, 2x obsidian powder, 2x iron dust, 1x blaze
|
|
Lapium - 4x lapis powder, 2x gold dust, 2x obsidian powder, 1x quartz powder
|
|
Gemium - 2x diamond, 1x prismarine powder, 2x emerald dust, 4x obsidian powder
|
|
Trilium - 2x lapium, 4x gemium, 1x ender powder, 2x redium
|
|
Signalum - silver + 3x copper + 4x redstone
|
|
Lumium - silver + 3x tin + 2x glowstone dust
|
|
Progression: Make it to the nether
|
|
Modern age: Alloys require improved grist
|
|
Gobber - gobber glob + diamond + iron + gold
|
|
nether gobber - nether glob + 2x gobber + netherite scrap
|
|
Quadrilium - 4x trilium, 4x netherite scrpa, 1x ghast tear
|
|
Progression: Make it to the end
|
|
Age of Legends:
|
|
Enderium - 1x diamond + 3x lead + 2x ender pearl = 2 ingot
|
|
end gobber - end glob + 2x nether gobber + chorus flower
|
|
Progression: That's it, that's the end. You won the game.
|
|
*/
|
|
|
|
let progression = {
|
|
// Primitive tier: Stone pickaxe to mine, raw ore can be immediately smelted
|
|
primitive: {
|
|
copper: []
|
|
},
|
|
// Vanilla tier: Stone pickaxe to mine, ore hammer to crush, then smelted. Only one alloy, and it can be crated on the crafting table
|
|
vanilla: {
|
|
iron: [],
|
|
tin: [],
|
|
gold: [],
|
|
zinc: [],
|
|
andesite_alloy: [4, '2x minecraft:andesite', 'tin']
|
|
},
|
|
// Andesite age: Iron pickaxe to mine, crushing wheels to crush, then the crushed ore is smelted normally. Alloys require the create mixer. Ore washing to double crushed ore is unlocked, but fans require invar instead of iron. Gears can be crafted on a crafting table
|
|
andesite: {
|
|
aluminum: [],
|
|
lead: [],
|
|
rose_gold: [2, 'copper', 'gold'],
|
|
bronze: [2, 'tin', 'copper'],
|
|
constantan: [2, 'copper', 'nickel'],
|
|
brass: [2, 'zinc', 'copper']
|
|
},
|
|
// Mechanical/grist age: Ores require diamond pick, crushed in the pulverizer, and crushed ore is smelted normally. Alloys require the induction furnace. 4x ore centrifuge is unlocked after creating a constantan gear on the crafting table. Other gears require the press.
|
|
mechanical: {
|
|
silver: [],
|
|
nickel: [],
|
|
invar: [3, '2x iron', 'nickel'],
|
|
electrum: [2, 'gold', 'silver'],
|
|
netherite: [1, '4x minecraft:netherite_scrap', '4x gold'],
|
|
},
|
|
// Industrial age: Alloys require basic grists, gears can only be made with a gear die
|
|
industrial: {
|
|
steel: [2, '2x iron', '#minecraft:coals'],
|
|
uranium: [],
|
|
platinum: [],
|
|
osmium: [],
|
|
signalum: [4, 'silver', '3x copper', '4x minecraft:redstone'],
|
|
lumium: [4, 'silver', '3x tin', '2x minecraft:glowstone_dust'],
|
|
redium: [4, '4x powder_power:powder_redstone', '2x #forge:dusts/obsidian', '2x #forge:dusts/iron', 'minecraft:blaze_powder'],
|
|
lapium: [4, '4x powder_power:powder_lapis', '2x #forge:dusts/gold', '2x #forge:dusts/obsidian', 'powder_power:powder_nether_quartz'],
|
|
gemium: [4, '4x #forge:dusts/obsidian', '2x #forge:dusts/diamond', '2x #forge:dusts/emerald', 'powder_power:powder_prismarine']
|
|
},
|
|
// Modern age: Alloys require improved grist
|
|
modern: {
|
|
gobber: [3, 'gobber2:gobber2_glob', 'platinum', 'osmium'],
|
|
nether_gobber: [3, 'gobber2:gobber2_glob_nether', 'minecraft:netherite_scrap', '2x gobber2:gobber2_ingot'],
|
|
quadrilium: [3, '3x trilium', '4x minecraft:netherite_scrap', 'powder_power:powder_ghast_tear'],
|
|
trilium: [4, '2x lapium', '2x gemium', '2x redium', 'powder_power:powder_end_pearl']
|
|
},
|
|
// Age of Legends: The end game
|
|
legends: {
|
|
//enderium: [],
|
|
end_gobber: [3, 'gobber2:gobber2_glob_end', '2x gobber2:gobber2_ingot_nether', '2x #kubejs:grist/build/improved']
|
|
}
|
|
};
|
|
|
|
// Basic rules for all materials
|
|
for (const [tier, metals] of Object.entries(progression)) {
|
|
for (const [metal, ingredients] of Object.entries(metals)) {
|
|
console.log(`Running ore processing for ${metal}...`);
|
|
|
|
let rawType = metalForm(metal, 'raw_materials', 'ore');
|
|
let rawIngredients = rawForms(metal);
|
|
let crushedType = Item.of(`create:crushed_raw_${metal}`);
|
|
|
|
let dustType = metalForm(metal, 'dusts', 'dust');
|
|
let nuggetType = metalForm(metal, 'nuggets', 'nugget');
|
|
let ingotType = metalForm(metal, 'ingots', 'ingot');
|
|
let blockType = metalForm(metal, 'storage_blocks', 'block');
|
|
let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block');
|
|
|
|
let plateType = metalForm(metal, 'plates', 'plate');
|
|
let gearType = metalForm(metal, 'gears', 'gear');
|
|
let rodType = metalForm(metal, 'rods', 'rod');
|
|
|
|
// Wipe out all the stock recipes
|
|
event.remove({output: gearType});
|
|
event.remove({output: dustType});
|
|
event.remove({output: blockType});
|
|
event.remove({output: rodType});
|
|
event.remove({output: plateType});
|
|
event.remove({output: ingotType});
|
|
event.remove({output: rawBlockType});
|
|
event.remove({output: nuggetType});
|
|
event.remove({output: crushedType});
|
|
event.remove({input: crushedType});
|
|
console.warn(`Removing ${metal} ingot recipes for ${ingotType.id}`);
|
|
|
|
let ingotSources = [];
|
|
|
|
// All forms can be crushed back into dust
|
|
if (dustType.id != 'minecraft:air') {
|
|
let dustSource = null;
|
|
[gearType, rodType, plateType, ingotType].forEach(form => {
|
|
if (form.id != 'minecraft:air') {
|
|
if (dustSource == null) {
|
|
dustSource = Ingredient.of(form);
|
|
} else {
|
|
dustSource = dustSource.or(form);
|
|
}
|
|
}
|
|
});
|
|
|
|
event.shapeless(dustType, [dustSource, '#alltheores:ore_hammers']);
|
|
event.recipes.create.crushing(dustType, dustSource);
|
|
event.recipes.create.milling(dustType, dustSource);
|
|
event.recipes.thermal.pulverizer(dustType, dustSource);
|
|
}
|
|
|
|
// All forms, including crushed ores, can be smelted back into an ingot
|
|
if (ingotType.id != 'minecraft:air') {
|
|
let ingotSource = null;
|
|
[gearType, rodType, plateType, dustType, crushedType].forEach(form => {
|
|
if (form.id != 'minecraft:air') {
|
|
if (ingotSource == null) {
|
|
ingotSource = Ingredient.of(form);
|
|
} else {
|
|
ingotSource = ingotSource.or(form);
|
|
}
|
|
}
|
|
});
|
|
if (ingotSource != null) {
|
|
event.smelting(ingotType, ingotSource);
|
|
} else {
|
|
console.warn(`Unable to generate ${metal} ingot smelting from derivatives`);
|
|
}
|
|
}
|
|
|
|
// Gears and ingots can be pressed into a plate
|
|
if (plateType.id != 'minecraft:air') {
|
|
let plateSource = null;
|
|
[gearType, ingotType].forEach(form => {
|
|
if (form.id != 'minecraft:air') {
|
|
if (plateSource == null) {
|
|
plateSource = Ingredient.of(form);
|
|
} else {
|
|
plateSource = plateSource.or(form);
|
|
}
|
|
}
|
|
})
|
|
event.recipes.thermal.press(plateType, plateSource);
|
|
event.recipes.create.pressing(plateType, plateSource);
|
|
}
|
|
|
|
// 4 ingots = 1 gear in the press
|
|
if (gearType.id != 'minecraft:air') {
|
|
// TODO: would be fun to have a special 'high efficiency' gear press?
|
|
event.recipes.thermal.press(gearType.withCount(2), [ingotType.withCount(4), 'thermal:press_gear_die']).id(`kubejs:${metal}_gear_in_thermal_press`);
|
|
}
|
|
|
|
// 9 Nuggets == 1 ingot, for every material
|
|
if (nuggetType.id != 'minecraft:air') {
|
|
event.shapeless(ingotType, [nuggetType.withCount(9)]).id(`kubejs:${metal}_ingot_from_nuggets`);
|
|
event.shapeless(nuggetType.withCount(9), [ingotType]).id(`kubejs:${metal}_nuggets_from_ingot`);
|
|
event.recipes.thermal.press(ingotType, [nuggetType.withCount(9), 'thermal:press_packing_3x3_die']).id(`kubejs:${metal}_ingot_from_nuggets_in_thermal_press`);
|
|
event.recipes.thermal.press(nuggetType.withCount(9), [ingotType, 'thermal:press_unpacking_die']).id(`kubejs:${metal}_nuggets_from_ingot_in_thermal_press`);
|
|
}
|
|
// 9 ore = 1 ore block
|
|
if (rawIngredients != null) {
|
|
event.shapeless(rawBlockType, [rawIngredients.withCount(9)]).id(`kubejs:${metal}_ore_block_from_ore`);
|
|
event.shapeless(rawType.withCount(9), [rawBlockType]).id(`kubejs:${metal}_ore_from_ore_block`);
|
|
event.recipes.thermal.press(rawBlockType, [rawIngredients.withCount(9), 'thermal:press_packing_3x3_die']).id(`kubejs:${metal}_ore_block_from_ore_in_thermal_press`);
|
|
event.recipes.thermal.press(rawType.withCount(9), [rawBlockType, 'thermal:press_unpacking_die']).id(`kubejs:${metal}_ore_from_ore_block_in_thermal_press`);
|
|
}
|
|
// 9 ingots = 1 block
|
|
if (blockType.id != 'minecraft:air') {
|
|
event.shapeless(blockType, [ingotType.withCount(9)]).id(`kubejs:${metal}_block_from_ingots`);
|
|
event.shapeless(ingotType.withCount(9), [blockType]).id(`kubejs:${metal}_ingots_from_block`);
|
|
event.recipes.thermal.press(blockType, [ingotType.withCount(9), 'thermal:press_packing_3x3_die']).id(`kubejs:${metal}_block_from_ingots_in_thermal_press`);
|
|
event.recipes.thermal.press(ingotType.withCount(9), [blockType, 'thermal:press_unpacking_die']).id(`kubejs:${metal}_ingots_from_block_in_thermal_press`);
|
|
}
|
|
|
|
if (rodType.id != 'minecraft:air') {
|
|
// All metals can waste one ingot to create a rod in the crafting table
|
|
event.shapeless(rodType, [ingotType.withCount(2), '#alltheores:ore_hammers']);
|
|
// Or create two rods from one ingot in the create cutter
|
|
event.recipes.create.cutting(rodType.withCount(2), ingotType);
|
|
// Or create four rods from the thermal sawmill
|
|
event.recipes.thermal.sawmill(rodType.withCount(4), ingotType);
|
|
// TODO: Isn't there also a thermal press we can use?
|
|
}
|
|
|
|
// All alloys can be created in the thermal smelter, or a superheated create mixer
|
|
if (ingredients.length > 0) {
|
|
let real_ingredients = alloyIngredients(['ingots', 'dusts'], ingredients);
|
|
|
|
if (real_ingredients.length == 0) {
|
|
console.error(`Unable to create ingots from ${form} for ${metal}!`);
|
|
} else {
|
|
// If we have 3 or fewer ingredients, we can create it in the 3-slot thermal smelter
|
|
if (real_ingredients.length <= 3) {
|
|
event.recipes.thermal.smelter(ingotType.withCount(ingredients[0]), real_ingredients).id(`kubejs:metals/smelting/${metal}`);
|
|
} else {
|
|
// Materials with 4 or more require superheating to be made in the mixer
|
|
event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).superheated().id(`kubejs:metals/superheated_mixing/${metal}`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Primitive tier: Ores can be immediately smelted
|
|
for (const [metal, ingredients] of Object.entries(progression.primitive)) {
|
|
let ingotType = metalForm(metal, 'ingots', 'ingot');
|
|
let rawType = metalForm(metal, 'raw_materials', 'ore');
|
|
let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block');
|
|
let blockType = metalForm(metal, 'storage_blocks', 'block');
|
|
|
|
console.log(`Building primitive processing for ${metal}...`);
|
|
|
|
if (rawType.id != 'minecraft:air') {
|
|
event.smelting(ingotType, rawType);
|
|
event.smelting(blockType, rawBlockType);
|
|
} else {
|
|
console.error(`No ${metal} smelting available!`);
|
|
}
|
|
|
|
// There are no alloys here to handle...
|
|
}
|
|
// The progression item is simply creating a copper ore hammer
|
|
|
|
// Vanilla tier: Ores need an ore hammer, and alloys can be crafted on the crafting table
|
|
for (const tier of ['primitive', 'vanilla']) {
|
|
for (const [metal, ingredients] of Object.entries(progression[tier])) {
|
|
let rawIngredients = rawForms(metal);
|
|
let dustType = metalForm(metal, 'dusts', 'dust');
|
|
let ingotType = metalForm(metal, 'ingots', 'ingot');
|
|
let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block');
|
|
|
|
console.log(`Building vanilla processing for ${metal}...`);
|
|
|
|
// Crush raw ore into dust with an ore hammer, in crafting table and in the deployer
|
|
if (rawIngredients != null) {
|
|
event.shapeless(dustType, [rawIngredients, '#alltheores:ore_hammers']);
|
|
event.shapeless(dustType.withCount(9), [rawBlockType, '#alltheores:ore_hammers']);
|
|
event.recipes.create.deploying([dustType], [rawIngredients, '#alltheores:ore_hammers']).keepHeldItem();
|
|
event.recipes.create.deploying([dustType.withCount(9)], [rawBlockType, '#alltheores:ore_hammers']).keepHeldItem();
|
|
} else {
|
|
console.log(`No ${metal} ore hammer smashing available due to missing raw form!`);
|
|
}
|
|
|
|
let real_ingredients = alloyIngredients(['ingots', 'dusts'], ingredients);
|
|
|
|
if (real_ingredients.length > 0 && ingotType.id != 'minecraft:air') {
|
|
event.shapeless(ingotType.withCount(ingredients[0]), real_ingredients);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Andesite alloy is the progression item, as it unlocks most of the next tier of create
|
|
//event.shapeless('create:andesite_alloy', [global.dustItem('tin'), '2x minecraft:andesite']);
|
|
|
|
let xpNugget = Item.of('create:experience_nugget');
|
|
|
|
// Andesite age: Crushing wheels to crush, then the crushed ore is smelted normally. Alloys require the create mixer. Ore washing to double crushed ore is unlocked, but fans require invar instead of iron. Gears can be crafted on a crafting table
|
|
for (const tier of ['primitive', 'vanilla', 'andesite']) {
|
|
for (const [metal, ingredients] of Object.entries(progression[tier])) {
|
|
let rawIngredients = rawForms(metal);
|
|
let crushedType = Item.of(`create:crushed_raw_${metal}`);
|
|
let dustType = metalForm(metal, 'dusts', 'dust');
|
|
let ingotType = metalForm(metal, 'ingots', 'ingot');
|
|
let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block');
|
|
let gearType = metalForm(metal, 'gears', 'gear');
|
|
let plateType = metalForm(metal, 'plates', 'plate');
|
|
|
|
console.log(`Building andesite processing for ${metal}...`);
|
|
|
|
if (rawIngredients != null) {
|
|
if (crushedType.id != 'minecraft:air') {
|
|
event.recipes.create.crushing([crushedType.withCount(2), xpNugget.withCount(2).withChance(0.75)], rawIngredients);
|
|
event.recipes.create.crushing([crushedType.withCount(18), xpNugget.withCount(18).withChance(0.75)], rawBlockType);
|
|
event.recipes.create.milling([crushedType.withCount(2)], rawIngredients);
|
|
event.recipes.create.milling([crushedType.withCount(18)], rawBlockType);
|
|
event.smelting(ingotType, crushedType);
|
|
|
|
if (dustType.id != 'minecraft:air') {
|
|
event.recipes.create.splashing([dustType.withCount(2)], crushedType);
|
|
} else {
|
|
console.error(`No ${metal} ore washing available!`);
|
|
}
|
|
} else {
|
|
console.error(`No ${metal} ore crushing available!`);
|
|
}
|
|
}
|
|
|
|
if (gearType.id != 'minecraft:air') {
|
|
event.shaped(gearType, [
|
|
' A ',
|
|
'ABA',
|
|
' A '
|
|
], {
|
|
'A': ingotType,
|
|
'B': '#forge:gems'
|
|
});
|
|
} else {
|
|
console.warn(`No ${metal} gears available!`);
|
|
}
|
|
|
|
if (plateType.id != 'minecraft:air') {
|
|
event.shapeless(plateType, [ingotType.withCount(2), '#alltheores:ore_hammers']);
|
|
} else {
|
|
console.warn(`No ${metal} plates available!`);
|
|
}
|
|
|
|
// These ones can simply have their dusts mixed in a cold mixer to create the "alloy" ingot, which for the andesite tier is only andesite alloy.
|
|
let real_ingredients = alloyIngredients(['dusts'], ingredients);
|
|
if (real_ingredients.length > 0) {
|
|
event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).id(`kubejs:metals/cold_mixing/${metal}`);
|
|
}
|
|
}
|
|
}
|
|
// Most machines from here on out require nickel, so we unlock the pulverizer behind our early alloys
|
|
event.replaceInput(
|
|
{output: 'thermal:machine_pulverizer'},
|
|
'#forge:gears/copper',
|
|
global.gearItem('brass')
|
|
);
|
|
|
|
// Mechanical/grist age: Ores require diamond pick, crushed in the pulverizer, and crushed ore is smelted normally. Alloys require blending dusts in a heated mixer, then smelting the blend. 4x ore centrifuge is unlocked after creating a constantan gear on the crafting table. Other gears require the press.
|
|
for (const tier of ['primitive', 'vanilla', 'andesite', 'mechanical']) {
|
|
for (const [metal, ingredients] of Object.entries(progression[tier])) {
|
|
let crushedType = Item.of(`create:crushed_raw_${metal}`);
|
|
let ingotType = metalForm(metal, 'ingots', 'ingot');
|
|
|
|
console.log(`Building mechanical processing for ${metal}...`);
|
|
|
|
if (crushedType.id != 'minecraft:air') {
|
|
// Crushed ores are created in the industrial tier code, but mechanical tier and below are the only ones that don't need a centrifuge first
|
|
// This allows Nickel to be processed into a constantan gear, which unlocks the centrifuge
|
|
event.smelting(ingotType, [crushedType]);
|
|
} else {
|
|
console.warn(`No ${metal} ore pulverizing available! Falling back to dust-based processing line`);
|
|
}
|
|
}
|
|
}
|
|
// Constantan gear is the progression item to get to the industrial tier, as it unlocks the press (and therefore other gears)
|
|
|
|
// Industrial age: Ores require centrifuging, alloys require basic grists, gears can only be made with a gear die
|
|
for (const tier of ['primitive', 'vanilla', 'andesite', 'mechanical', 'industrial']) {
|
|
for (const [metal, ingredients] of Object.entries(progression[tier])) {
|
|
let rawIngredients = rawForms(metal);
|
|
let crushedType = Item.of(`create:crushed_raw_${metal}`);
|
|
let ingotType = metalForm(metal, 'ingots', 'ingot');
|
|
let dustType = metalForm(metal, 'dusts', 'dust');
|
|
let rawBlockType = metalForm(`raw_${metal}`, 'storage_blocks', 'block');
|
|
if (rawIngredients != null) {
|
|
if (crushedType.id != 'minecraft:air') {
|
|
event.recipes.thermal.pulverizer([crushedType.withCount(4), crushedType.withChance(0.25), xpNugget.withCount(4).withChance(0.75)], rawIngredients);
|
|
event.recipes.thermal.pulverizer([crushedType.withCount(4 * 9), crushedType.withChance(0.25), xpNugget.withCount(4 * 9).withChance(0.75)], rawBlockType);
|
|
event.recipes.thermal.centrifuge([dustType.withCount(4), dustType.withChance(0.25)], crushedType);
|
|
} else {
|
|
console.error(`No ${metal} ore centrifuing available!`);
|
|
}
|
|
}
|
|
|
|
// Industrial and below can be mixed up in a regular heated mixer
|
|
let real_ingredients = alloyIngredients(['ingots', 'dusts'], ingredients);
|
|
if (real_ingredients.length > 0) {
|
|
event.recipes.create.mixing(ingotType.withCount(ingredients[0]), real_ingredients).heated().id(`kubejs:metals/hot_mixing/${metal}`);
|
|
}
|
|
}
|
|
}
|
|
|
|
// Generate clay from centrifuing ash or gravel
|
|
event.recipes.thermal.centrifuge([
|
|
Item.of('minecraft:clay_ball').withChance(1.05),
|
|
Item.of('minecraft:clay_ball').withChance(0.25)],
|
|
'supplementaries:ash_brick'
|
|
);
|
|
event.recipes.thermal.centrifuge([
|
|
Item.of('minecraft:clay_ball').withChance(1.75),
|
|
Item.of('minecraft:clay_ball').withChance(0.85)],
|
|
'minecraft:gravel'
|
|
);
|
|
// Let quartz dust be created in the crafting table with a hammer
|
|
event.shapeless('thermal:quartz_dust',
|
|
['minecraft:quartz', '#alltheores:ore_hammers']
|
|
).id('kubejs:quartz_dust_crushing');
|
|
|
|
// Fix up the diamond gear recipe, which somehow has two duplicates
|
|
event.remove({output: 'thermal:diamond_gear'});
|
|
event.shaped('thermal:diamond_gear', [
|
|
' A ',
|
|
'ABA',
|
|
' A '
|
|
], {
|
|
'A': 'minecraft:diamond',
|
|
'B': '#kubejs:grist/build/basic'
|
|
});
|
|
|
|
//event.recipes.create.crushing(dustType, dustSource);
|
|
event.recipes.create.milling('create:powdered_obsidian', 'minecraft:obsidian');
|
|
});
|
|
|
|
function shpaes() {
|
|
event.shapeless('thermal:quartz_dust', ['8x minecraft:granite', '#alltheores:ore_hammers']).id('kubejs:quartz_dust_from_granit_crushing_manual_only');
|
|
event.shapeless('thermal:quartz_dust', ['minecraft:quartz', '#alltheores:ore_hammers']).id('kubejs:quartz_dust_crushing_manual_only');
|
|
|
|
// And only copper can be smelted without pulverizing
|
|
event.smelting(global.ingotItem('copper'), metalForm('copper', 'raw_materials', 'ore'));
|
|
|
|
// Constantan is the only metal you can't work on the bench except for gears
|
|
event.shaped('thermal:constantan_gear', [
|
|
' A ',
|
|
'ABA',
|
|
' A '
|
|
], {
|
|
'A': global.ingotItem('constantan'),
|
|
'B': '#forge:gems'
|
|
});
|
|
|
|
event.shaped('thermal:diamond_gear', [
|
|
' A ',
|
|
'ABA',
|
|
' A '
|
|
], {
|
|
'A': 'minecraft:diamond',
|
|
'B': 'minecraft:crying_obsidian'
|
|
});
|
|
|
|
// Lapis can be pulverized and hammered.
|
|
event.remove({output: 'thermal:lapis_dust', type: 'thermal:pulverizer'});
|
|
event.custom({
|
|
type: "thermal:pulverizer",
|
|
ingredients: [
|
|
{ item: "minecraft:lapis_lazuli" }
|
|
],
|
|
result: [
|
|
{ item: "thermal:lapis_dust", chance: 1.05 },
|
|
{ item: "thermal:lapis_dust", chance: 0.25 }
|
|
],
|
|
experience: 0.5
|
|
});
|
|
event.shapeless("2x thermal:lapis_dust", ["minecraft:lapis_lazuli", '#alltheores:ore_hammers']).id('kubejs:lapis_dust_crushing_manual_only');
|
|
|
|
// Create clay by centrifuging gravel and ash bricks
|
|
event.custom({
|
|
type: "thermal:centrifuge",
|
|
ingredients: [
|
|
{ item: "supplementaries:ash_brick" }
|
|
],
|
|
result: [
|
|
{ item: "minecraft:clay_ball", chance: 1.05 },
|
|
{ item: "minecraft:clay_ball", chance: 0.25 }
|
|
],
|
|
experience: 0.5
|
|
});
|
|
|
|
event.custom({
|
|
type: "thermal:centrifuge",
|
|
ingredients: [
|
|
{ item: "minecraft:gravel" }
|
|
],
|
|
result: [
|
|
{ item: "minecraft:sand", chance: 2.00 },
|
|
{ item: "minecraft:clay_ball", chance: 0.75 }
|
|
],
|
|
experience: 0.5
|
|
});
|
|
} |