Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RockyTweaks Anvil.md #570

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 21 additions & 27 deletions docs/1.12/content/Mods/RockyTweaks/Anvil.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,30 @@

## Addition

### Single
### Basic

Creates individual anvil recipes that a displayed separately in JEI.
Creates an anvil recipe that is displayed separately in JEI.

```zenscript
// addRecipe(IItemstack input1, IItemstack input2, IItemstack output, int exp-cost);
mods.rockytweaks.Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 8, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}), 5);
// addRecipe(IIngredient left, IIngredient right, IItemStack output, int expCost);
Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 8, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}), 5);
```

### Recipe Set
### With Function

Creates multiple anvil recipes that JEI cycles through the possible options.
Creates an anvil recipe that determines its output based on a [Recipe Function](/Vanilla/Recipes/Crafting/Recipe_Functions#irecipefunction) passed into it.

```zenscript
// addRecipe(IItemstack input1, IItemstack[] input2, IItemstack[] output, int[] exp-cost);
mods.rockytweaks.Anvil.addRecipe(<minecraft:book>,
[
<minecraft:quartz> * 8,
<minecraft:quartz> * 16,
<minecraft:quartz> * 32
],
[
<minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}),
<minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 2 as short, id: 16 as short}]}),
<minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 3 as short, id: 16 as short}]})
],
[
5,
15,
32
]
// addRecipe(IIngredient left, IIngredient right, IItemStack output, int expCost, IRecipeFunction function);
Anvil.addRecipe(<minecraft:dirt>, <minecraft:sand>, <minecraft:gravel>, 1,
function(output, input, craftinginfo) {
if (!isNull(input.right.tag.display)
&& !isNull(input.right.tag.display.Name)
&& input.right.tag.display.Name == "Good Taco Seasoning") {
return <minecraft:cooked_porkchop>;
}
return output;
}
);
```

Expand All @@ -45,15 +38,16 @@ mods.rockytweaks.Anvil.addRecipe(<minecraft:book>,
The anvil does not use recipes in the normal sense but you are still able to remove/blacklist specific inputs or outputs.

```zenscript
// remove(IIngredient[] inputs)
// remove(IIngredient output) - Remove an output
// Remove input(s) - remove(IIngredient[] inputs)
// Remove output - remove(IIngredient output)
// Remove all vanilla recipes - removeAll()

// Blacklist Mending Enchant (input)
Anvil.remove([<minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 70 as short}]})]);

// Blacklist Sharpness V on a Diamond Sword (inputs)
mods.rockytweaks.Anvil.remove([<minecraft:diamond_sword>, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 5 as short, id: 16 as short}]})]);
Anvil.remove([<minecraft:diamond_sword>, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 5 as short, id: 16 as short}]})]);

// Blacklist Enchanted Books (output)
mods.rockytweaks.Anvil.remove(<minecraft:enchanted_book>);
Anvil.remove(<minecraft:enchanted_book>);
```