diff --git a/.luacheckrc b/.luacheckrc index 34d309a..fe7b4be 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -10,6 +10,7 @@ read_globals = { "table.indexof", "minetest", "ItemStack", + "beacon", "christmas", "digilines", "drawers", diff --git a/init.lua b/init.lua index 5d6a01b..d2d4ac3 100644 --- a/init.lua +++ b/init.lua @@ -24,6 +24,7 @@ dofile(modpath.."/legacy.lua") local mods = { "3d_armor_stand", "basic_signs", + "beacon", "bees", "biofuel", "bones", diff --git a/mod.conf b/mod.conf index 9057ba0..d7ed8f8 100644 --- a/mod.conf +++ b/mod.conf @@ -3,6 +3,7 @@ description = Adds a wrench to pick up nodes with inventories, such as chests, a optional_depends = """ 3d_armor_stand, basic_signs, + beacon, bees, biofuel, bones, diff --git a/nodes/beacon.lua b/nodes/beacon.lua new file mode 100644 index 0000000..d68a2ca --- /dev/null +++ b/nodes/beacon.lua @@ -0,0 +1,25 @@ + +-- Register wrench support for the beacon mod + +for id in pairs(beacon.colors) do + wrench.register_node("beacon:" .. id, { + lists = { "beacon_upgrades" }, + metas = { + active = wrench.META_TYPE_STRING, + beam_dir = wrench.META_TYPE_STRING, + channel = wrench.META_TYPE_STRING, + effect = wrench.META_TYPE_STRING, + formspec = wrench.META_TYPE_IGNORE, + owner = wrench.META_TYPE_STRING, + range = wrench.META_TYPE_INT, + }, + timer = true, + after_place = function(pos, player) + beacon.update_formspec(pos) + if core.get_meta(pos):get_string("active") == "true" then + beacon.activate(pos, player:get_player_name()) + end + end, + }) +end +