Skip to content

Instantly share code, notes, and snippets.

@supersaiyansubtlety
Created November 7, 2019 01:56
Show Gist options
  • Save supersaiyansubtlety/414ee3bb4bec55f3ea3223a7c4a76066 to your computer and use it in GitHub Desktop.
Save supersaiyansubtlety/414ee3bb4bec55f3ea3223a7c4a76066 to your computer and use it in GitHub Desktop.
Attempts to find and replace all slab recipes using CraftTweaker's ZenScript
import crafttweaker.recipes.ICraftingRecipe;
import crafttweaker.item.IIngredient;
var slabRecipes = recipes.all;
for recipe in slabRecipes
{
if (recipe.output.name.toLowerCase has "slab")
{
var ingredients = recipe.ingredients1D as IIngredient[];
var i = 0;
while ((i < ingredients.length) & (ingredients[i] == null))
{
i+=1;
}
var input = ingredients[i];
var ouput = recipe.output;
output.amount = 4;
recipes.remove(recipe.output);
recipes.addShapedMirrored(input.displayName + "-to-" + output.displayName, output,
[
[null,null,null],
[null,null,null],
[null,input,input]
]
);
}
}
@supersaiyansubtlety
Copy link
Author

Good to know, thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment