diff --git a/init.lua b/init.lua index 1b85682..bafa93d 100644 --- a/init.lua +++ b/init.lua @@ -360,29 +360,16 @@ end core.register_entity(sneeker.mob_name, def) -if core.global_exists("spawneggs") then - core.register_craftitem(sneeker.spawnegg_name, { - description = "Sneeker Spawn Egg", +if core.global_exists("asm") then + asm.addEgg({ + name = "sneeker", inventory_image = "sneeker_spawnegg.png", - stack_max = 64, - on_place = function(itemstack,placer,pointed_thing) - if pointed_thing.type == "node" then - local pos = pointed_thing.above - pos.y = pos.y+1 - core.add_entity(pos, sneeker.mob_name) - if not core.settings:get_bool("creative_mode", false) then - itemstack:take_item() - end - return itemstack - end - end + spawn = "sneeker:sneeker", }) - core.register_craft({ - output = sneeker.spawnegg_name, - type = "shapeless", - recipe = {"spawneggs:egg", "tnt:tnt",}, - }) + core.register_alias(sneeker.spawnegg_name, "spawneggs:sneeker") - core.register_alias("spawneggs:sneeker", sneeker.spawnegg_name) + if core.registered_items["tnt:tnt"] then + asm.addEggRecipe("sneeker", "tnt:tnt") + end end diff --git a/mod.conf b/mod.conf index a699eb8..d830e51 100644 --- a/mod.conf +++ b/mod.conf @@ -3,4 +3,4 @@ title = Sneeker description = An explosive nuisance. author = Rui depends = default, tnt -optional_depends = spawneggs, nether +optional_depends = asm_spawneggs, nether