Created
November 7, 2019 01:56
-
-
Save supersaiyansubtlety/414ee3bb4bec55f3ea3223a7c4a76066 to your computer and use it in GitHub Desktop.
Attempts to find and replace all slab recipes using CraftTweaker's ZenScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | |
] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good to know, thanks again