Rename addEggRecipe to registerEggRecipe & add alias
This commit is contained in:
parent
a6b5acf195
commit
b44525fb8c
17
api.lua
17
api.lua
@ -31,10 +31,12 @@
|
||||
|
||||
--- Adds a craft recipe for an egg.
|
||||
--
|
||||
-- @function asm.addEggRecipe
|
||||
-- Alias: *asm.addEggRecipe*
|
||||
--
|
||||
-- @function asm.registerEggRecipe
|
||||
-- @param name Name of spawnegg that will be created from recipe.
|
||||
-- @param ingredients Items used for recipe in addition to `spawneggs:egg`. Can be string or list.
|
||||
asm.addEggRecipe = function(name, ingredients)
|
||||
asm.registerEggRecipe = function(name, ingredients)
|
||||
if type(ingredients) == "string" then
|
||||
ingredients = {ingredients,}
|
||||
end
|
||||
@ -47,9 +49,14 @@ asm.addEggRecipe = function(name, ingredients)
|
||||
})
|
||||
end
|
||||
|
||||
-- Alias for `asm.registerEggRecipe`.
|
||||
asm.addEggRecipe = asm.registerEggRecipe
|
||||
|
||||
|
||||
--- Registers new egg in game.
|
||||
--
|
||||
-- Alias: *asm.addEgg*
|
||||
--
|
||||
-- @function asm.registerEgg
|
||||
-- @param def `EggDef` table.
|
||||
asm.registerEgg = function(def)
|
||||
@ -82,16 +89,14 @@ asm.registerEgg = function(def)
|
||||
})
|
||||
|
||||
if def.ingredients then
|
||||
asm.addEggRecipe(def.name:lower(), def.ingredients)
|
||||
asm.registerEggRecipe(def.name:lower(), def.ingredients)
|
||||
end
|
||||
|
||||
-- DEBUG
|
||||
asm.log("action", "Registered spawnegg for " .. def.spawn)
|
||||
end
|
||||
|
||||
--- Alias for `asm.registerEgg`.
|
||||
--
|
||||
-- @function asm.addEgg
|
||||
-- Alias for `asm.registerEgg`.
|
||||
asm.addEgg = asm.registerEgg
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user