From ee0765804c0a21deeb2f33c22ac1a36cb0db5f43 Mon Sep 17 00:00:00 2001 From: ShadowNinja <noreply@gmail.com> Date: Tue, 17 Sep 2013 22:37:56 +0200 Subject: [PATCH] Partial rewrite --- technic/machines/MV/lighting.lua | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/technic/machines/mv/lighting.lua b/technic/machines/MV/lighting.lua similarity index 92% rename from technic/machines/mv/lighting.lua rename to technic/machines/MV/lighting.lua index 546e42c..76fcb20 100644 --- a/technic/machines/mv/lighting.lua +++ b/technic/machines/MV/lighting.lua @@ -6,20 +6,20 @@ -- Boilerplate to support localized strings if intllib mod is installed. local S if (minetest.get_modpath("intllib")) then - dofile(minetest.get_modpath("intllib").."/intllib.lua") - S = intllib.Getter(minetest.get_current_modname()) + dofile(minetest.get_modpath("intllib").."/intllib.lua") + S = intllib.Getter(minetest.get_current_modname()) else - S = function ( s ) return s end + S = function (s) return s end end function technic_homedecor_node_is_owned(pos, placer) local ownername = false - if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod - if HasOwner(pos, placer) then -- returns true if the node is owned + if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod + if HasOwner(pos, placer) then if not IsPlayerNodeOwner(pos, placer:get_player_name()) then - if type(getLastOwner) == "function" then -- ...is an old version + if type(getLastOwner) == "function" then -- ...is an old version ownername = getLastOwner(pos) - elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version + elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version ownername = GetNodeOwnerName(pos) else ownername = S("someone") @@ -27,38 +27,38 @@ end end - elseif type(isprotect)=="function" then -- glomie's protection mod + elseif type(isprotect) == "function" then -- glomie's protection mod if not isprotect(5, pos, placer) then ownername = S("someone") end - elseif type(protector)=="table" and type(protector.can_dig)=="function" then -- Zeg9's protection mod + elseif type(protector) == "table" and type(protector.can_dig) == "function" then -- Zeg9's protection mod if not protector.can_dig(5, pos, placer) then ownername = S("someone") end end if ownername ~= false then - minetest.chat_send_player( placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername) ) + minetest.chat_send_player(placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername) ) return true else return false end end -local dirs1 = { 20, 23, 22, 21 } -local dirs2 = { 9, 18, 7, 12 } +local dirs1 = {20, 23, 22, 21} +local dirs2 = {9, 18, 7, 12} local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing) if not technic_homedecor_node_is_owned(pointed_thing.under, placer) and not technic_homedecor_node_is_owned(pointed_thing.above, placer) then - local node = minetest.env:get_node(pointed_thing.under) + local node = minetest.get_node(pointed_thing.under) if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then local above = pointed_thing.above local under = pointed_thing.under local pitch = placer:get_look_pitch() - local pname = minetest.env:get_node(under).name - local node = minetest.env:get_node(above) + local pname = minetest.get_node(under).name + local node = minetest.get_node(above) local fdir = minetest.dir_to_facedir(placer:get_look_dir()) local wield_name = itemstack:get_name() @@ -74,14 +74,14 @@ iswall = false end - if not minetest.registered_nodes[minetest.env:get_node(pos1).name]["buildable_to"] then return end + if not minetest.registered_nodes[minetest.get_node(pos1).name]["buildable_to"] then return end if iswall then - minetest.env:add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant + minetest.add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant elseif isceiling then - minetest.env:add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant + minetest.add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant else - minetest.env:add_node(pos1, {name = wield_name, param2 = 0 }) -- place right side up + minetest.add_node(pos1, {name = wield_name, param2 = 0 }) -- place right side up end if not homedecor_expect_infinite_stacks then -- Gitblit v1.8.0