-
Notifications
You must be signed in to change notification settings - Fork 130
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
1.14 #263
base: 1.14_eol
Are you sure you want to change the base?
1.14 #263
Changes from all commits
7528ea4
ea2c190
98c17d8
2119a60
def03d1
ff28a5f
f11fcff
e1d07eb
5243ea3
c4b8b7f
3cf2694
ba21f62
5746ecd
1fe3311
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Blast Furnace | ||
|
||
|
||
## Syntax | ||
Blast Furnaces use several different new syntax that you will be using: | ||
```zenscript | ||
addRecipe(recipeName as String, output as crafttweaker.api.item.IItemStack, input as crafttweaker.api.item.IIngredient, xp as float, cookTime as int); | ||
``` | ||
Just like before, let's break this down: | ||
```zenscript | ||
addRecipe(recipeName, output, input, xp, cookTime); | ||
``` | ||
|
||
| Name | Function | Data Type | Required | | ||
|------|----------|-----------|----------| | ||
| recipeName | name of the new recipe | string | yes | | ||
| output | IItemStack output of the recipe | IItemStack | yes | | ||
| input | IIngredient input of the recipe | IIngredient | yes | | ||
| xp | how much xp the player gets | float | yes | | ||
| cookTime | how long it takes to cook | integer | yes | | ||
|
||
Here is an example: | ||
|
||
```zenscript | ||
addRecipe("diamond_ingot", <item:minecraft:diamond>, <item:minecraft:iron_ore>, 1.0, 200); | ||
``` | ||
What you see here is that smelting an iron ore would award a diamond. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Campfire | ||
|
||
|
||
## Syntax | ||
Campfires use several different new syntax that you will be using: | ||
```zenscript | ||
addRecipe(recipeName as String, output as crafttweaker.api.item.IItemStack, input as crafttweaker.api.item.IIngredient, xp as float, cookTime as int); | ||
``` | ||
Just like before, let's break this down: | ||
```zenscript | ||
addRecipe(recipeName, output, input, xp, cookTime); | ||
``` | ||
|
||
| Name | Function | Data Type | Required | | ||
|------|----------|-----------|----------| | ||
| recipeName | name of the new recipe | string | yes | | ||
| output | IItemStack output of the recipe | IItemStack | yes | | ||
| input | IIngredient input of the recipe | IIngredient | yes | | ||
| xp | how much xp the player gets | float | yes | | ||
| cookTime | how long it takes to cook | integer | yes | | ||
|
||
Here is an example: | ||
|
||
```zenscript | ||
addRecipe("cooked_glowstone", <item:minecraft:glowstone>, <item:minecraft:glowstone_dust>, 10.0, 150); | ||
``` | ||
What you see here is that smelting a glowstone dust would award a glowstone. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Crafting Table | ||
|
||
|
||
## Introduction | ||
|
||
There are three main types of recipes for a crafting table. Each one serves a similar but very distinct purpose. | ||
|
||
| Name | Function | | ||
|------|----------| | ||
| addShaped | A shaped recipe. A shaped recipe is a recipe like a pickaxe, in which the ingredients have to be arranged in a specific way or the recipe will not produce. | | ||
| addShapedMirrored | A shaped(mirrored) recipe. This is a recipe that is shaped, but will also work flipped, like when you craft an axe. | | ||
| addShapeless | This is the recipe type when you put a flower in your crafting table and it gives you dye. It doesnt matter where the flower goes, as long as its just the flower. | | ||
|
||
Some things to note: | ||
- The 2x2 crafting grid located in the inventory is considered a `craftingTable` | ||
|
||
|
||
## Syntax: | ||
```zenscript | ||
craftingTable.addShaped(String recipeName, IItemStack output, IIngredient[][] ingredients, @ZenCodeType.Optional RecipeFunctionMatrix recipeFunction); | ||
``` | ||
Okay, that's the technical syntax. Let's digest that into its most basic: | ||
```zenscript | ||
craftingTable.addShaped(recipeName, output, ingredients, recipeFunction); | ||
``` | ||
|
||
Now what does all that mean? | ||
|
||
| Name | Function | Data Type | Required | | ||
|------|----------|-----------|----------| | ||
| recipeName | Used to create an identifier for your recipe. Must be unique for and from each recipe | String | Yes | | ||
| output | This value is what item you want the recipe to make. | IIngredient | Yes | | ||
| ingredients | The actual recipe | Matrix | Yes | | ||
| recipeFunction | ? | ? | No | | ||
|
||
`recipeName` is presented as a string in lowercase, such as `"my_new_recipe"`. It is good practice to create a relevant name, like `"custom_arrow_recipe"` for an Arrow recipe. | ||
`output` is presented as `<item:modid:itemname>`. The `<>` and `item:` are required. An example would look like this: `<item:minecraft:arrow>` | ||
`ingredients` is where the fun part comes in. The `IIngredient` is presented as a matrix, which would look something like this: | ||
|
||
3x3 | ||
```zenscript | ||
[[<item>, <item>, <item>], | ||
[<item>, <item>, <item>], | ||
[<item>, <item>, <item>]] | ||
``` | ||
|
||
2x2 | ||
```zenscript | ||
[[<item>, <item>], | ||
[<item>, <item>]] | ||
``` | ||
|
||
|
||
### Add Shaped Recipe | ||
```zenscript | ||
craftingTable.addShaped(String recipeName, IItemStack output, IIngredient[][] ingredients, @ZenCodeType.Optional RecipeFunctionMatrix recipeFunction); | ||
``` | ||
This script will add a shaped recipe to the game. Example: | ||
```zenscript | ||
craftingTable.addShaped("iron_tipped_arrow", <item:minecraft:arrow>, [ | ||
[<item:minecraft:air>, <item:minecraft:air>, <item:minecraft:iron_ingot>], | ||
[<item:minecraft:air>, <item:minecraft:stick>, <item:minecraft:air>], | ||
[<item:minecraft:feather>, <item:minecraft:air>, <item:minecraft:air>] | ||
]); | ||
``` | ||
This script would create a recipe that not only allows arrows to be crafted diagonally, but with an iron ingot in place of the typical flint. | ||
|
||
|
||
### Add Shaped(Mirrored) Recipe | ||
```zenscript | ||
addShapedMirrored(String recipeName, IItemStack output, IIngredient[][] ingredients, @ZenCodeType.Optional RecipeFunctionMatrix recipeFunction); | ||
``` | ||
This script will add a shaped(mirrored) recipe to the game. Example: | ||
```zenscript | ||
craftingTable.addShapedMirrored("iron_tipped_arrow", <item:minecraft:arrow>, [ | ||
[<item:minecraft:air>, <item:minecraft:air>, <item:minecraft:iron_ingot>], | ||
[<item:minecraft:air>, <item:minecraft:stick>, <item:minecraft:air>], | ||
[<item:minecraft:feather>, <item:minecraft:air>, <item:minecraft:air>] | ||
]); | ||
``` | ||
This script is almost identical to the example provided for a `shapedRecipe`, except now, the recipe can be input from both diagonals and still give the output. Good for recipes like axes, arrows, bows, and fishing rods that commonly get flipped around. | ||
|
||
|
||
### Add Shapeless Recipe | ||
```zenscript | ||
addShapeless(String recipeName, IItemStack output, IIngredient[] ingredients, @ZenCodeType.Optional RecipeFunctionArray recipeFunction); | ||
``` | ||
This script will add a shapeless recipe to the game. I will provide a 2x2 example, however this would work in a 3x3 as well: | ||
```zenscript | ||
craftingTable.addShapeless("iron_tipped_arrow", <item:minecraft:arrow>, [ | ||
[<item:minecraft:iron_ingot>, <item:minecraft:air>], | ||
[<item:minecraft:stick>,<item:minecraft:feather>] | ||
]); | ||
``` | ||
This script would allow arrows to be crafted in a 2x2 grid by just throwing in those items anywhere. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Furnace | ||
|
||
|
||
## Syntax | ||
Furnaces use several different new syntax that you will be using: | ||
```zenscript | ||
addRecipe(recipeName as String, output as crafttweaker.api.item.IItemStack, input as crafttweaker.api.item.IIngredient, xp as float, cookTime as int); | ||
``` | ||
Just like before, let's break this down: | ||
```zenscript | ||
addRecipe(recipeName, output, input, xp, cookTime); | ||
``` | ||
|
||
| Name | Function | Data Type | Required | | ||
|------|----------|-----------|----------| | ||
| recipeName | name of the new recipe | string | yes | | ||
| output | IItemStack output of the recipe | IItemStack | yes | | ||
| input | IIngredient input of the recipe | IIngredient | yes | | ||
| xp | how much xp the player gets | float | yes | | ||
| cookTime | how long it takes to cook | integer | yes | | ||
|
||
Here is an example: | ||
|
||
```zenscript | ||
addRecipe("arrow_to_glowing_arrow", <item:minecraft:spectral_arrow>, <item:minecraft:arrow>, 7283.0, 9999); | ||
``` | ||
What you see here is that smelting an arrow would award a spectral arrow, a extremely huge amount of exp, in exchange for a very large cook time. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Smoker | ||
|
||
|
||
## Syntax | ||
Smokers use several different new syntax that you will be using: | ||
```zenscript | ||
addRecipe(recipeName as String, output as crafttweaker.api.item.IItemStack, input as crafttweaker.api.item.IIngredient, xp as float, cookTime as int); | ||
``` | ||
Just like before, let's break this down: | ||
```zenscript | ||
addRecipe(recipeName, output, input, xp, cookTime); | ||
``` | ||
|
||
| Name | Function | Data Type | Required | | ||
|------|----------|-----------|----------| | ||
| recipeName | name of the new recipe | string | yes | | ||
| output | IItemStack output of the recipe | IItemStack | yes | | ||
| input | IIngredient input of the recipe | IIngredient | yes | | ||
| xp | how much xp the player gets | float | yes | | ||
| cookTime | how long it takes to cook | integer | yes | | ||
|
||
Here is an example: | ||
|
||
```zenscript | ||
addRecipe("cooked_diamond", <item:minecraft:diamond>, <item:minecraft:raw_porkchop>, 1.0, 100); | ||
``` | ||
What you see here is that smelting a raw porkchop would award a diamond. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Stonecutter | ||
|
||
|
||
## Syntax | ||
Stonecutters use similar syntax to a furnace, with a few key omissions: | ||
```zenscript | ||
addRecipe(recipeName as String, output as crafttweaker.api.item.IItemStack, input as crafttweaker.api.item.IIngredient); | ||
``` | ||
Just like before, let's break this down: | ||
```zenscript | ||
addRecipe(recipeName, output, input); | ||
``` | ||
|
||
Here is an example: | ||
|
||
```zenscript | ||
addRecipe("arrow_to_glowing_arrow", <item:minecraft:spectral_arrow>, <item:minecraft:arrow>); | ||
``` | ||
What you see here is that "stonecutting" an arrow would award a spectral arrow. |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Removing Recipes | ||
In order to remove recipes from the game, you will use the desired stationID followed by any of the below functions. All recipe-related globals in CraftTweaker use these following functions, meaning these scripts will work for removing recipes for every vanilla and modded crafting station. | ||
**- THESE FUNCTIONS WILL NOT WORK BY THEMSELVES.** In order to use the listed functions, each script will have to start with the stationID that you want to remove the recipe from. For instance: | ||
```zenscript | ||
craftingTable.removeRecipe(<item:minecraft:arrow>); | ||
``` | ||
Would remove the arrow recipe from a crafting table, but if you could craft it in a smoker, it wont remove it from there. Any and all scripts listed below will not include the stationID. You can find a list of all stationIDs at [INSERT]. | ||
|
||
|
||
|
||
## Functions: | ||
|
||
|
||
### Remove a Recipe | ||
```zenscript | ||
removeRecipe(IItemStack output); | ||
``` | ||
This script will remove a(ll) recipes for a referenced item. For instance, typing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
```zenscript | ||
removeRecipe(<item:minecraft:arrow>); | ||
``` | ||
will remove all recipes for a normal Arrow. | ||
|
||
|
||
### Remove by Name | ||
```zenscript | ||
removeByName(String name); | ||
``` | ||
This script will remove every recipe for every item that has the input name. For instance, | ||
```zenscript | ||
removeByName("minecraft:arrow"); | ||
``` | ||
will remove the vanilla recipe for an Arrow. In function, this is identical to the script you were just showed, but this one is better for removing a *certain* recipe instead of all of an items recipes because you can replace `minecraft:arrow` with `<modid>:arrow` to ONLY remove that mods recipe for an Arrow. | ||
|
||
|
||
### Remove by Mod ID | ||
```zenscript | ||
removeByModid(String modid); | ||
``` | ||
This script will remove every recipe from a single mod by referencing its `id`. For instance, Minecraft has an id of `minecraft`, so typing | ||
```zenscript | ||
removebyModid("minecraft"); | ||
``` | ||
would remove *every* recipe in Vanilla minecraft, but not recipes added by other mods. | ||
|
||
|
||
### Remove by Regex | ||
```zenscript | ||
removeByRegex(String regex); | ||
``` | ||
This script will remove every recipe that contains the given string somewhere in its name. For instance, | ||
```zenscript | ||
removeByRegex(".*arrow.*"); | ||
``` | ||
would remove every recipe, added by every mod, for every item whose recipe contains the string "arrow". This one is a bit more complex to understand, but try running that example script and then use a mod like `JEI` to try and find recipes for an arrow. | ||
**Note: The `.*` tag searches anywhere in the recipe name. Without it, the string would have to be an exact match. Then it isnt very helpful, because a normal `removeRecipe` would do the same trick.** | ||
|
||
|
||
### Remove All | ||
```zenscript | ||
removeAll(); | ||
``` | ||
This script will remove every recipe from the game. It isnt recommended for general use, but its an option. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Syntax | ||
|
||
## Avoiding Script Errors | ||
- Every function in your script has to end with a semicolon (`;`). You will see this inside examples and you will get used to doing it very quickly. | ||
- Use proper brackets. | ||
- Remember to close your brackets. Most text editors come with either a bracket pair highlighting or automatically creating a closing bracket. | ||
|
||
## Referencing | ||
- Every reference to an item in game **must** be referenced with `<>`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This statement feels a bit miss-leading, as you could also later reference an item using a variable, which would not need to be surrounded with brackets. |
||
- `<item:modID:itemID>` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Stations | ||
|
||
Crafting Table - `craftingTable` | ||
Furnace - `furnace` | ||
Smoker - `smoker` | ||
Blast Furnace - `blastFurnace` | ||
Stonecutter - `stoneCutter` | ||
Campfire - `campfire` | ||
|
||
*As more managers are added, more stations will be added* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation for the crafting table has been added here.
I think some decisions should be made as to how the documentation should be structured. @jaredlll08 when you have some time, I think it would be good to draft up a general concept for contributors to follow and add it to the README.