mirror of
				https://github.com/D00Med/scifi_nodes.git
				synced 2025-11-03 23:45:25 +01:00 
			
		
		
		
	various cleanups
This commit is contained in:
		@@ -1,7 +1,6 @@
 | 
			
		||||
std = "min+minetest"
 | 
			
		||||
 | 
			
		||||
unused_args = false
 | 
			
		||||
max_line_length = 180
 | 
			
		||||
 | 
			
		||||
globals = {
 | 
			
		||||
	"scifi_nodes"
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ local chest_formspec =
 | 
			
		||||
 | 
			
		||||
-- Helper functions
 | 
			
		||||
local function drop_chest_stuff()
 | 
			
		||||
	return function(pos, oldnode, oldmetadata, digger)
 | 
			
		||||
	return function(pos, _, oldmetadata)
 | 
			
		||||
		local meta = minetest.get_meta(pos)
 | 
			
		||||
		meta:from_table(oldmetadata)
 | 
			
		||||
		local inv = meta:get_inventory()
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,5 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
scifi_nodes.get_switch_rules = function(param2)
 | 
			
		||||
 | 
			
		||||
function scifi_nodes.get_switch_rules(param2)
 | 
			
		||||
	-- param2 = 2
 | 
			
		||||
	local rules = {
 | 
			
		||||
		{x=1, y=-1, z=-1},
 | 
			
		||||
@@ -10,7 +8,7 @@ scifi_nodes.get_switch_rules = function(param2)
 | 
			
		||||
		{x=0, y=-1, z=1},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
-- Left and right when looking to +y ?
 | 
			
		||||
	-- Left and right when looking to +y ?
 | 
			
		||||
	if param2 == 3 then
 | 
			
		||||
		rules = mesecon.rotate_rules_right(mesecon.rotate_rules_right (rules))
 | 
			
		||||
	elseif param2 == 4 then
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ local digicode_context = {}
 | 
			
		||||
 | 
			
		||||
-- after_place_node, use by digicode and palm_scanner
 | 
			
		||||
-- 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)
 | 
			
		||||
	meta:set_string("owner", placer:get_player_name())
 | 
			
		||||
	meta:set_string("code", secret_code)
 | 
			
		||||
@@ -48,7 +48,7 @@ local function update_code(pos, code)
 | 
			
		||||
	meta:set_string("code", code)
 | 
			
		||||
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 owner = meta:get_string("owner")
 | 
			
		||||
	local current_code = meta:get_string("code")
 | 
			
		||||
 
 | 
			
		||||
@@ -120,7 +120,7 @@ for _, current_door in ipairs(doors) do
 | 
			
		||||
		return itemstack;
 | 
			
		||||
	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"})
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
@@ -173,12 +173,12 @@ for _, current_door in ipairs(doors) do
 | 
			
		||||
		timer:start(3)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function afterplace(pos, placer, itemstack, pointed_thing)
 | 
			
		||||
	local function afterplace(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})
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function ontimer(pos, elapsed)
 | 
			
		||||
	local function ontimer(pos)
 | 
			
		||||
		-- play sound
 | 
			
		||||
		minetest.sound_play(sound,{
 | 
			
		||||
			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
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ end
 | 
			
		||||
-- register some blocks in stairsplus if available (part of moreblocks)
 | 
			
		||||
scifi_nodes.register_slope("white2", "Plastic", {"scifi_nodes_white2.png",}, 0, "stone")
 | 
			
		||||
scifi_nodes.register_slope("super_white", "Super Plastic", {"scifi_nodes_super_white.png",}, 11, "stone")
 | 
			
		||||
scifi_nodes.register_slope("ultra_white", "Super Plastic", {"scifi_nodes_ultra_white.png",}, minetest.LIGHT_MAX, "stone")
 | 
			
		||||
scifi_nodes.register_slope("ultra_white", "Super Plastic", {"scifi_nodes_ultra_white.png",},minetest.LIGHT_MAX, "stone")
 | 
			
		||||
scifi_nodes.register_slope("black", "Black", {"scifi_nodes_black.png",}, 0)
 | 
			
		||||
scifi_nodes.register_slope("white", "White", {"scifi_nodes_white.png",}, 0)
 | 
			
		||||
scifi_nodes.register_slope("grey", "Grey", {"scifi_nodes_grey.png",}, 0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user