47 Commits

Author SHA1 Message Date
a38f37d1ee Enforce checks for ignore
It is `buildable_to` so the standard check didn’t work
2020-10-23 20:37:40 +03:00
d356f901a3 Make Lua code area and error label use monospaced font (#541) 2020-10-09 22:28:11 +02:00
6921909100 Restrict Lua controller interrupt IDs (#534)
* Deprecate non-string IIDs
* Restrict tabular IIDs to proper trees
Fixes crash on recursive interrupt ID (#473)
2020-09-21 22:32:25 +03:00
3202bf6786 mesecons_doors: Add MTG steel bar door and trapdoor (#523) 2020-09-19 00:27:47 +03:00
fedbf49372 Noteblock: Fade out fire sound (#527) 2020-09-17 19:30:03 +02:00
9fda51b650 Insulated double corner (#524)
* Add insulated double corner
* Make single corner curved to match double corner
* Remove obsolete regular corner textures
2020-08-24 00:30:57 +03:00
4750925eab Allow admins digging any command block (#525)
Allow admins (i.e. players with the `protection_bypass` privilege) digging any command block
2020-08-15 15:33:11 +03:00
16836b16d6 Make more nodes trigger special noteblock sounds (#506) 2020-08-08 12:22:51 +03:00
c1eccba247 Make sounds ephemeral (#521)
The handles were never used anyway
2020-08-01 16:10:14 +03:00
01332a7ba1 Replace deprecated getpos() calls (#522) 2020-07-31 22:26:58 +02:00
de4eeebd3b Movestone servo-motor sound (#487) 2020-07-28 19:55:56 +03:00
75bd1e8be6 Unpad insulated wire recipes (#477) 2020-06-28 01:28:56 +03:00
95e6e2e4a5 Add sound effects to FPGA programmer (#510) 2020-06-27 08:48:24 +02:00
168a923665 Use mod.conf for dependencies (#492) 2020-06-27 02:26:14 +03:00
8dec053996 Solarpanel: cleanup (#504) 2020-06-27 02:06:30 +03:00
e1cffdedbf Gates: Modify appearance (#515) 2020-05-27 23:31:51 +02:00
d3aedd2b98 Speed up search for objects to be moved in MVPS (#512) 2020-04-25 00:33:00 +02:00
DS
68c1729990 Refactor actionqueue.lua (#501)
Reduce actionqueue complexity, thus faster execution
Improve code style
Add documentation/explanations
2020-01-06 21:59:02 +01:00
9b58f8db29 FPGA: Add 'unary' value to talbe. Document 2019-11-10 11:35:02 +01:00
7784b13da5 FPGA: Add NOR operand 2019-11-10 11:35:02 +01:00
0dd530312b FPGA: Remove formspec from metadata 2019-11-10 11:35:02 +01:00
e78bbd6f98 FPGA: Unify actions in single table 2019-11-10 11:35:02 +01:00
bfd952b51a Delayer: Combine shared definitions, add protection (#490) 2019-11-04 20:00:43 +01:00
b7873e8e02 Code tidy: Remove redundant params (#486) 2019-10-05 14:13:59 +02:00
d6b2a39c99 Set mvps_protection_mode default to the documented value (#484, base: #466) 2019-09-24 17:25:07 +03:00
1b54011b68 Use table.copy in mesecons.tablecopy
mesecons.tablecopy didn’t support recursive tables, while Minetest table.copy works well for them.
2019-09-23 19:50:04 +02:00
15e743629e Respect protection in MVPS (#466) 2019-09-20 23:04:52 +00:00
1bf862f932 Use modpack.conf instead of legacy modpack.txt (#475) 2019-08-25 23:36:21 +03:00
1a9704f184 Add digiline commands for operating node detector (#472) 2019-08-21 23:52:33 +03:00
8baa789eb1 Optimize images (#464)
Recompress losslessly using `optipng` and `advpng`
2019-06-27 22:33:11 +03:00
b0158f5674 Too many glasses in noteblock 2019-04-10 23:00:58 +02:00
DS
073c92d487 Revert "Fix sticky pistons (#403)" (#458)
This reverts commit d8f82e6771.
2019-03-17 10:29:04 +01:00
737f366741 LuaC: add lightweight interrupts (#449) 2018-12-29 23:48:32 +03:00
302a28934d Document inactive block behaviour (#447) 2018-12-21 22:10:08 +03:00
6e767a6c76 Make sticky piston stick falling things as well (#436) 2018-12-21 22:02:57 +03:00
9d239cbfff Fix typos (#442) 2018-12-09 16:38:23 +03:00
d3cabedbb0 Prevent long error message from covering the button 2018-12-09 13:59:49 +01:00
df4e880d8b Fix crash in microcontroller (#439)
Add check nil var with bug from crash server.
fixes #438
2018-11-06 09:48:44 +01:00
45bbd9f7e3 Don’t damage unloaded blocks (#435) 2018-10-29 23:58:07 +03:00
028c290cd7 Mark 'code' as private as well
Saves on bandwidth, however the code is still accessible via the formspec.
2018-09-18 13:01:18 +02:00
8808bb8911 Mark LuaController memory as private
If LuaControllers handle sensitive information, hacked clients could get this information from the LuaController. Marking the memory as private fixes this and saves a small amount of bandwidth.
2018-09-18 13:01:18 +02:00
fa040eb085 Fix vertical movestone textures (#430) 2018-09-09 00:35:15 +03:00
a4f5ae5b89 Remove tiny (+0.001) selection box oversize 2018-09-07 17:31:49 +02:00
9e6eac4285 Make insulated wires’ selection box fit in the node 2018-09-07 17:31:49 +02:00
c73b451f9b Update wiki links (#432)
wiki.minetest.net is the official Minetest wiki
2018-08-29 00:45:46 +03:00
DS
9ff2329253 Noteblock: use new fire sounds (#385) 2018-08-26 23:13:47 +03:00
444cd0f2f1 Replace usage of default.LIGHT_MAX with minetest.LIGHT_MAX
It was moved a long time ago and the former is not guaranteed to be available.
fixes #424
2018-07-24 21:30:04 +02:00
405 changed files with 1290 additions and 540 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
*~
*.patch
*.diff

View File

@ -24,7 +24,7 @@ Go get it!
[DOWNLOAD IT NOW](https://github.com/minetest-mods/mesecons/archive/master.zip)
Now go ahead and install it like any other Minetest mod. Don't know how? Check out [the wonderful page about it](http://wiki.minetest.com/wiki/Mods) over at the Minetest Wiki. For your convenience, here's a quick summary:
Now go ahead and install it like any other Minetest mod. Don't know how? Check out [the wonderful page about it](https://wiki.minetest.net/Mods) over at the official Minetest Wiki. For your convenience, here's a quick summary:
1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
2. Make sure that when you open the folder, you can directly find `README.md` in the listing. If you just see another folder, move that folder up one level and delete the old one.
@ -43,6 +43,8 @@ Or maybe a [comprehensive reference](http://mesecons.net/items.html) is your sty
An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
There is also a [wiki page](https://wiki.minetest.net/Mods/Mesecons) dedicated to this mod.
Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
Want to contribute to Mesecons itself? Check out the [source code](https://github.com/minetest-mods/mesecons)!

View File

@ -1,96 +1,140 @@
mesecon.queue.actions={} -- contains all ActionQueue actions
--[[
Mesecons uses something it calls an ActionQueue.
function mesecon.queue:add_function(name, func)
mesecon.queue.funcs[name] = func
The ActionQueue holds functions and actions.
Functions are added on load time with a specified name.
Actions are preserved over server restarts.
Each action consists of a position, the name of an added function to be called,
the params that should be used in this function call (additionally to the pos),
the time after which it should be executed, an optional overwritecheck and a
priority.
If time = 0, the action will be executed in the next globalstep, otherwise the
earliest globalstep when it will be executed is the after next globalstep.
It is guaranteed, that for two actions ac1, ac2 where ac1 ~= ac2,
ac1.time == ac2.time, ac1.priority == ac2.priority and ac1 was added earlier
than ac2, ac1 will be executed before ac2 (but in the same globalstep).
Note: Do not pass references in params, as they can not be preserved.
Also note: Some of the guarantees here might be dropped at some time.
]]
-- localize for speed
local queue = mesecon.queue
queue.actions = {} -- contains all ActionQueue actions
function queue:add_function(name, func)
queue.funcs[name] = func
end
-- If add_action with twice the same overwritecheck and same position are called, the first one is overwritten
-- use overwritecheck nil to never overwrite, but just add the event to the queue
-- priority specifies the order actions are executed within one globalstep, highest first
-- should be between 0 and 1
function mesecon.queue:add_action(pos, func, params, time, overwritecheck, priority)
function queue:add_action(pos, func, params, time, overwritecheck, priority)
-- Create Action Table:
time = time or 0 -- time <= 0 --> execute, time > 0 --> wait time until execution
priority = priority or 1
local action = { pos=mesecon.tablecopy(pos),
func=func,
params=mesecon.tablecopy(params or {}),
time=time,
owcheck=(overwritecheck and mesecon.tablecopy(overwritecheck)) or nil,
priority=priority}
local action = {
pos = mesecon.tablecopy(pos),
func = func,
params = mesecon.tablecopy(params or {}),
time = time,
owcheck = (overwritecheck and mesecon.tablecopy(overwritecheck)) or nil,
priority = priority
}
local toremove = nil
-- Otherwise, add the action to the queue
if overwritecheck then -- check if old action has to be overwritten / removed:
for i, ac in ipairs(mesecon.queue.actions) do
if(vector.equals(pos, ac.pos)
and mesecon.cmpAny(overwritecheck, ac.owcheck)) then
toremove = i
-- check if old action has to be overwritten / removed:
if overwritecheck then
for i, ac in ipairs(queue.actions) do
if vector.equals(pos, ac.pos)
and mesecon.cmpAny(overwritecheck, ac.owcheck) then
-- remove the old action
table.remove(queue.actions, i)
break
end
end
end
if (toremove ~= nil) then
table.remove(mesecon.queue.actions, toremove)
end
table.insert(mesecon.queue.actions, action)
table.insert(queue.actions, action)
end
-- execute the stored functions on a globalstep
-- if however, the pos of a function is not loaded (get_node_or_nil == nil), do NOT execute the function
-- this makes sure that resuming mesecons circuits when restarting minetest works fine
-- this makes sure that resuming mesecons circuits when restarting minetest works fine (hm, where do we do this?)
-- However, even that does not work in some cases, that's why we delay the time the globalsteps
-- start to be execute by 5 seconds
local get_highest_priority = function (actions)
local highestp = -1
local highesti
for i, ac in ipairs(actions) do
if ac.priority > highestp then
highestp = ac.priority
highesti = i
end
end
-- start to be execute by 4 seconds
return highesti
end
local function globalstep_func(dtime)
local actions = queue.actions
-- split into two categories:
-- actions_now: actions to execute now
-- queue.actions: actions to execute later
local actions_now = {}
queue.actions = {}
local m_time = 0
local resumetime = mesecon.setting("resumetime", 4)
minetest.register_globalstep(function (dtime)
m_time = m_time + dtime
-- don't even try if server has not been running for XY seconds; resumetime = time to wait
-- after starting the server before processing the ActionQueue, don't set this too low
if (m_time < resumetime) then return end
local actions = mesecon.tablecopy(mesecon.queue.actions)
local actions_now={}
mesecon.queue.actions = {}
-- sort actions into two categories:
-- those toexecute now (actions_now) and those to execute later (mesecon.queue.actions)
for i, ac in ipairs(actions) do
for _, ac in ipairs(actions) do
if ac.time > 0 then
ac.time = ac.time - dtime -- executed later
table.insert(mesecon.queue.actions, ac)
-- action ac is to be executed later
-- ~> insert into queue.actions
ac.time = ac.time - dtime
table.insert(queue.actions, ac)
else
-- action ac is to be executed now
-- ~> insert into actions_now
table.insert(actions_now, ac)
end
end
while(#actions_now > 0) do -- execute highest priorities first, until all are executed
local hp = get_highest_priority(actions_now)
mesecon.queue:execute(actions_now[hp])
table.remove(actions_now, hp)
-- stable-sort the executed actions after their priority
-- some constructions might depend on the execution order, hence we first
-- execute the actions that had a lower index in actions_now
local old_action_order = {}
for i, ac in ipairs(actions_now) do
old_action_order[ac] = i
end
end)
table.sort(actions_now, function(ac1, ac2)
if ac1.priority ~= ac2.priority then
return ac1.priority > ac2.priority
else
return old_action_order[ac1] < old_action_order[ac2]
end
end)
function mesecon.queue:execute(action)
-- execute highest priorities first, until all are executed
for _, ac in ipairs(actions_now) do
queue:execute(ac)
end
end
-- delay the time the globalsteps start to be execute by 4 seconds
do
local m_time = 0
local resumetime = mesecon.setting("resumetime", 4)
local globalstep_func_index = #minetest.registered_globalsteps + 1
minetest.register_globalstep(function(dtime)
m_time = m_time + dtime
-- don't even try if server has not been running for XY seconds; resumetime = time to wait
-- after starting the server before processing the ActionQueue, don't set this too low
if m_time < resumetime then
return
end
-- replace this globalstep function
minetest.registered_globalsteps[globalstep_func_index] = globalstep_func
end)
end
function queue:execute(action)
-- ignore if action queue function name doesn't exist,
-- (e.g. in case the action queue savegame was written by an old mesecons version)
if mesecon.queue.funcs[action.func] then
mesecon.queue.funcs[action.func](action.pos, unpack(action.params))
if queue.funcs[action.func] then
queue.funcs[action.func](action.pos, unpack(action.params))
end
end
@ -98,8 +142,8 @@ end
-- Store and read the ActionQueue to / from a file
-- so that upcoming actions are remembered when the game
-- is restarted
mesecon.queue.actions = mesecon.file2table("mesecon_actionqueue")
queue.actions = mesecon.file2table("mesecon_actionqueue")
minetest.register_on_shutdown(function()
mesecon.table2file("mesecon_actionqueue", mesecon.queue.actions)
mesecon.table2file("mesecon_actionqueue", queue.actions)
end)

View File

@ -1 +0,0 @@
default

2
mesecons/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = mesecons
depends = default

View File

@ -30,7 +30,7 @@ minetest.register_node("mesecons:mesecon_on", {
},
groups = {dig_immediate=3, not_in_creaive_inventory=1, mesecon=1},
drop = "mesecons:mesecon_off 1",
light_source = default.LIGHT_MAX-11,
light_source = minetest.LIGHT_MAX-11,
mesecons = {conductor={
state = mesecon.state.on,
offstate = "mesecons:mesecon_off"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 362 B

View File

@ -186,29 +186,30 @@ function mesecon.invertRule(r)
return vector.multiply(r, -1)
end
function mesecon.tablecopy(table) -- deep table copy
if type(table) ~= "table" then return table end -- no need to copy
local newtable = {}
for idx, item in pairs(table) do
if type(item) == "table" then
newtable[idx] = mesecon.tablecopy(item)
else
newtable[idx] = item
function mesecon.tablecopy(obj) -- deep copy
if type(obj) == "table" then
return table.copy(obj)
end
end
return newtable
return obj
end
-- Returns whether two values are equal.
-- In tables, keys are compared for identity but values are compared recursively.
-- There is no protection from infinite recursion.
function mesecon.cmpAny(t1, t2)
if type(t1) ~= type(t2) then return false end
if type(t1) ~= "table" and type(t2) ~= "table" then return t1 == t2 end
if type(t1) ~= "table" then return t1 == t2 end
-- Check that for each key of `t1` both tables have the same value
for i, e in pairs(t1) do
if not mesecon.cmpAny(e, t2[i]) then return false end
end
-- Check that all keys of `t2` are also keys of `t1` so were checked in the previous loop
for i, _ in pairs(t2) do
if t1[i] == nil then return false end
end
return true
end

View File

@ -1 +0,0 @@
mesecons

2
mesecons_alias/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = mesecons_alias
depends = mesecons

View File

@ -1 +0,0 @@
mesecons

View File

@ -1 +1,2 @@
The blinky plants toggles between on and off state every three seconds. Can be used to make clocks. Also works after having restarted the game.
It stops blinking in an inactive block, then starts again when the block becomes active.

BIN
mesecons_blinkyplant/doc/blinkyplant/preview.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,2 @@
name = mesecons_blinkyplant
depends = mesecons

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 394 B

View File

@ -1,2 +0,0 @@
mesecons
mesecons_receiver

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -8,7 +8,7 @@ mesecon.button_turnoff = function (pos)
return
end
minetest.swap_node(pos, {name = "mesecons_button:button_off", param2 = node.param2})
minetest.sound_play("mesecons_button_pop", {pos = pos})
minetest.sound_play("mesecons_button_pop", { pos = pos }, true)
local rules = mesecon.rules.buttonlike_get(node)
mesecon.receptor_off(pos, rules)
end
@ -46,7 +46,7 @@ minetest.register_node("mesecons_button:button_off", {
on_rightclick = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_button:button_on", param2=node.param2})
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
minetest.sound_play("mesecons_button_push", {pos=pos})
minetest.sound_play("mesecons_button_push", { pos = pos }, true)
minetest.get_node_timer(pos):start(1)
end,
sounds = default.node_sound_stone_defaults(),
@ -73,7 +73,7 @@ minetest.register_node("mesecons_button:button_on", {
legacy_wallmounted = true,
walkable = false,
on_rotate = false,
light_source = default.LIGHT_MAX-7,
light_source = minetest.LIGHT_MAX-7,
sunlight_propagates = true,
selection_box = {
type = "fixed",

2
mesecons_button/mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = mesecons_button
depends = mesecons, mesecons_receiver

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 220 B

View File

@ -1 +0,0 @@
mesecons

View File

@ -1 +1,2 @@
There is no crafting recipe as this should only be available for server admins. Quite similar to the Minecraft counterpart. Executes server commands.
It works in inactive blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -110,7 +110,7 @@ local function resolve_commands(commands, pos)
local nearest, farthest = nil, nil
local min_distance, max_distance = math.huge, -1
for index, player in pairs(players) do
local distance = vector.distance(pos, player:getpos())
local distance = vector.distance(pos, player:get_pos())
if distance < min_distance then
min_distance = distance
nearest = player:get_player_name()
@ -174,7 +174,8 @@ end
local function can_dig(pos, player)
local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner")
return owner == "" or owner == player:get_player_name()
return owner == "" or owner == player:get_player_name() or
minetest.check_player_privs(player, "protection_bypass")
end
minetest.register_node("mesecons_commandblock:commandblock_off", {

View File

@ -0,0 +1,2 @@
name = mesecons_commandblock
depends = mesecons

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

After

Width:  |  Height:  |  Size: 183 B

View File

@ -1 +0,0 @@
mesecons

View File

@ -1 +1 @@
The delayer delays the signal from the input for a determined time. The time can be set by punching the delayer. Possible delays are: 0.1 seconds, 0.3 seconds, 0.5 seconds and 1 second. You may try to use it for creating songs with the noteblock.
The delayer delays the signal from the input for a determined time. The time can be set by punching the delayer. Possible delays are: 0.1 seconds, 0.3 seconds, 0.5 seconds and 1 second. You may try to use it for creating songs with the noteblock. It works in unloaded blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -33,19 +33,9 @@ end
-- Register the 2 (states) x 4 (delay times) delayers
for i = 1, 4 do
local groups = {}
if i == 1 then
groups = {bendy=2,snappy=1,dig_immediate=2}
else
groups = {bendy=2,snappy=1,dig_immediate=2, not_in_creative_inventory=1}
end
local delaytime = { 0.1, 0.3, 0.5, 1.0 }
local delaytime
if i == 1 then delaytime = 0.1
elseif i == 2 then delaytime = 0.3
elseif i == 3 then delaytime = 0.5
elseif i == 4 then delaytime = 1.0 end
for i = 1, 4 do
local boxes = {
{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
@ -61,9 +51,36 @@ local boxes = {
{ 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }
}
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
description = "Delayer",
-- Delayer definition defaults
local def = {
drawtype = "nodebox",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
},
node_box = {
type = "fixed",
fixed = boxes
},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
delayer_time = delaytime[i],
sounds = default.node_sound_stone_defaults(),
on_blast = mesecon.on_blastnode,
drop = "mesecons_delayer:delayer_off_1",
}
-- Deactivated delayer definition defaults
local off_groups = {bendy=2,snappy=1,dig_immediate=2}
if i > 1 then
off_groups.not_in_creative_inventory = 1
end
local off_state = {
description = "Delayer",
tiles = {
"mesecons_delayer_off_"..tostring(i)..".png",
"mesecons_delayer_bottom.png",
@ -74,35 +91,18 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
},
inventory_image = "mesecons_delayer_off_1.png",
wield_image = "mesecons_delayer_off_1.png",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
},
node_box = {
type = "fixed",
fixed = boxes
},
groups = groups,
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
drop = 'mesecons_delayer:delayer_off_1',
on_punch = function (pos, node)
if node.name=="mesecons_delayer:delayer_off_1" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_2", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_off_2" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_3", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_off_3" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_4", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_off_4" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_off_1", param2=node.param2})
groups = off_groups,
on_punch = function(pos, node, puncher)
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
return
end
minetest.swap_node(pos, {
name = "mesecons_delayer:delayer_off_"..tostring(i % 4 + 1),
param2 = node.param2
})
end,
delayer_time = delaytime,
delayer_onstate = "mesecons_delayer:delayer_on_"..tostring(i),
sounds = default.node_sound_stone_defaults(),
mesecons = {
receptor =
{
@ -115,13 +115,15 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
action_on = delayer_activate
}
},
on_blast = mesecon.on_blastnode,
})
}
for k, v in pairs(def) do
off_state[k] = off_state[k] or v
end
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), off_state)
minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
-- Activated delayer definition defaults
local on_state = {
description = "You hacker you",
drawtype = "nodebox",
tiles = {
"mesecons_delayer_on_"..tostring(i)..".png",
"mesecons_delayer_bottom.png",
@ -130,35 +132,18 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
"mesecons_delayer_sides_on.png",
"mesecons_delayer_sides_on.png"
},
walkable = true,
selection_box = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
},
node_box = {
type = "fixed",
fixed = boxes
},
groups = {bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
drop = 'mesecons_delayer:delayer_off_1',
on_punch = function (pos, node)
if node.name=="mesecons_delayer:delayer_on_1" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_2", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_on_2" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_3", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_on_3" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_4", param2=node.param2})
elseif node.name=="mesecons_delayer:delayer_on_4" then
minetest.swap_node(pos, {name = "mesecons_delayer:delayer_on_1", param2=node.param2})
on_punch = function(pos, node, puncher)
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
return
end
minetest.swap_node(pos, {
name = "mesecons_delayer:delayer_on_"..tostring(i % 4 + 1),
param2 = node.param2
})
end,
delayer_time = delaytime,
delayer_offstate = "mesecons_delayer:delayer_off_"..tostring(i),
sounds = default.node_sound_stone_defaults(),
mesecons = {
receptor =
{
@ -171,8 +156,12 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
action_off = delayer_deactivate
}
},
on_blast = mesecon.on_blastnode,
})
}
for k, v in pairs(def) do
on_state[k] = on_state[k] or v
end
minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), on_state)
end
minetest.register_craft({

View File

@ -0,0 +1,2 @@
name = mesecons_delayer
depends = mesecons

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 181 B

View File

@ -1,2 +0,0 @@
mesecons
mesecons_materials

View File

@ -1,7 +1,11 @@
The node detector is a receptor. It changes its state when either any node
or a specific node is detected. Right-click it to set a nodename to scan for.
It can also receive digiline signals. You can either send "GET" and it will
respond with the detected nodename or you can send any other string and it will
set this string as the node to scan for.
It can also receive digiline signals. For example, you can send
<code>{distance=4, scanname="default:dirt"}</code>
to set distance to 4 and scan for dirt. You can omit either parameter.
There is also a command parameter: <code>{command="get"}</code> will respond
with the detected nodename and <code>{command="scan"}</code> will respond with
a boolean using the distance and nodename of the detector.
Nodenames must include the mod they reside in, so for instance default:dirt, not just dirt.
The distance parameter specifies how many blocks are between the node detector and the node to detect.
Automatic scanning with Mesecons output only works when the detector is in an active block, but Digilines queries always work.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -2,3 +2,4 @@ The object detector is a receptor. It changes its state when a player approaches
Right-click it to set a name to scan for.
You can also search for comma-separated lists of players where the detector gets activated if any of the names in the list are found.
It can also receive digiline signals which are the name to scan for on the specified channel in the right-click menu.
Automatic scanning with Mesecons output only works when the detector is in an active block, but Digilines queries always work.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -189,36 +189,57 @@ local function node_detector_scan(pos)
(frontname ~= "air" and frontname ~= "ignore" and scanname == "")
end
local function node_detector_send_node_name(pos, node, channel, meta)
local distance = meta:get_int("distance")
local distance_max = mesecon.setting("node_detector_distance_max", 10)
if distance < 0 then distance = 0 end
if distance > distance_max then distance = distance_max end
local nodename = minetest.get_node(
vector.subtract(pos, vector.multiply(minetest.facedir_to_dir(node.param2), distance + 1))
).name
digiline:receptor_send(pos, digiline.rules.default, channel, nodename)
end
-- set player name when receiving a digiline signal on a specific channel
local node_detector_digiline = {
effector = {
action = function(pos, node, channel, msg)
local meta = minetest.get_meta(pos)
local distance = meta:get_int("distance")
local distance_max = mesecon.setting("node_detector_distance_max", 10)
if distance < 0 then distance = 0 end
if distance > distance_max then distance = distance_max end
if channel ~= meta:get_string("digiline_channel") then return end
if type(msg) == "table" then
if msg.distance or msg.scanname then
if msg.distance then
meta:set_string("distance", msg.distance)
end
if msg.scanname then
meta:set_string("scanname", msg.scanname)
end
node_detector_make_formspec(pos)
end
if msg.command == "get" then
node_detector_send_node_name(pos, node, channel, meta)
elseif msg.command == "scan" then
local result = node_detector_scan(pos)
digiline:receptor_send(pos, digiline.rules.default, channel, result)
end
else
if msg == GET_COMMAND then
local nodename = minetest.get_node(
vector.subtract(pos, vector.multiply(minetest.facedir_to_dir(node.param2), distance + 1))
).name
digiline:receptor_send(pos, digiline.rules.default, channel, nodename)
node_detector_send_node_name(pos, node, channel, meta)
else
meta:set_string("scanname", msg)
node_detector_make_formspec(pos)
end
end
end,
},
receptor = {}
}
local function after_place_node_detector(pos, placer)
local placer_pos = placer:getpos()
local placer_pos = placer:get_pos()
if not placer_pos then
return
end

View File

@ -0,0 +1,2 @@
name = mesecons_detector
depends = mesecons, mesecons_materials

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 693 B

View File

@ -1,2 +0,0 @@
mesecons
doors

View File

@ -13,9 +13,9 @@ local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
minetest.swap_node(pos, {name = replace, param2 = p2})
if (minetest.get_meta(pos):get_int("right") ~= 0) == (params[1] ~= 3) then
minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
minetest.sound_play("doors_door_close", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
else
minetest.sound_play("doors_door_open", {pos = pos, gain = 0.3, max_hear_distance = 10})
minetest.sound_play("doors_door_open", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
end
end
@ -73,16 +73,17 @@ meseconify_door("doors:door_wood")
meseconify_door("doors:door_steel")
meseconify_door("doors:door_glass")
meseconify_door("doors:door_obsidian_glass")
meseconify_door("xpanes:door_steel_bar")
-- Trapdoor
local function trapdoor_switch(pos, node)
local state = minetest.get_meta(pos):get_int("state")
if state == 1 then
minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
minetest.sound_play("doors_door_close", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
minetest.set_node(pos, {name="doors:trapdoor", param2 = node.param2})
else
minetest.sound_play("doors_door_open", {pos = pos, gain = 0.3, max_hear_distance = 10})
minetest.sound_play("doors_door_open", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
minetest.set_node(pos, {name="doors:trapdoor_open", param2 = node.param2})
end
@ -110,6 +111,12 @@ if doors and doors.get then
minetest.override_item("doors:trapdoor_open", override)
minetest.override_item("doors:trapdoor_steel", override)
minetest.override_item("doors:trapdoor_steel_open", override)
if minetest.registered_items["xpanes:trapdoor_steel_bar"] then
minetest.override_item("xpanes:trapdoor_steel_bar", override)
minetest.override_item("xpanes:trapdoor_steel_bar_open", override)
end
else
if minetest.registered_nodes["doors:trapdoor"] then
minetest.override_item("doors:trapdoor", {

3
mesecons_doors/mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = mesecons_doors
depends = mesecons, doors
optional_depends = xpanes

View File

@ -1,14 +1,8 @@
local screwdriver_exists = minetest.global_exists("screwdriver")
local corner_nodebox = {
type = "fixed",
fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 },
{ -3/32, -17/32, -16/32+0.001, 3/32, -13/32, 3/32}}
}
local corner_selectionbox = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -16/32, 5/32, -12/32, 5/32 },
fixed = { -16/32, -16/32, -16/32, 5/32, -12/32, 5/32 },
}
local corner_get_rules = function (node)
@ -24,14 +18,11 @@ local corner_get_rules = function (node)
end
minetest.register_node("mesecons_extrawires:corner_on", {
drawtype = "nodebox",
drawtype = "mesh",
mesh = "mesecons_extrawires_corner.obj",
tiles = {
"jeija_insulated_wire_curved_tb_on.png",
"jeija_insulated_wire_curved_tb_on.png^[transformR270",
"jeija_insulated_wire_sides_on.png",
"jeija_insulated_wire_ends_on.png",
"jeija_insulated_wire_sides_on.png",
"jeija_insulated_wire_ends_on.png"
{ name = "jeija_insulated_wire_sides_on.png", backface_culling = true },
{ name = "jeija_insulated_wire_ends_on.png", backface_culling = true },
},
paramtype = "light",
paramtype2 = "facedir",
@ -54,15 +45,12 @@ minetest.register_node("mesecons_extrawires:corner_on", {
})
minetest.register_node("mesecons_extrawires:corner_off", {
drawtype = "nodebox",
drawtype = "mesh",
description = "Insulated Mesecon Corner",
mesh = "mesecons_extrawires_corner.obj",
tiles = {
"jeija_insulated_wire_curved_tb_off.png",
"jeija_insulated_wire_curved_tb_off.png^[transformR270",
"jeija_insulated_wire_sides_off.png",
"jeija_insulated_wire_ends_off.png",
"jeija_insulated_wire_sides_off.png",
"jeija_insulated_wire_ends_off.png"
{ name = "jeija_insulated_wire_sides_off.png", backface_culling = true },
{ name = "jeija_insulated_wire_ends_off.png", backface_culling = true },
},
paramtype = "light",
paramtype2 = "facedir",
@ -86,8 +74,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
minetest.register_craft({
output = "mesecons_extrawires:corner_off 3",
recipe = {
{"", "", ""},
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", ""},
{"", "mesecons_insulated:insulated_off", ""},
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off"},
{"", "mesecons_insulated:insulated_off"},
}
})

View File

@ -32,7 +32,7 @@ minetest.register_node("mesecons_extrawires:crossover_off", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3},
sounds = default.node_sound_defaults(),
mesecons = {
@ -59,7 +59,7 @@ minetest.register_node("mesecons_extrawires:crossover_01", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
@ -86,7 +86,7 @@ minetest.register_node("mesecons_extrawires:crossover_10", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {
@ -113,7 +113,7 @@ minetest.register_node("mesecons_extrawires:crossover_on", {
is_ground_content = false,
walkable = false,
stack_max = 99,
selection_box = {type="fixed", fixed={-16/32-0.0001, -18/32, -16/32-0.001, 16/32+0.001, -5/32, 16/32+0.001}},
selection_box = {type="fixed", fixed={-16/32, -16/32, -16/32, 16/32, -5/32, 16/32}},
groups = {dig_immediate=3, mesecon=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
mesecons = {

View File

@ -1,3 +0,0 @@
default
mesecons
screwdriver?

View File

@ -1 +1 @@
Insulated corners are conductors that only conduct between the inputs (also not up or down). When placing they always point to the left in direction of your vision.
Insulated corners are conductors that only conduct between the inputs (also not up or down). When placing they always point to the left in direction of your vision. Like uninsulated wires, they work through unloaded blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1 +1 @@
Insulated crossing are conductors that conduct two signals between the opposing sides, the signals are insulated to each other.
Insulated crossing are conductors that conduct two signals between the opposing sides, the signals are insulated to each other. Like uninsulated wires, they work through unloaded blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1 +1 @@
The basic prerequesite for mesecons, can be crafted into wires and other stuff. Have a look at the <a href="http://wiki.minetest.net/Mese">Minetest Wiki</a> for more information. Mese is a conductor. It conducts in all six directions: Up/Down/Left/Right/Forward/Backward
The basic prerequesite for mesecons, can be crafted into wires and other stuff. Have a look at the <a href="http://wiki.minetest.net/Mese">Minetest Wiki</a> for more information. Mese is a conductor. It conducts in all six directions: Up/Down/Left/Right/Forward/Backward. Like horizontal wires, Mese conduction works through unloaded blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1 +1 @@
Insulated T-Junctions are conductors that only conduct between the inputs (also not up or down).
Insulated T-Junctions are conductors that only conduct between the inputs (also not up or down). Like uninsulated wires, they work through unloaded blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1 +1 @@
Vertical Mesecons only conduct up and down. Plates appear at the ends, at that place they also conduct to the side.
Vertical Mesecons only conduct up and down. Plates appear at the ends, at that place they also conduct to the side. Like horizontal wires, they work through unloaded blocks.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,91 @@
local rotate
if minetest.global_exists("screwdriver") then rotate = screwdriver.rotate_simple end
local doublecorner_selectionbox = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
}
local rules = {
{
{ x = 1, y = 0, z = 0 },
{ x = 0, y = 0, z = 1 },
},
{
{ x = -1, y = 0, z = 0 },
{ x = 0, y = 0, z = -1 },
},
}
local doublecorner_rules = {}
for k = 1, 4 do
doublecorner_rules[k] = table.copy(rules)
for i, r in ipairs(rules) do
rules[i] = mesecon.rotate_rules_left(r)
end
end
local function doublecorner_get_rules(node)
return doublecorner_rules[node.param2 % 4 + 1]
end
local doublecorner_states = {
"mesecons_extrawires:doublecorner_00",
"mesecons_extrawires:doublecorner_01",
"mesecons_extrawires:doublecorner_10",
"mesecons_extrawires:doublecorner_11",
}
local wire1_states = { "off", "off", "on", "on" }
local wire2_states = { "off", "on", "off", "on" }
for k, state in ipairs(doublecorner_states) do
local w1 = wire1_states[k]
local w2 = wire2_states[k]
local groups = { dig_immediate = 3 }
if k ~= 1 then groups.not_in_creative_inventory = 1 end
minetest.register_node(state, {
drawtype = "mesh",
mesh = "mesecons_extrawires_doublecorner.obj",
description = "Insulated Mesecon Double Corner",
tiles = {
{ name = "jeija_insulated_wire_sides_" .. w1 .. ".png", backface_culling = true },
{ name = "jeija_insulated_wire_ends_" .. w1 .. ".png", backface_culling = true },
{ name = "jeija_insulated_wire_sides_" .. w2 .. ".png", backface_culling = true },
{ name = "jeija_insulated_wire_ends_" .. w2 .. ".png", backface_culling = true },
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
selection_box = doublecorner_selectionbox,
groups = groups,
drop = doublecorner_states[1],
sounds = default.node_sound_defaults(),
mesecons = {
conductor = {
states = doublecorner_states,
rules = doublecorner_get_rules,
},
},
on_blast = mesecon.on_blastnode,
on_rotate = rotate,
})
end
minetest.register_craft({
type = "shapeless",
output = "mesecons_extrawires:doublecorner_00",
recipe = {
"mesecons_extrawires:corner_off",
"mesecons_extrawires:corner_off",
},
})
minetest.register_craft({
type = "shapeless",
output = "mesecons_extrawires:corner_off 2",
recipe = {
"mesecons_extrawires:doublecorner_00",
},
})

View File

@ -1,5 +1,6 @@
dofile(minetest.get_modpath("mesecons_extrawires").."/crossover.lua");
dofile(minetest.get_modpath("mesecons_extrawires").."/tjunction.lua");
dofile(minetest.get_modpath("mesecons_extrawires").."/corner.lua");
dofile(minetest.get_modpath("mesecons_extrawires").."/doublecorner.lua");
dofile(minetest.get_modpath("mesecons_extrawires").."/vertical.lua");
dofile(minetest.get_modpath("mesecons_extrawires").."/mesewire.lua");

View File

@ -0,0 +1,3 @@
name = mesecons_extrawires
depends = default, mesecons
optional_depends = screwdriver

View File

@ -0,0 +1,125 @@
# Вершины
# Провод 1
# 1 (ниж. внутр.)
v 0.093750 -0.531250 -0.501000
v 0.093750 -0.531250 -0.331726
v 0.331726 -0.531250 -0.093750
v 0.501000 -0.531250 -0.093750
# 5 (ниж. наруж.)
v -0.093750 -0.531250 -0.501000
v -0.093750 -0.531250 -0.254061
v 0.254061 -0.531250 0.093750
v 0.501000 -0.531250 0.093750
# 9 (верх. внутр.)
v 0.093750 -0.406250 -0.501000
v 0.093750 -0.406250 -0.331726
v 0.331726 -0.406250 -0.093750
v 0.501000 -0.406250 -0.093750
# 13 (верх. наруж.)
v -0.093750 -0.406250 -0.501000
v -0.093750 -0.406250 -0.254061
v 0.254061 -0.406250 0.093750
v 0.501000 -0.406250 0.093750
# Текстурные координаты
# 1 (ниж.)
vt 0.000000 0.406250
vt 0.168274 0.406250
vt 0.331726 0.406250
vt 0.668274 0.406250
vt 0.831726 0.406250
vt 1.000000 0.406250
vt 0.000000 0.593750
vt 0.245939 0.593750
vt 0.254061 0.593750
vt 0.745939 0.593750
vt 0.754061 0.593750
vt 1.000000 0.593750
# 13 (верх.)
vt 0.000000 0.406250
vt 0.245939 0.406250
vt 0.254061 0.406250
vt 0.745939 0.406250
vt 0.754061 0.406250
vt 1.000000 0.406250
vt 0.000000 0.593750
vt 0.168274 0.593750
vt 0.331726 0.593750
vt 0.668274 0.593750
vt 0.831726 0.593750
vt 1.000000 0.593750
# 25 (внутр.)
vt 1.000000 0.093750
vt 0.831726 0.093750
vt 0.668274 0.093750
vt 0.331726 0.093750
vt 0.168274 0.093750
vt 0.000000 0.093750
vt 1.000000 -0.031250
vt 0.831726 -0.031250
vt 0.668274 -0.031250
vt 0.331726 -0.031250
vt 0.168274 -0.031250
vt 0.000000 -0.031250
# 37 (внеш.)
vt 0.000000 -0.031250
vt 0.245939 -0.031250
vt 0.254061 -0.031250
vt 0.745939 -0.031250
vt 0.754061 -0.031250
vt 1.000000 -0.031250
vt 0.000000 0.093750
vt 0.245939 0.093750
vt 0.254061 0.093750
vt 0.745939 0.093750
vt 0.754061 0.093750
vt 1.000000 0.093750
# 49 (торец)
vt 0.406250 -0.031250
vt 0.406250 0.093750
vt 0.593750 -0.031250
vt 0.593750 0.093750
# Нормали
# 1
vn 1.000000 0.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.707107 0.000000 0.707107
# 5
vn -1.000000 0.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn -0.707107 0.000000 -0.707107
# Грани
g Sides1
# Часть 1
f 5/37/1 6/38/1 14/44/1
f 5/37/1 14/44/1 13/43/1
f 13/13/2 14/14/2 10/20/2
f 13/13/2 10/20/2 9/19/2
f 9/25/5 10/26/5 2/32/5
f 9/25/5 2/32/5 1/31/5
f 1/1/6 2/2/6 6/8/6
f 1/1/6 6/8/6 5/7/6
# Часть 2
f 6/39/4 7/40/4 15/46/4
f 6/39/4 15/46/4 14/45/4
f 14/15/2 15/16/2 11/22/2
f 14/15/2 11/22/2 10/21/2
f 10/27/8 11/28/8 3/34/8
f 10/27/8 3/34/8 2/33/8
f 2/3/6 3/4/6 7/10/6
f 2/3/6 7/10/6 6/9/6
# Часть 3
f 7/41/3 8/42/3 16/48/3
f 7/41/3 16/48/3 15/47/3
f 15/17/2 16/18/2 12/24/2
f 15/17/2 12/24/2 11/23/2
f 11/29/7 12/30/7 4/36/7
f 11/29/7 4/36/7 3/35/7
f 3/5/6 4/6/6 8/12/6
f 3/5/6 8/12/6 7/11/6
g Ends1
f 1/49/3 5/51/3 13/52/3
f 1/49/3 13/52/3 9/50/3
f 4/49/1 12/50/1 16/52/1
f 4/49/1 16/52/1 8/51/1

View File

@ -0,0 +1,180 @@
# Вершины
# Провод 1
# 1 (ниж. внутр.)
v 0.093750 -0.531250 -0.501000
v 0.093750 -0.531250 -0.331726
v 0.331726 -0.531250 -0.093750
v 0.501000 -0.531250 -0.093750
# 5 (ниж. наруж.)
v -0.093750 -0.531250 -0.501000
v -0.093750 -0.531250 -0.254061
v 0.254061 -0.531250 0.093750
v 0.501000 -0.531250 0.093750
# 9 (верх. внутр.)
v 0.093750 -0.406250 -0.501000
v 0.093750 -0.406250 -0.331726
v 0.331726 -0.406250 -0.093750
v 0.501000 -0.406250 -0.093750
# 13 (верх. наруж.)
v -0.093750 -0.406250 -0.501000
v -0.093750 -0.406250 -0.254061
v 0.254061 -0.406250 0.093750
v 0.501000 -0.406250 0.093750
# Провод 2
# 17 (ниж. внутр.)
v -0.093750 -0.531250 0.501000
v -0.093750 -0.531250 0.331726
v -0.331726 -0.531250 0.093750
v -0.501000 -0.531250 0.093750
# 21 (ниж. наруж.)
v 0.093750 -0.531250 0.501000
v 0.093750 -0.531250 0.254061
v -0.254061 -0.531250 -0.093750
v -0.501000 -0.531250 -0.093750
# 25 (верх. внутр.)
v -0.093750 -0.406250 0.501000
v -0.093750 -0.406250 0.331726
v -0.331726 -0.406250 0.093750
v -0.501000 -0.406250 0.093750
# 29 (верх. наруж.)
v 0.093750 -0.406250 0.501000
v 0.093750 -0.406250 0.254061
v -0.254061 -0.406250 -0.093750
v -0.501000 -0.406250 -0.093750
# Текстурные координаты
# 1 (ниж.)
vt 0.000000 0.406250
vt 0.168274 0.406250
vt 0.331726 0.406250
vt 0.668274 0.406250
vt 0.831726 0.406250
vt 1.000000 0.406250
vt 0.000000 0.593750
vt 0.245939 0.593750
vt 0.254061 0.593750
vt 0.745939 0.593750
vt 0.754061 0.593750
vt 1.000000 0.593750
# 13 (верх.)
vt 0.000000 0.406250
vt 0.245939 0.406250
vt 0.254061 0.406250
vt 0.745939 0.406250
vt 0.754061 0.406250
vt 1.000000 0.406250
vt 0.000000 0.593750
vt 0.168274 0.593750
vt 0.331726 0.593750
vt 0.668274 0.593750
vt 0.831726 0.593750
vt 1.000000 0.593750
# 25 (внутр.)
vt 1.000000 0.093750
vt 0.831726 0.093750
vt 0.668274 0.093750
vt 0.331726 0.093750
vt 0.168274 0.093750
vt 0.000000 0.093750
vt 1.000000 -0.031250
vt 0.831726 -0.031250
vt 0.668274 -0.031250
vt 0.331726 -0.031250
vt 0.168274 -0.031250
vt 0.000000 -0.031250
# 37 (внеш.)
vt 0.000000 -0.031250
vt 0.245939 -0.031250
vt 0.254061 -0.031250
vt 0.745939 -0.031250
vt 0.754061 -0.031250
vt 1.000000 -0.031250
vt 0.000000 0.093750
vt 0.245939 0.093750
vt 0.254061 0.093750
vt 0.745939 0.093750
vt 0.754061 0.093750
vt 1.000000 0.093750
# 49 (торец)
vt 0.406250 -0.031250
vt 0.406250 0.093750
vt 0.593750 -0.031250
vt 0.593750 0.093750
# Нормали
# 1
vn 1.000000 0.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 0.000000 1.000000
vn 0.707107 0.000000 0.707107
# 5
vn -1.000000 0.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn -0.707107 0.000000 -0.707107
# Грани
# Грани
g Sides1
# Часть 1
f 5/37/1 6/38/1 14/44/1
f 5/37/1 14/44/1 13/43/1
f 13/13/2 14/14/2 10/20/2
f 13/13/2 10/20/2 9/19/2
f 9/25/5 10/26/5 2/32/5
f 9/25/5 2/32/5 1/31/5
f 1/1/6 2/2/6 6/8/6
f 1/1/6 6/8/6 5/7/6
# Часть 2
f 6/39/4 7/40/4 15/46/4
f 6/39/4 15/46/4 14/45/4
f 14/15/2 15/16/2 11/22/2
f 14/15/2 11/22/2 10/21/2
f 10/27/8 11/28/8 3/34/8
f 10/27/8 3/34/8 2/33/8
f 2/3/6 3/4/6 7/10/6
f 2/3/6 7/10/6 6/9/6
# Часть 3
f 7/41/3 8/42/3 16/48/3
f 7/41/3 16/48/3 15/47/3
f 15/17/2 16/18/2 12/24/2
f 15/17/2 12/24/2 11/23/2
f 11/29/7 12/30/7 4/36/7
f 11/29/7 4/36/7 3/35/7
f 3/5/6 4/6/6 8/12/6
f 3/5/6 8/12/6 7/11/6
g Ends1
f 1/49/3 5/51/3 13/52/3
f 1/49/3 13/52/3 9/50/3
f 4/49/1 12/50/1 16/52/1
f 4/49/1 16/52/1 8/51/1
g Sides2
# Часть 1
f 21/37/1 22/38/1 30/44/1
f 21/37/1 30/44/1 29/43/1
f 29/13/2 30/14/2 26/20/2
f 29/13/2 26/20/2 25/19/2
f 25/25/5 26/26/5 18/32/5
f 25/25/5 18/32/5 17/31/5
f 17/1/6 18/2/6 22/8/6
f 17/1/6 22/8/6 21/7/6
# Часть 2
f 22/39/4 23/40/4 31/46/4
f 22/39/4 31/46/4 30/45/4
f 30/15/2 31/16/2 27/22/2
f 30/15/2 27/22/2 26/21/2
f 26/27/8 27/28/8 19/34/8
f 26/27/8 19/34/8 18/33/8
f 18/3/6 19/4/6 23/10/6
f 18/3/6 23/10/6 22/9/6
# Часть 3
f 23/41/3 24/42/3 32/48/3
f 23/41/3 32/48/3 31/47/3
f 31/17/2 32/18/2 28/24/2
f 31/17/2 28/24/2 27/23/2
f 27/29/7 28/30/7 20/36/7
f 27/29/7 20/36/7 19/35/7
f 19/5/6 20/6/6 24/12/6
f 19/5/6 24/12/6 23/11/6
g Ends2
f 17/49/3 21/51/3 29/52/3
f 17/49/3 29/52/3 25/50/3
f 20/49/1 28/50/1 32/52/1
f 20/49/1 32/52/1 24/51/1

View File

@ -2,13 +2,14 @@ local screwdriver_exists = minetest.global_exists("screwdriver")
local tjunction_nodebox = {
type = "fixed",
-- ±0.001 is to prevent z-fighting
fixed = {{ -16/32-0.001, -17/32, -3/32, 16/32+0.001, -13/32, 3/32 },
{ -3/32, -17/32, -16/32+0.001, 3/32, -13/32, -3/32},}
}
local tjunction_selectionbox = {
type = "fixed",
fixed = { -16/32-0.001, -18/32, -16/32, 16/32+0.001, -12/32, 7/32 },
fixed = { -16/32, -16/32, -16/32, 16/32, -12/32, 7/32 },
}
local tjunction_get_rules = function (node)
@ -87,7 +88,6 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
minetest.register_craft({
output = "mesecons_extrawires:tjunction_off 3",
recipe = {
{"", "", ""},
{"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off"},
{"", "mesecons_insulated:insulated_off", ""},
}

Some files were not shown because too many files have changed in this diff Show More