[mesecons] Update; fix #446
30
mods/mesecons/COPYING.txt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
The Mesecons Mod for Minetest is
|
||||||
|
Copyright (C) 2011-2016 Mesecons Mod Developer Team and contributors
|
||||||
|
|
||||||
|
See the version control system log for information about other authors.
|
||||||
|
|
||||||
|
License of source code
|
||||||
|
----------------------
|
||||||
|
Copyright (C) 2011-2016 Mesecons Mod Developer Team and contributors
|
||||||
|
|
||||||
|
This program is free software; you can redistribute the Mesecons Mod and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public License version 3
|
||||||
|
published by the Free Software Foundation.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the
|
||||||
|
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
License of media (textures, sounds and documentation)
|
||||||
|
-----------------------------------------------------
|
||||||
|
Copyright (C) 2011-2016 Mesecons Mod Developer Team and contributors
|
||||||
|
|
||||||
|
All textures, sounds and documentation files are licensed under the
|
||||||
|
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||||
|
http://creativecommons.org/licenses/by-sa/3.0/
|
BIN
mods/mesecons/mesecons/doc/mesecon/preview.png
Normal file → Executable file
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
mods/mesecons/mesecons_blinkyplant/doc/blinkyplant/preview.png
Normal file → Executable file
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 36 KiB |
@ -43,9 +43,9 @@ minetest.register_chatcommand("hp", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
local function initialize_data(meta)
|
local function initialize_data(meta)
|
||||||
local commands = meta:get_string("commands")
|
local commands = minetest.formspec_escape(meta:get_string("commands"))
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[9,5;]" ..
|
"invsize[9,5;]" ..
|
||||||
"textarea[0.5,0.5;8.5,4;commands;Commands;"..commands.."]" ..
|
"textarea[0.5,0.5;8.5,4;commands;Commands;"..commands.."]" ..
|
||||||
"label[1,3.8;@nearest, @farthest, and @random are replaced by the respective player names]" ..
|
"label[1,3.8;@nearest, @farthest, and @random are replaced by the respective player names]" ..
|
||||||
"button_exit[3.3,4.5;2,1;submit;Submit]")
|
"button_exit[3.3,4.5;2,1;submit;Submit]")
|
||||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 9.6 KiB |
@ -13,8 +13,8 @@ local object_detector_make_formspec = function (pos)
|
|||||||
"button_exit[7,0.75;2,3;;Save]")
|
"button_exit[7,0.75;2,3;;Save]")
|
||||||
end
|
end
|
||||||
|
|
||||||
local object_detector_on_receive_fields = function(pos, formname, fields)
|
local function object_detector_on_receive_fields(pos, _, fields)
|
||||||
if not fields.scanname or not fields.digiline_channel then return end;
|
if not fields.scanname or not fields.digiline_channel then return end
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("scanname", fields.scanname)
|
meta:set_string("scanname", fields.scanname)
|
||||||
@ -23,7 +23,7 @@ local object_detector_on_receive_fields = function(pos, formname, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- returns true if player was found, false if not
|
-- returns true if player was found, false if not
|
||||||
local object_detector_scan = function (pos)
|
local function object_detector_scan(pos)
|
||||||
local objs = minetest.get_objects_inside_radius(pos, mesecon.setting("detector_radius", 6))
|
local objs = minetest.get_objects_inside_radius(pos, mesecon.setting("detector_radius", 6))
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
local isname = obj:get_player_name() -- "" is returned if it is not a player; "" ~= nil!
|
local isname = obj:get_player_name() -- "" is returned if it is not a player; "" ~= nil!
|
||||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.0 KiB |
@ -16,15 +16,21 @@ minetest.override_item("default:mese", {
|
|||||||
}}
|
}}
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_extrawires:mese_powered", {
|
-- Copy node definition of powered mese from normal mese
|
||||||
tiles = {minetest.registered_nodes["default:mese"].tiles[1].."^[brighten"},
|
-- and brighten texture tiles to indicate mese is powered
|
||||||
is_ground_content = true,
|
local powered_def = mesecon.mergetable(minetest.registered_nodes["default:mese"], {
|
||||||
groups = {cracky=1, not_in_creative_inventory = 1},
|
drop = "default:mese",
|
||||||
sounds = default.node_sound_stone_defaults(),
|
light_source = 5,
|
||||||
mesecons = {conductor = {
|
mesecons = {conductor = {
|
||||||
state = mesecon.state.on,
|
state = mesecon.state.on,
|
||||||
offstate = "default:mese",
|
offstate = "default:mese",
|
||||||
rules = mesewire_rules
|
rules = mesewire_rules
|
||||||
}},
|
}},
|
||||||
drop = "default:mese"
|
groups = {cracky = 1, not_in_creative_inventory = 1}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for i, v in pairs(powered_def.tiles) do
|
||||||
|
powered_def.tiles[i] = v .. "^[brighten"
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("mesecons_extrawires:mese_powered", powered_def)
|
||||||
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.4 KiB |
@ -229,23 +229,35 @@ end
|
|||||||
|
|
||||||
local function remove_functions(x)
|
local function remove_functions(x)
|
||||||
local tp = type(x)
|
local tp = type(x)
|
||||||
if tp == "table" then
|
if tp == "function" then
|
||||||
for key, value in pairs(x) do
|
|
||||||
local key_t, val_t = type(key), type(value)
|
|
||||||
if key_t == "function" or val_t == "function" then
|
|
||||||
x[key] = nil
|
|
||||||
else
|
|
||||||
if key_t == "table" then
|
|
||||||
remove_functions(key)
|
|
||||||
end
|
|
||||||
if val_t == "table" then
|
|
||||||
remove_functions(value)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif tp == "function" then
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Make sure to not serialize the same table multiple times, otherwise
|
||||||
|
-- writing mem.test = mem in the LuaController will lead to infinite recursion
|
||||||
|
local seen = {}
|
||||||
|
|
||||||
|
local function rfuncs(x)
|
||||||
|
if seen[x] then return end
|
||||||
|
seen[x] = true
|
||||||
|
if type(x) ~= "table" then return end
|
||||||
|
|
||||||
|
for key, value in pairs(x) do
|
||||||
|
if type(key) == "function" or type(value) == "function" then
|
||||||
|
x[key] = nil
|
||||||
|
else
|
||||||
|
if type(key) == "table" then
|
||||||
|
rfuncs(key)
|
||||||
|
end
|
||||||
|
if type(value) == "table" then
|
||||||
|
rfuncs(value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
rfuncs(x)
|
||||||
|
|
||||||
return x
|
return x
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 99 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 7.1 KiB |