Code reformat, cleanup

This commit is contained in:
oitsjustjose 2022-01-31 08:57:45 -06:00
commit 14f6b71e78
71 changed files with 4369 additions and 3704 deletions

View file

@ -1,15 +1,32 @@
// priority: 1024
onEvent("server.datapack.first", (_) => {
global.minecraftColors = ["white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "light_gray", "cyan", "purple", "blue", "brown", "green", "red", "black"];
onEvent('server.datapack.first', _ => {
global.minecraftColors = [
'white',
'orange',
'magenta',
'light_blue',
'yellow',
'lime',
'pink',
'gray',
'light_gray',
'cyan',
'purple',
'blue',
'brown',
'green',
'red',
'black',
];
/* Creates */
global.genNatProgRecipes = (base, stripped, planks) => {
const stripLogWithSaw = {
type: "natural-progression:damage_tools",
type: 'natural-progression:damage_tools',
ingredients: [
{
tag: "natural-progression:saw",
tag: 'natural-progression:saw',
},
{
item: base,
@ -21,13 +38,13 @@ onEvent("server.datapack.first", (_) => {
};
const planksFromStrippedAxe = {
type: "natural-progression:damage_tools",
type: 'natural-progression:damage_tools',
ingredients: [
{
item: stripped,
},
{
tag: "natural-progression:axe",
tag: 'natural-progression:axe',
},
],
result: {
@ -37,13 +54,13 @@ onEvent("server.datapack.first", (_) => {
};
const planksFromStrippedSaw = {
type: "natural-progression:damage_tools",
type: 'natural-progression:damage_tools',
ingredients: [
{
item: stripped,
},
{
tag: "natural-progression:saw",
tag: 'natural-progression:saw',
},
],
result: {
@ -65,7 +82,7 @@ onEvent("server.datapack.first", (_) => {
global.genCombinedRecipe = (evt, left, right, output) => {
evt.smithing(output, left, right);
evt.custom({
type: "mekanism:combining",
type: 'mekanism:combining',
mainInput: JSON.parse(left.toJson()),
extraInput: JSON.parse(right.toJson()),
output: output.toResultJson(),
@ -85,7 +102,7 @@ onEvent("server.datapack.first", (_) => {
const extra = JSON.parse(right.toJson());
evt.custom({
type: "improvedbackpacks:sewing",
type: 'improvedbackpacks:sewing',
first: main.ingredient || main,
first_count: left.getCount(),
second: extra.ingredient || extra,
@ -95,7 +112,7 @@ onEvent("server.datapack.first", (_) => {
});
evt.custom({
type: "mekanism:combining",
type: 'mekanism:combining',
mainInput: main,
extraInput: extra,
output: output.toResultJson(),
@ -112,9 +129,9 @@ onEvent("server.datapack.first", (_) => {
*/
global.genAlloyingRecipe = (evt, first, second, output, qty) => {
evt.custom({
type: "mekanism:combining",
mainInput: { ingredient: first },
extraInput: { ingredient: second },
type: 'mekanism:combining',
mainInput: {ingredient: first},
extraInput: {ingredient: second},
output: {
item: output,
count: qty,
@ -122,34 +139,34 @@ onEvent("server.datapack.first", (_) => {
});
evt.custom({
type: "thermal:smelter",
type: 'thermal:smelter',
ingredients: [
{ value: [first], count: 1 },
{ value: [second], count: 1 },
{value: [first], count: 1},
{value: [second], count: 1},
],
result: [{ item: output, count: qty }],
result: [{item: output, count: qty}],
energy: 4800,
});
evt.custom({
type: "immersiveengineering:alloy",
type: 'immersiveengineering:alloy',
time: 400,
input0: { base_ingredient: first },
input0: {base_ingredient: first},
input1: second,
result: { count: qty, base_ingredient: { item: output } },
result: {count: qty, base_ingredient: {item: output}},
});
evt.custom({
type: "create:mixing",
type: 'create:mixing',
ingredients: [first, second],
results: [{ item: output, count: qty }],
heatRequirement: "heated",
results: [{item: output, count: qty}],
heatRequirement: 'heated',
});
};
global.genLargeRecipe = (evt, pattern, key, result) => {
["extendedcrafting:shaped_table", "create:mechanical_crafting"].forEach((type) => {
evt.custom({ type: type, pattern: pattern, key: key, result: result });
['extendedcrafting:shaped_table', 'create:mechanical_crafting'].forEach(type => {
evt.custom({type: type, pattern: pattern, key: key, result: result});
});
};
});