summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-14 16:02:32 +0200
committermadmaxoft <github@xoft.cz>2013-10-14 16:02:32 +0200
commitf546a0e180cf153ed53ea0fc083f7954901e15e6 (patch)
treef49906660948a150dd254f7e81e58ef79289ae25 /MCServer/Plugins/APIDump
parentAPIDump: Documented HOOK_COLLECTING_PICKUP. (diff)
downloadcuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.tar
cuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.tar.gz
cuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.tar.bz2
cuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.tar.lz
cuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.tar.xz
cuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.tar.zst
cuberite-f546a0e180cf153ed53ea0fc083f7954901e15e6.zip
Diffstat (limited to 'MCServer/Plugins/APIDump')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 6044b0a0a..adc3a9835 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2324,6 +2324,32 @@ end;
]],
}, -- HOOK_COLLECTING_PICKUP
+ HOOK_CRAFTING_NO_RECIPE =
+ {
+ CalledWhen = " No built-in crafting recipe is found. Plugin may provide a recipe.",
+ DefaultFnName = "OnCraftingNoRecipe", -- also used as pagename
+ Desc = [[
+ This callback is called when a player places items in their {{cCraftingGrid|crafting grid}} and
+ MCServer cannot find a built-in {{cCraftingRecipe|recipe}} for the combination. Plugins may provide
+ a recipe for the ingredients given.
+ ]],
+ Params =
+ {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player whose crafting is reported in this hook" },
+ { Name = "Grid", Type = "{{cCraftingGrid}}", Notes = "Contents of the player's crafting grid" },
+ { Name = "Recipe", Type = "{{cCraftingRecipe}}", Notes = "The recipe that will be used (can be filled by plugins)" },
+ },
+ Returns = [[
+ If the function returns false or no value, no recipe will be used. If the function returns true, no
+ other plugin will have their callback called for this event and MCServer will use the crafting
+ recipe in Recipe.</p>
+ <p>
+ FIXME: To allow plugins give suggestions and overwrite other plugins' suggestions, we should change
+ the behavior with returning false, so that the recipe will still be used, but fill the recipe with
+ empty values by default.
+ ]],
+ }, -- HOOK_CRAFTING_NO_RECIPE
+
}, -- Hooks[]