From 2603c721d207b354e277cedb4c114e9a45be6be1 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Wed, 5 May 2021 18:44:28 -0700 Subject: [PATCH] Use asm_spawneggs to create egg --- init.lua | 29 ++++++++--------------------- mod.conf | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-) 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