summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-23 21:26:24 +0100
committermadmaxoft <github@xoft.cz>2013-11-23 21:27:02 +0100
commitd9dc241e6fe669585d7c0b13d55818a22e1c76bc (patch)
tree0eed0d711eb4ff851e43f84bf6cb8f7cf3435cde /MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua
parentDocumented sqlite functions. Used: http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki#sqlite3_functions (diff)
downloadcuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.gz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.bz2
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.lz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.xz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.zst
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.zip
Diffstat (limited to 'MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua')
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua b/MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua
new file mode 100644
index 000000000..8af78ba62
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnPostCrafting.lua
@@ -0,0 +1,36 @@
+return
+{
+ HOOK_POST_CRAFTING =
+ {
+ CalledWhen = "After the built-in recipes are checked and a recipe was found.",
+ DefaultFnName = "OnPostCrafting", -- also used as pagename
+ Desc = [[
+ This hook is called when a {{cPlayer|player}} changes contents of their
+ {{cCraftingGrid|crafting grid}}, after the recipe has been established by MCServer. Plugins may use
+ this to modify the resulting recipe or provide an alternate recipe.</p>
+ <p>
+ If a plugin implements custom recipes, it should do so using the {{OnPreCrafting|HOOK_PRE_CRAFTING}}
+ hook, because that will save the server from going through the built-in recipes. The
+ HOOK_POST_CRAFTING hook is intended as a notification, with a chance to tweak the result.</p>
+ <p>
+ Note that this hook is not called if a built-in recipe is not found;
+ {{OnCraftingNoRecipe|HOOK_CRAFTING_NO_RECIPE}} is called instead in such a case.
+ ]],
+ Params =
+ {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has changed their crafting grid contents" },
+ { Name = "Grid", Type = "{{cCraftingGrid}}", Notes = "The new crafting grid contents" },
+ { Name = "Recipe", Type = "{{cCraftingRecipe}}", Notes = "The recipe that MCServer has decided to use (can be tweaked by plugins)" },
+ },
+ Returns = [[
+ If the function returns false or no value, other plugins' callbacks are called. If the function
+ returns true, no other callbacks are called for this event. In either case, MCServer uses the value
+ of Recipe as the recipe to be presented to the player.
+ ]],
+ }, -- HOOK_POST_CRAFTING
+}
+
+
+
+
+