Skip to content

Commit

Permalink
Add [beacon] support (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Dec 29, 2024
1 parent 88e4d9b commit 0200aaf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ read_globals = {
"table.indexof",
"minetest",
"ItemStack",
"beacon",
"christmas",
"digilines",
"drawers",
Expand Down
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dofile(modpath.."/legacy.lua")
local mods = {
"3d_armor_stand",
"basic_signs",
"beacon",
"bees",
"biofuel",
"bones",
Expand Down
1 change: 1 addition & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 25 additions & 0 deletions nodes/beacon.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0200aaf

Please sign in to comment.