1
0
mirror of https://github.com/D00Med/scifi_nodes.git synced 2024-12-22 16:10:18 +01:00

various cleanups

This commit is contained in:
BuckarooBanzay 2024-09-26 19:48:32 +02:00
parent 08c83f52ce
commit fbd56e67c9
6 changed files with 10 additions and 13 deletions

View File

@ -1,7 +1,6 @@
std = "min+minetest" std = "min+minetest"
unused_args = false unused_args = false
max_line_length = 180
globals = { globals = {
"scifi_nodes" "scifi_nodes"

View File

@ -14,7 +14,7 @@ local chest_formspec =
-- Helper functions -- Helper functions
local function drop_chest_stuff() local function drop_chest_stuff()
return function(pos, oldnode, oldmetadata, digger) return function(pos, _, oldmetadata)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:from_table(oldmetadata) meta:from_table(oldmetadata)
local inv = meta:get_inventory() local inv = meta:get_inventory()

View File

@ -1,7 +1,5 @@
function scifi_nodes.get_switch_rules(param2)
scifi_nodes.get_switch_rules = function(param2)
-- param2 = 2 -- param2 = 2
local rules = { local rules = {
{x=1, y=-1, z=-1}, {x=1, y=-1, z=-1},

View File

@ -11,7 +11,7 @@ local digicode_context = {}
-- after_place_node, use by digicode and palm_scanner -- after_place_node, use by digicode and palm_scanner
-- placer is a player object -- placer is a player object
local function set_owner(pos, placer, itemstack, pointed_thing) local function set_owner(pos, placer)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name()) meta:set_string("owner", placer:get_player_name())
meta:set_string("code", secret_code) meta:set_string("code", secret_code)
@ -48,7 +48,7 @@ local function update_code(pos, code)
meta:set_string("code", code) meta:set_string("code", code)
end end
local function show_digicode_formspec(pos, node, player, itemstack, pointed_thing) local function show_digicode_formspec(pos, _, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
local current_code = meta:get_string("code") local current_code = meta:get_string("code")

View File

@ -120,7 +120,7 @@ for _, current_door in ipairs(doors) do
return itemstack; return itemstack;
end end
local function afterdestruct(pos, oldnode) local function afterdestruct(pos)
minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"}) minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="air"})
end end
@ -173,12 +173,12 @@ for _, current_door in ipairs(doors) do
timer:start(3) timer:start(3)
end end
local function afterplace(pos, placer, itemstack, pointed_thing) local function afterplace(pos)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=opened_top,param2=node.param2}) minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name=opened_top,param2=node.param2})
end end
local function ontimer(pos, elapsed) local function ontimer(pos)
-- play sound -- play sound
minetest.sound_play(sound,{ minetest.sound_play(sound,{
max_hear_distance = 16, max_hear_distance = 16,
@ -218,7 +218,7 @@ for _, current_door in ipairs(doors) do
}, },
} }
local function nodig(pos, digger) local function nodig()
return false return false
end end