Skip to content

Commit 056ee91

Browse files
committed
Improve some API documentation
1 parent d9d85db commit 056ee91

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

src/main/java/com/laytonsmith/core/events/drivers/PlayerEvents.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,10 +2976,11 @@ public Driver driver() {
29762976
@Override
29772977
public String docs() {
29782978
return "{}"
2979-
+ " Fires when a player stops using an item, such as shields, bows, crossbows, tridents, brushes,"
2980-
+ " goat horns, or spyglasses. Edible items will also fire this if the player stops consuming"
2981-
+ " before completion. This event cannot be cancelled and is only available on Paper 1.18.2+."
2982-
+ " {player | item: The item that was used. | ticks: The number of ticks the item was used.)}"
2979+
+ " Fires when a player stops using an item such as shields, bows, crossbows, tridents, brushes,"
2980+
+ " goat horns, or spyglasses (not including when changing the held item)."
2981+
+ " Edible items will also fire this if the player stops consuming before completion."
2982+
+ " This event is only available on Paper 1.18.2+."
2983+
+ " {player | item: The item that was used. | ticks: The number of ticks the item was used.}"
29832984
+ " {}"
29842985
+ " {}";
29852986
}

src/main/java/com/laytonsmith/core/functions/Recipes.java

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,27 @@ public Integer[] numArgs() {
7878
@Override
7979
public String docs() {
8080
return "boolean {recipeArray} Adds a recipe to the server and returns whether it was added or not. ----"
81-
+ " The recipeArray can contain the following keys:"
82-
+ "'''type''' : (required) The type of recipe. Expected to be 'BLASTING', 'CAMPFIRE', 'FURNACE',"
83-
+ " 'SHAPED', 'SHAPELESS', 'SMOKING', or 'STONECUTTING'.\n"
84-
+ "'''key''' : (required) A unique string id for this recipe.\n"
85-
+ "'''result''' : (required) The result item array of the recipe.\n"
86-
+ "'''group''' : (optional) A group id for grouping recipes in the recipe book.\n"
87-
+ "'''shape''' : (shaped) The shape of the recipe. Represented as a 3 index normal array.\n"
88-
+ "'''ingredients''' : (shaped and shapeless recipes) Ingredients array of the recipe. See examples.\n"
89-
+ "'''input''' : (cooking and stonecutting) The input item type or array of types for this recipe.\n"
90-
+ "'''cookingtime''' : (cooking) The amount of time in ticks for the input item to cook.\n"
91-
+ "'''experience''' : (cooking) The amount of experience generated by this recipe.\n"
92-
+ "\n"
81+
+ " The recipeArray can contain the following keys:<br><br>"
82+
+ "'''type''' : (required) The type of recipe. Expected to be BLASTING, CAMPFIRE, FURNACE,"
83+
+ " SHAPED, SHAPELESS, SMOKING, or STONECUTTING.<br>"
84+
+ "'''key''' : (required) A unique string id for this recipe.<br>"
85+
+ "'''result''' : (required) The result item array of the recipe.<br>"
86+
+ "'''group''' : (optional) A group id for grouping recipes in the recipe book.<br>"
87+
+ "'''shape''' : (shaped recipes) The shape of the ingredients in the crafting grid."
88+
+ " This is a normal array of strings where each element is a row in the grid, and each string has"
89+
+ " a character for each column in the grid.<br>"
90+
+ "'''ingredients''' : (shaped and shapeless recipes) Ingredients array of the recipe."
91+
+ " Shaped recipes are an associative array mapping each character in the shape to a single"
92+
+ " ingredient item or material or an array of possible ingredient items or material."
93+
+ " Shapeless recipes are a normal array of ingredients, where each element can be a single item or"
94+
+ " material, or each element can be an array of possible items or materials."
95+
+ " Ingredients that are item arrays with meta will require exact ingredient matches."
96+
+ "'''input''' : (cooking and stonecutting recipes) The input item type or array of possible types"
97+
+ " for this recipe.<br>"
98+
+ "'''cookingtime''' : (cooking) An integer amount of time in ticks for the input item to cook.<br>"
99+
+ "'''experience''' : (cooking) An integer amount of experience generated by this recipe.<br>"
100+
+ "<br>"
101+
+ "Examples:<br><br>"
93102
+ " Shaped Recipe Data. Turns 9 stone into obsidian."
94103
+ " <pre>{\n"
95104
+ " key: 'stone_to_obsidian',\n"

0 commit comments

Comments
 (0)