it works! added priority and removed extra crap

This commit is contained in:
APEX FIGHT
2026-01-16 16:07:39 -05:00
parent 68b85fe4de
commit 9821e2226f

View File

@@ -1,50 +1,18 @@
const toggle = false; // priority: 12
const toggle = true;
ServerEvents.recipes(e => { ServerEvents.recipes(e => {
let recipes=[];
e.forEachRecipe({},r=>{
// console.log("recipe",r.json.toString())
recipes.push(JSON.parse(r.json.toString()));
});
let recipe=JSON.stringify(recipes);
console.log(recipe);
if (toggle) { if (toggle) {
console.warn("RECIPE DUMPING IS TURNED ON, THIS WILL DUMP JSON DATA OF ALL OF THE RECIPES IN THE GAME, WILL LAG"); console.warn("RECIPE DUMPING IS TURNED ON, THIS WILL DUMP JSON DATA OF ALL OF THE RECIPES IN THE GAME, WILL LAG");
let rec = e.getRecipes(); let recipes=[];
e.forEachRecipe({},r=>{
// console.log("recipe",r.json.toString())
recipes.push(JSON.parse(r.json.toString()));
});
let recipe=JSON.stringify(recipes);
console.log(recipe);
for (let k in rec) {
let value = [];
try {
for (let i of rec[k]){
try {
value.push(i.json.toString());
} catch (err) {console.log(".");}
}
} catch (err) {console.log("unknown obj: " + JSON.stringify(rec[k]));}
console.log(JSON.stringify({key:k,val:rec[k]}))
}
} }
}); });