Update asm_spawneggs mod to Git commit 5a72143...

https://github.com/AntumMT/mod-asm_spawneggs/tree/5a72143
master
Jordan Irwin 2021-05-24 23:57:49 -07:00
parent 0f94546cef
commit b6aa42ff07
3 changed files with 24 additions and 3 deletions

View File

@ -76,7 +76,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* [unifieddyes][] ([GPL][lic.gpl2.0]) -- version: [2021-03-26-1][ver.unifieddyes] ([patched][patch.unifieddyes])
* misc/
* [ambience][] ([MIT][lic.ambience] / [CC BY / CC BY-SA / CC BY-NC-SA / CC0][lic.ambience_sounds]) -- version: [e317f72 Git][ver.ambience] *2021-04-14*
* [asm_spawneggs][] ([MIT][lic.asm_spawneggs]) -- version: [8579eac Git][ver.asm_spawneggs] *2021-05-05*
* [asm_spawneggs][] ([MIT][lic.asm_spawneggs]) -- version: [5a72143 Git][ver.asm_spawneggs] *2021-05-24*
* [awards][] ([MIT][lic.awards]) -- version: [3.4.0][ver.awards] *2021-01-10*
* [biofuel][] ([MIT](lic.biofuel)) -- version: [ca480ce Git][ver.biofuel] *2020-07-20*
* [campfire][] ([GPL][lic.gpl2.0] / [CC BY-SA][lic.ccbysa] / [WTFPL][lic.campfire]) -- version: [1058f1d Git][ver.campfire] *2019-11-28*
@ -611,7 +611,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.sneeker]: https://github.com/AntumMT/mod-sneeker/releases/tag/v1.0
[ver.snowdrift]: https://github.com/paramat/snowdrift/tree/3342939
[ver.stone_monster]: https://github.com/AntumMT/mod-mob_stone_monster/tree/fa52f6f
[ver.asm_spawneggs]: https://github.com/AntumMT/mod-asm_spawneggs/tree/8579eac
[ver.asm_spawneggs]: https://github.com/AntumMT/mod-asm_spawneggs/tree/5a72143
[ver.spectator_mode]: https://github.com/minetest-mods/spectator_mode/tree/3648371
[ver.technic]: https://github.com/minetest-mods/technic/tree/1c21948
[ver.throwing]: https://github.com/PilzAdam/throwing/tree/90bcf43

View File

@ -1,4 +1,8 @@
1.2
- Added method to retrieve registered egg by entity name.
1.1
- Egg names are titleized & underscores are replaced with space.

View File

@ -29,6 +29,18 @@
-- @module api.lua
local registered_eggs = {}
--- Retrieves egg that spawns specified entity.
--
-- @function asm.getEgg
-- @tparam string entity Entity name spawned by egg.
-- @treturn string Egg name or `nil`.
function asm.getEgg(entity)
return registered_eggs[entity]
end
--- Adds a craft recipe for an egg.
--
-- Alias: *asm.addEggRecipe*
@ -83,7 +95,9 @@ asm.registerEgg = function(def)
title = formatTitle(def.name)
end
core.register_craftitem(":spawneggs:" .. def.name:lower(), {
local egg_name = "spawneggs:" .. def.name:lower()
core.register_craftitem(":" .. egg_name, {
description = title,
inventory_image = img,
@ -106,6 +120,9 @@ asm.registerEgg = function(def)
end
})
-- store registration
registered_eggs[def.spawn] = egg_name
if def.ingredients then
asm.registerEggRecipe(def.name:lower(), def.ingredients)
end