Skip to content

Instantly share code, notes, and snippets.

@kindlich
Created March 15, 2018 17:25
Show Gist options
  • Save kindlich/fdde1f8b83a31208894b06ffd48a2cbf to your computer and use it in GitHub Desktop.
Save kindlich/fdde1f8b83a31208894b06ffd48a2cbf to your computer and use it in GitHub Desktop.
import crafttweaker.item.IIngredient;
import crafttweaker.recipes.IRecipeFunction;
val oreDict = <ore:myUniqueOreDict>;
//Simply So that I have an oreDict
oreDict.add(<minecraft:iron_ingot>, <minecraft:gold_ingot>, <minecraft:redstone>, <minecraft:grass>);
val recipeFunctionSingleItems as IRecipeFunction = function(out, ins, cInfo){
var ingredient as IIngredient = null;
for item in cInfo.inventory.itemArray {
if (isNull(ingredient))
ingredient = item;
else {
if (!isNull(item)){
if (ingredient has item)
return null;
ingredient |= item;
}
}
}
return out;
};
recipes.addShapeless(null, <minecraft:skull>, [oreDict, oreDict, oreDict], recipeFunctionSingleItems, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment