Compare commits
13 Commits
fix_crash
...
ec3218d6d9
Author | SHA1 | Date | |
---|---|---|---|
ec3218d6d9 | |||
4ecc694518 | |||
3dd0eb7e4f | |||
e4d7c07962 | |||
69a4b6b332 | |||
e38e4fe0c5 | |||
5ad1e6bc4d | |||
b91fe92d13 | |||
6a87290ead | |||
1963bfcc0d | |||
6936c8c2e4 | |||
2fc1682c04 | |||
9b835053c2 |
@ -1,10 +1,10 @@
|
||||
on: [push, pull_request]
|
||||
name: "Check"
|
||||
name: Check & Release
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
name: "Luacheck"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- name: apt
|
||||
@ -14,9 +14,9 @@ jobs:
|
||||
- name: luacheck run
|
||||
run: $HOME/.luarocks/bin/luacheck ./
|
||||
|
||||
mineunit:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
name: "Mineunit tests"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- name: apt
|
26
.github/workflows/test.yml
vendored
@ -1,26 +0,0 @@
|
||||
on: [push, pull_request]
|
||||
name: "Test"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Smoke Test ${{ matrix.cfg.image }}"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
strategy:
|
||||
matrix:
|
||||
cfg:
|
||||
- { image: 'registry.gitlab.com/minetest/minetest/server:5.0.1', mtg: false }
|
||||
- { image: 'ghcr.io/minetest/minetest:5.9.0', mtg: true }
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
|
||||
- uses: actions/checkout@main
|
||||
with:
|
||||
repository: 'minetest/minetest_game'
|
||||
path: ./.test/minetest_game
|
||||
if: ${{ matrix.cfg.mtg }}
|
||||
|
||||
- name: Run tests
|
||||
run: ./.test/run.sh
|
||||
env:
|
||||
DOCKER_IMAGE: "${{ matrix.cfg.image }}"
|
@ -27,8 +27,6 @@ read_globals = {
|
||||
"table.insert_all",
|
||||
"vector",
|
||||
"VoxelArea",
|
||||
"mcl_dyes",
|
||||
"mcl_sounds",
|
||||
}
|
||||
|
||||
globals = {"mesecon"}
|
||||
|
@ -1,3 +0,0 @@
|
||||
mg_name = singlenode
|
||||
mesecon.internal_test = true
|
||||
random_mod_load_order = true
|
31
.test/run.sh
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
tempdir=$(mktemp -d)
|
||||
confpath=$tempdir/minetest.conf
|
||||
worldpath=$tempdir/world
|
||||
trap 'rm -rf "$tempdir" || :' EXIT
|
||||
|
||||
[ -f mesecons/mod.conf ] || { echo "Must be run in modpack root folder." >&2; exit 1; }
|
||||
|
||||
command -v docker >/dev/null || { echo "Docker is not installed." >&2; exit 1; }
|
||||
mtg=.test/minetest_game
|
||||
[ -d $mtg ] || echo "A source checkout of minetest_game was not found. This can fail if your docker image does not ship a game." >&2
|
||||
|
||||
mkdir "$worldpath"
|
||||
cp -v .test/minetest.conf "$confpath"
|
||||
chmod -R 777 "$tempdir"
|
||||
|
||||
args=(
|
||||
-v "$confpath":/etc/minetest/minetest.conf
|
||||
-v "$tempdir":/var/lib/minetest/.minetest
|
||||
-v "$PWD":/var/lib/minetest/.minetest/world/worldmods/mesecons
|
||||
)
|
||||
[ -d $mtg ] && args+=(
|
||||
-v "$(realpath $mtg)":/var/lib/minetest/.minetest/games/minetest_game
|
||||
)
|
||||
args+=("$DOCKER_IMAGE")
|
||||
[ -d $mtg ] && args+=(--gameid minetest)
|
||||
docker run --rm -i "${args[@]}"
|
||||
|
||||
ls -la "$worldpath"
|
||||
test -f "$worldpath/mesecon_actionqueue" || exit 1
|
||||
exit 0
|
25
README.md
@ -12,7 +12,6 @@ MESECONS by Jeija and contributors
|
||||
|
||||
Mezzee-what?
|
||||
------------
|
||||
|
||||
[Mesecons](https://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
|
||||
|
||||
Mesecons is a mod for [Minetest](https://www.minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks.
|
||||
@ -21,18 +20,15 @@ Mesecons has a similar goal to Redstone in Minecraft, but works in its own way,
|
||||
|
||||
OK, I want in.
|
||||
--------------
|
||||
|
||||
Go get it!
|
||||
|
||||
[](https://content.minetest.net/packages/Jeija/mesecons/)
|
||||
[DOWNLOAD IT NOW](https://github.com/minetest-mods/mesecons/archive/master.zip)
|
||||
|
||||
Install it directly from your client by searching it in the Online Content tab.
|
||||
|
||||
**Or** if you've downloaded a ZIP file check out [this page](https://wiki.minetest.net/Mods) over at the official 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.
|
||||
3. Open up the Minetest mods folder - called `mods`.
|
||||
3. Open up the Minetest mods folder - usually `/mods/`. If you see the `minetest` or folder inside of that, that is your mod folder instead.
|
||||
4. Copy the Mesecons folder into the mods folder.
|
||||
|
||||
Don't like some parts of Mesecons? Open up the Mesecons folder and delete the subfolder containing the mod you don't want. If you didn't want movestones, for example, all you have to do is delete the `mesecons_movestones` folder and they will no longer be available.
|
||||
@ -41,21 +37,21 @@ There are no dependencies - it will work right after installing!
|
||||
|
||||
How do I use this thing?
|
||||
------------------------
|
||||
|
||||
How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
|
||||
|
||||
Or maybe a [comprehensive reference](https://mesecons.net/items.html) is your style?
|
||||
Or maybe a [comprehensive reference](http://mesecons.net/items.html) is your style?
|
||||
|
||||
An overview for the very newest of new beginners? How does [this one](https://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
|
||||
An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
|
||||
|
||||
Want to get more into building? Why not check out the [Mesecons Laboratory](https://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
|
||||
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)!
|
||||
|
||||
Who wrote it anyways?
|
||||
---------------------
|
||||
|
||||
These awesome people made Mesecons possible! (as of 2016)
|
||||
These awesome people made Mesecons possible!
|
||||
|
||||
| Contributor | Contribution |
|
||||
| --------------- | -------------------------------- |
|
||||
@ -76,11 +72,8 @@ These awesome people made Mesecons possible! (as of 2016)
|
||||
|
||||
There are also a whole bunch of other people helping with everything from code to testing and feedback. Mesecons would also not be possible without their help!
|
||||
|
||||
Check out the [entire contributor list](https://github.com/minetest-mods/mesecons/graphs/contributors) on GitHub.
|
||||
|
||||
Alright, how can I use it?
|
||||
--------------------------
|
||||
|
||||
All textures in this project are licensed under the CC-BY-SA 3.0 (Creative Commons Attribution-ShareAlike 3.0 Generic).
|
||||
That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one.
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
},
|
||||
"Logic" : {
|
||||
"Luacontroller" : "mesecons_luacontroller/doc/luacontroller",
|
||||
"Microcontroller" : "mesecons_microcontroller/doc/microcontroler",
|
||||
"FPGA" : "mesecons_fpga/doc/fpga",
|
||||
"FPGA Programmer" : "mesecons_fpga/doc/programmer",
|
||||
"Torch" : "mesecons_torch/doc/torch",
|
||||
|
@ -70,17 +70,7 @@ end
|
||||
-- However, even that does not work in some cases, that's why we delay the time the globalsteps
|
||||
-- start to be execute by 4 seconds
|
||||
|
||||
local m_time = 0
|
||||
local resumetime = mesecon.setting("resumetime", 4)
|
||||
|
||||
local function globalstep_func(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
|
||||
m_time = m_time + dtime
|
||||
return
|
||||
end
|
||||
|
||||
local actions = queue.actions
|
||||
-- split into two categories:
|
||||
-- actions_now: actions to execute now
|
||||
@ -122,7 +112,23 @@ local function globalstep_func(dtime)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_globalstep(globalstep_func)
|
||||
-- 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,
|
||||
|
@ -123,11 +123,3 @@ dofile(minetest.get_modpath("mesecons").."/legacy.lua");
|
||||
|
||||
--Services like turnoff receptor on dignode and so on
|
||||
dofile(minetest.get_modpath("mesecons").."/services.lua");
|
||||
|
||||
-- Automated test run
|
||||
if mesecon.setting("internal_test", false) then
|
||||
-- currently does nothing, we only fail if some error happens right on startup
|
||||
minetest.after(5, function()
|
||||
minetest.request_shutdown()
|
||||
end)
|
||||
end
|
||||
|
@ -51,18 +51,27 @@ mesecon.fifo_queue = dofile(minetest.get_modpath("mesecons").."/fifo_queue.lua")
|
||||
|
||||
-- General
|
||||
function mesecon.get_effector(nodename)
|
||||
local def = minetest.registered_nodes[nodename]
|
||||
return def and def.mesecons and def.mesecons.effector
|
||||
if minetest.registered_nodes[nodename]
|
||||
and minetest.registered_nodes[nodename].mesecons
|
||||
and minetest.registered_nodes[nodename].mesecons.effector then
|
||||
return minetest.registered_nodes[nodename].mesecons.effector
|
||||
end
|
||||
end
|
||||
|
||||
function mesecon.get_receptor(nodename)
|
||||
local def = minetest.registered_nodes[nodename]
|
||||
return def and def.mesecons and def.mesecons.receptor
|
||||
if minetest.registered_nodes[nodename]
|
||||
and minetest.registered_nodes[nodename].mesecons
|
||||
and minetest.registered_nodes[nodename].mesecons.receptor then
|
||||
return minetest.registered_nodes[nodename].mesecons.receptor
|
||||
end
|
||||
end
|
||||
|
||||
function mesecon.get_conductor(nodename)
|
||||
local def = minetest.registered_nodes[nodename]
|
||||
return def and def.mesecons and def.mesecons.conductor
|
||||
if minetest.registered_nodes[nodename]
|
||||
and minetest.registered_nodes[nodename].mesecons
|
||||
and minetest.registered_nodes[nodename].mesecons.conductor then
|
||||
return minetest.registered_nodes[nodename].mesecons.conductor
|
||||
end
|
||||
end
|
||||
|
||||
function mesecon.get_any_outputrules(node)
|
||||
|
@ -1,3 +0,0 @@
|
||||
# textdomain: mesecons
|
||||
|
||||
Mesecons=Mesecons
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons
|
||||
|
||||
### oldwires.lua ###
|
||||
Mesecons=Mesecons
|
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 846 B After Width: | Height: | Size: 846 B |
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_blinkyplant
|
||||
Blinky Plant=Blinkpflanze
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_blinkyplant
|
||||
|
||||
### init.lua ###
|
||||
Blinky Plant=Plante clignotante
|
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_button
|
||||
Button=Taster
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_button
|
||||
|
||||
### init.lua ###
|
||||
Button=Bouton
|
@ -1,5 +0,0 @@
|
||||
# textdomain: mesecons_commandblock
|
||||
Say <text> as the server=<Text> als Server sagen
|
||||
Say <text> to <name> privately=<Text> an <Name> privat senden
|
||||
Set health of <name> to <value> hitpoints=Gesundheit von <Name> auf <Wert> Trefferpunkte setzen
|
||||
Command Block=Befehlsblock
|
@ -1,7 +0,0 @@
|
||||
# textdomain: mesecons_commandblock
|
||||
|
||||
### init.lua ###
|
||||
Say <text> as the server=Dire <text> au serveur
|
||||
Say <text> to <name> privately=Dire <text> à <name> en privé
|
||||
Set health of <name> to <value> hitpoints=Définir la vie de <name> sur <value> cœurs
|
||||
Command Block=Bloc de commandes
|
@ -27,6 +27,20 @@ local delaytime = { 0.1, 0.3, 0.5, 1.0 }
|
||||
|
||||
for i = 1, 4 do
|
||||
|
||||
local boxes = {
|
||||
{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
|
||||
|
||||
{ -2/16, -7/16, -4/16, 2/16, -26/64, -3/16 }, -- the jeweled "on" indicator
|
||||
{ -3/16, -7/16, -3/16, 3/16, -26/64, -2/16 },
|
||||
{ -4/16, -7/16, -2/16, 4/16, -26/64, 2/16 },
|
||||
{ -3/16, -7/16, 2/16, 3/16, -26/64, 3/16 },
|
||||
{ -2/16, -7/16, 3/16, 2/16, -26/64, 4/16 },
|
||||
|
||||
{ -6/16, -7/16, -6/16, -4/16, -27/64, -4/16 }, -- the timer indicator
|
||||
{ -8/16, -8/16, -1/16, -6/16, -7/16, 1/16 }, -- the two wire stubs
|
||||
{ 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }
|
||||
}
|
||||
|
||||
-- Delayer definition defaults
|
||||
local def = {
|
||||
drawtype = "nodebox",
|
||||
@ -34,14 +48,11 @@ local def = {
|
||||
walkable = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
|
||||
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16 },
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 }, -- bottom slab
|
||||
{ -6/16, -7/16, -6/16, 6/16, -6/16, 6/16 }
|
||||
},
|
||||
fixed = boxes
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
@ -51,8 +62,6 @@ local def = {
|
||||
sounds = mesecon.node_sound.stone,
|
||||
on_blast = mesecon.on_blastnode,
|
||||
drop = "mesecons_delayer:delayer_off_1",
|
||||
delayer_onstate = "mesecons_delayer:delayer_on_"..tostring(i),
|
||||
delayer_offstate = "mesecons_delayer:delayer_off_"..tostring(i),
|
||||
}
|
||||
|
||||
-- Deactivated delayer definition defaults
|
||||
@ -63,17 +72,16 @@ end
|
||||
|
||||
local off_state = {
|
||||
description = S("Delayer"),
|
||||
inventory_image = "jeija_gate_off.png^jeija_delayer.png",
|
||||
wield_image = "jeija_gate_off.png^jeija_delayer.png",
|
||||
tiles = {
|
||||
"jeija_microcontroller_bottom.png^jeija_gate_output_off.png^jeija_gate_off.png^"..
|
||||
"jeija_delayer.png^mesecons_delayer_"..tostring(i)..".png",
|
||||
"jeija_microcontroller_bottom.png^jeija_gate_output_off.png",
|
||||
"jeija_gate_side.png^jeija_gate_side_output_off.png",
|
||||
"jeija_gate_side.png",
|
||||
"jeija_gate_side.png",
|
||||
"jeija_gate_side.png",
|
||||
"mesecons_delayer_off_"..tostring(i)..".png",
|
||||
"mesecons_delayer_bottom.png",
|
||||
"mesecons_delayer_ends_off.png",
|
||||
"mesecons_delayer_ends_off.png",
|
||||
"mesecons_delayer_sides_off.png",
|
||||
"mesecons_delayer_sides_off.png"
|
||||
},
|
||||
inventory_image = "mesecons_delayer_off_1.png",
|
||||
wield_image = "mesecons_delayer_off_1.png",
|
||||
groups = off_groups,
|
||||
on_punch = function(pos, node, puncher)
|
||||
if minetest.is_protected(pos, puncher and puncher:get_player_name() or "") then
|
||||
@ -85,6 +93,7 @@ local off_state = {
|
||||
param2 = node.param2
|
||||
})
|
||||
end,
|
||||
delayer_onstate = "mesecons_delayer:delayer_on_"..tostring(i),
|
||||
mesecons = {
|
||||
receptor =
|
||||
{
|
||||
@ -94,7 +103,6 @@ local off_state = {
|
||||
effector =
|
||||
{
|
||||
rules = delayer_get_input_rules,
|
||||
action_off = delayer_deactivate,
|
||||
action_on = delayer_activate
|
||||
}
|
||||
},
|
||||
@ -107,16 +115,13 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), off_state)
|
||||
-- Activated delayer definition defaults
|
||||
local on_state = {
|
||||
description = S("You hacker you"),
|
||||
inventory_image = "jeija_gate_on.png^jeija_delayer.png",
|
||||
wield_image = "jeija_gate_on.png^jeija_delayer.png",
|
||||
tiles = {
|
||||
"jeija_microcontroller_bottom.png^jeija_gate_output_on.png^jeija_gate_on.png^"..
|
||||
"jeija_delayer.png^mesecons_delayer_"..tostring(i)..".png",
|
||||
"jeija_microcontroller_bottom.png^jeija_gate_output_on.png",
|
||||
"jeija_gate_side.png^jeija_gate_side_output_on.png",
|
||||
"jeija_gate_side.png",
|
||||
"jeija_gate_side.png",
|
||||
"jeija_gate_side.png",
|
||||
"mesecons_delayer_on_"..tostring(i)..".png",
|
||||
"mesecons_delayer_bottom.png",
|
||||
"mesecons_delayer_ends_on.png",
|
||||
"mesecons_delayer_ends_on.png",
|
||||
"mesecons_delayer_sides_on.png",
|
||||
"mesecons_delayer_sides_on.png"
|
||||
},
|
||||
groups = {bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1},
|
||||
on_punch = function(pos, node, puncher)
|
||||
@ -129,6 +134,7 @@ local on_state = {
|
||||
param2 = node.param2
|
||||
})
|
||||
end,
|
||||
delayer_offstate = "mesecons_delayer:delayer_off_"..tostring(i),
|
||||
mesecons = {
|
||||
receptor =
|
||||
{
|
||||
@ -138,8 +144,7 @@ local on_state = {
|
||||
effector =
|
||||
{
|
||||
rules = delayer_get_input_rules,
|
||||
action_off = delayer_deactivate,
|
||||
action_on = delayer_activate
|
||||
action_off = delayer_deactivate
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
# textdomain: mesecons_delayer
|
||||
Delayer=Verzögerer
|
||||
You hacker you=Du Hacker, Du
|
@ -1,5 +0,0 @@
|
||||
# textdomain: mesecons_delayer
|
||||
|
||||
### init.lua ###
|
||||
Delayer=Retardateur
|
||||
You hacker you=Vous êtes un pirate informatique
|
Before Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 339 B |
Before Width: | Height: | Size: 334 B |
BIN
mesecons_delayer/textures/mesecons_delayer_bottom.png
Normal file
After Width: | Height: | Size: 221 B |
BIN
mesecons_delayer/textures/mesecons_delayer_ends_off.png
Normal file
After Width: | Height: | Size: 176 B |
BIN
mesecons_delayer/textures/mesecons_delayer_ends_on.png
Normal file
After Width: | Height: | Size: 187 B |
BIN
mesecons_delayer/textures/mesecons_delayer_off_1.png
Normal file
After Width: | Height: | Size: 448 B |
BIN
mesecons_delayer/textures/mesecons_delayer_off_2.png
Normal file
After Width: | Height: | Size: 449 B |
BIN
mesecons_delayer/textures/mesecons_delayer_off_3.png
Normal file
After Width: | Height: | Size: 448 B |
BIN
mesecons_delayer/textures/mesecons_delayer_off_4.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
mesecons_delayer/textures/mesecons_delayer_on_1.png
Normal file
After Width: | Height: | Size: 541 B |
BIN
mesecons_delayer/textures/mesecons_delayer_on_2.png
Normal file
After Width: | Height: | Size: 541 B |
BIN
mesecons_delayer/textures/mesecons_delayer_on_3.png
Normal file
After Width: | Height: | Size: 541 B |
BIN
mesecons_delayer/textures/mesecons_delayer_on_4.png
Normal file
After Width: | Height: | Size: 538 B |
BIN
mesecons_delayer/textures/mesecons_delayer_sides_off.png
Normal file
After Width: | Height: | Size: 173 B |
BIN
mesecons_delayer/textures/mesecons_delayer_sides_on.png
Normal file
After Width: | Height: | Size: 181 B |
@ -4,16 +4,6 @@ local side_texture = mesecon.texture.steel_block or "mesecons_detector_side.png"
|
||||
|
||||
local GET_COMMAND = "GET"
|
||||
|
||||
|
||||
local function comma_list_to_table(comma_list)
|
||||
local tbl = {}
|
||||
for _, str in ipairs(string.split(comma_list:gsub("%s", ""), ",")) do
|
||||
tbl[str] = true
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
|
||||
-- Object detector
|
||||
-- Detects players in a certain radius
|
||||
-- The radius can be specified in mesecons/settings.lua
|
||||
@ -45,7 +35,10 @@ local function object_detector_scan(pos)
|
||||
if next(objs) == nil then return false end
|
||||
|
||||
local scanname = minetest.get_meta(pos):get_string("scanname")
|
||||
local scan_for = comma_list_to_table(scanname)
|
||||
local scan_for = {}
|
||||
for _, str in pairs(string.split(scanname:gsub(" ", ""), ",")) do
|
||||
scan_for[str] = true
|
||||
end
|
||||
|
||||
local every_player = scanname == ""
|
||||
for _, obj in pairs(objs) do
|
||||
@ -195,9 +188,8 @@ local function node_detector_scan(pos)
|
||||
vector.subtract(pos, vector.multiply(minetest.facedir_to_dir(node.param2), distance + 1))
|
||||
).name
|
||||
local scanname = meta:get_string("scanname")
|
||||
local scan_for = comma_list_to_table(scanname)
|
||||
|
||||
return (scan_for[frontname]) or
|
||||
return (frontname == scanname) or
|
||||
(frontname ~= "air" and frontname ~= "ignore" and scanname == "")
|
||||
end
|
||||
|
||||
@ -223,10 +215,10 @@ local node_detector_digiline = {
|
||||
|
||||
if type(msg) == "table" then
|
||||
if msg.distance or msg.scanname then
|
||||
if type(msg.distance) == "number" or type(msg.distance) == "string" then
|
||||
if msg.distance then
|
||||
meta:set_string("distance", msg.distance)
|
||||
end
|
||||
if type(msg.scanname) == "string" then
|
||||
if msg.scanname then
|
||||
meta:set_string("scanname", msg.scanname)
|
||||
end
|
||||
node_detector_make_formspec(pos)
|
||||
@ -240,7 +232,7 @@ local node_detector_digiline = {
|
||||
else
|
||||
if msg == GET_COMMAND then
|
||||
node_detector_send_node_name(pos, node, channel, meta)
|
||||
elseif type(msg) == "string" then
|
||||
else
|
||||
meta:set_string("scanname", msg)
|
||||
node_detector_make_formspec(pos)
|
||||
end
|
||||
|
@ -1,3 +0,0 @@
|
||||
# textdomain: mesecons_detector
|
||||
Player Detector=Spielerdetektor
|
||||
Node Detector=Blockdetektor
|
@ -1,5 +0,0 @@
|
||||
# textdomain: mesecons_detector
|
||||
|
||||
### init.lua ###
|
||||
Player Detector=Détecteur de joueur
|
||||
Node Detector=Détecteur de bloc
|
@ -22,11 +22,6 @@ end
|
||||
local function meseconify_door(name)
|
||||
if minetest.registered_items[name .. "_b_1"] then
|
||||
-- old style double-node doors
|
||||
if minetest.registered_items[name .. "_b_1"].mesecons then
|
||||
minetest.log("info", "[mesecons_doors] Not touching door " .. name)
|
||||
return
|
||||
end
|
||||
|
||||
local function toggle_state1 (pos)
|
||||
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
|
||||
end
|
||||
@ -52,10 +47,6 @@ local function meseconify_door(name)
|
||||
})
|
||||
elseif minetest.registered_items[name .. "_a"] then
|
||||
-- new style mesh node based doors
|
||||
if minetest.registered_items[name .. "_a"].mesecons then
|
||||
minetest.log("info", "[mesecons_doors] Not touching door " .. name)
|
||||
return
|
||||
end
|
||||
local override = {
|
||||
mesecons = {effector = {
|
||||
action_on = function(pos)
|
||||
@ -82,25 +73,29 @@ local function meseconify_door(name)
|
||||
end
|
||||
end
|
||||
|
||||
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(name)
|
||||
return function(pos, node)
|
||||
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 }, true)
|
||||
minetest.set_node(pos, {name=name, param2 = node.param2})
|
||||
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 }, true)
|
||||
minetest.set_node(pos, {name=name.."_open", param2 = node.param2})
|
||||
minetest.set_node(pos, {name="doors:trapdoor_open", param2 = node.param2})
|
||||
end
|
||||
|
||||
minetest.get_meta(pos):set_int("state", state == 1 and 0 or 1)
|
||||
end
|
||||
end
|
||||
|
||||
local function meseconify_trapdoor(name)
|
||||
local override
|
||||
if doors and doors.get then
|
||||
override = {
|
||||
if doors and doors.get then
|
||||
local override = {
|
||||
mesecons = {effector = {
|
||||
action_on = function(pos)
|
||||
local door = doors.get(pos)
|
||||
@ -116,32 +111,30 @@ local function meseconify_trapdoor(name)
|
||||
end,
|
||||
}},
|
||||
}
|
||||
else
|
||||
override = {
|
||||
mesecons = {effector = {
|
||||
action_on = trapdoor_switch(name),
|
||||
action_off = trapdoor_switch(name)
|
||||
}},
|
||||
}
|
||||
minetest.override_item("doors:trapdoor", override)
|
||||
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
|
||||
|
||||
if minetest.registered_items[name] then
|
||||
minetest.override_item(name, override)
|
||||
minetest.override_item(name.."_open", override)
|
||||
else
|
||||
if minetest.registered_nodes["doors:trapdoor"] then
|
||||
minetest.override_item("doors:trapdoor", {
|
||||
mesecons = {effector = {
|
||||
action_on = trapdoor_switch,
|
||||
action_off = trapdoor_switch
|
||||
}},
|
||||
})
|
||||
|
||||
minetest.override_item("doors:trapdoor_open", {
|
||||
mesecons = {effector = {
|
||||
action_on = trapdoor_switch,
|
||||
action_off = trapdoor_switch
|
||||
}},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
if doors.registered_doors ~= nil then -- registered_doors is not always available
|
||||
for k,_ in pairs(doors.registered_doors) do
|
||||
if k:find("_a$") then
|
||||
meseconify_door(k:sub(1,-3))
|
||||
end
|
||||
end
|
||||
for k,_ in pairs(doors.registered_trapdoors) do
|
||||
if not k:find("_open$") then
|
||||
meseconify_trapdoor(k)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
@ -1,8 +0,0 @@
|
||||
# textdomain: mesecons_extrawires
|
||||
Insulated Mesecon Corner=Isolierte Meseconecke
|
||||
Insulated Mesecon Crossover=Isolierter Meseconübergang
|
||||
You hacker you!=Sie Hacker!
|
||||
Insulated Mesecon Double Corner=Isolierte Mesecondoppelecke
|
||||
Mese Wire=Mesedraht
|
||||
Insulated Mesecon T-junction=Isolierte Mesecongabelung
|
||||
Vertical Mesecon=Vertikaler Mesecon
|
@ -1,20 +0,0 @@
|
||||
# textdomain: mesecons_extrawires
|
||||
|
||||
### corner.lua ###
|
||||
Insulated Mesecon Corner=Coin de Mesecon isolé
|
||||
|
||||
### crossover.lua ###
|
||||
Insulated Mesecon Crossover=Croisement de Mesecon isolé
|
||||
You hacker you!=Vous êtes un pirate informatique !
|
||||
|
||||
### doublecorner.lua ###
|
||||
Insulated Mesecon Double Corner=Double coin de Mesecon isolé
|
||||
|
||||
### mesewire.lua ###
|
||||
Mese Wire=Câble de Mesecon
|
||||
|
||||
### tjunction.lua ###
|
||||
Insulated Mesecon T-junction=Croisement en T de Mesecon isolé
|
||||
|
||||
### vertical.lua ###
|
||||
Vertical Mesecon=Mesecon vertical
|
@ -40,22 +40,17 @@ local bottom_rules = {
|
||||
{x=0, y=2, z=0} -- receive power from pressure plate / detector / ... 2 nodes above
|
||||
}
|
||||
|
||||
local function is_vertical_conductor(nodename)
|
||||
local def = minetest.registered_nodes[nodename]
|
||||
return def and def.is_vertical_conductor
|
||||
end
|
||||
|
||||
local vertical_updatepos = function (pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if not is_vertical_conductor(node.name) then
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.registered_nodes[node.name]
|
||||
and minetest.registered_nodes[node.name].is_vertical_conductor then
|
||||
local node_above = minetest.get_node(vector.add(pos, vertical_rules[1]))
|
||||
local node_below = minetest.get_node(vector.add(pos, vertical_rules[2]))
|
||||
|
||||
local above = is_vertical_conductor(node_above.name)
|
||||
local below = is_vertical_conductor(node_below.name)
|
||||
local above = minetest.registered_nodes[node_above.name]
|
||||
and minetest.registered_nodes[node_above.name].is_vertical_conductor
|
||||
local below = minetest.registered_nodes[node_below.name]
|
||||
and minetest.registered_nodes[node_below.name].is_vertical_conductor
|
||||
|
||||
mesecon.on_dignode(pos, node)
|
||||
|
||||
@ -73,6 +68,7 @@ local vertical_updatepos = function (pos)
|
||||
|
||||
minetest.set_node(pos, {name = newname})
|
||||
mesecon.on_placenode(pos, {name = newname})
|
||||
end
|
||||
end
|
||||
|
||||
local vertical_update = function (pos)
|
||||
|
@ -20,10 +20,10 @@ plg.register_nodes = function(template)
|
||||
|
||||
-- build top texture string
|
||||
local texture = "jeija_fpga_top.png"
|
||||
if a == 1 then texture = texture .. "^jeija_luacontroller_LED_A.png" end
|
||||
if b == 1 then texture = texture .. "^jeija_luacontroller_LED_B.png" end
|
||||
if c == 1 then texture = texture .. "^jeija_luacontroller_LED_C.png" end
|
||||
if d == 1 then texture = texture .. "^jeija_luacontroller_LED_D.png" end
|
||||
if a == 1 then texture = texture .. "^jeija_microcontroller_LED_A.png" end
|
||||
if b == 1 then texture = texture .. "^jeija_microcontroller_LED_B.png" end
|
||||
if c == 1 then texture = texture .. "^jeija_microcontroller_LED_C.png" end
|
||||
if d == 1 then texture = texture .. "^jeija_microcontroller_LED_D.png" end
|
||||
ndef.tiles[1] = texture
|
||||
ndef.inventory_image = texture
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
# textdomain: mesecons_fpga
|
||||
FPGA=FPGA
|
||||
FPGA Programmer=FPGA-Programmierer
|
@ -1,7 +0,0 @@
|
||||
# textdomain: mesecons_fpga
|
||||
|
||||
### init.lua ###
|
||||
FPGA=Circuit logique programmable (FPGA)
|
||||
|
||||
### tool.lua ###
|
||||
FPGA Programmer=Programmateur de circuit logique
|
@ -1,43 +0,0 @@
|
||||
|
||||
--Aliases
|
||||
|
||||
minetest.register_alias("mesecons_gamecompat:chest", "mcl_chests:chest")
|
||||
minetest.register_alias("mesecons_gamecompat:chest_locked", "mcl_chests:chest")
|
||||
minetest.register_alias("mesecons_gamecompat:coalblock", "mcl_core:coalblock")
|
||||
minetest.register_alias("mesecons_gamecompat:cobble", "mcl_core:cobble")
|
||||
minetest.register_alias("mesecons_gamecompat:glass", "mcl_core:glass")
|
||||
minetest.register_alias("mesecons_gamecompat:lava_source", "mcl_core:lava_source")
|
||||
minetest.register_alias("mesecons_gamecompat:mese", "mesecons:redstoneblock")
|
||||
minetest.register_alias("mesecons_gamecompat:mese_crystal", "mesecoms:redstone")
|
||||
minetest.register_alias("mesecons_gamecompat:mese_crystal_fragment", "mesecons:redstone")
|
||||
minetest.register_alias("mesecons_gamecompat:obsidian_glass", "mcl_core:glass")
|
||||
minetest.register_alias("mesecons_gamecompat:stone", "mcl_core:stone")
|
||||
minetest.register_alias("mesecons_gamecompat:steel_ingot", "mcl_core:iron_ingot")
|
||||
minetest.register_alias("mesecons_gamecompat:steelblock", "mcl_core:steelblock")
|
||||
minetest.register_alias("mesecons_gamecompat:torch", "mcl_torches:torch")
|
||||
|
||||
if minetest.get_modpath("mcl_dyes") then
|
||||
for color, def in ipairs(mcl_dyes.colors) do
|
||||
minetest.register_alias("mesecons_gamecompat:dye_" .. def.mcl2, "mcl_dyes:" .. color)
|
||||
end
|
||||
end
|
||||
|
||||
-- Sounds
|
||||
|
||||
mesecon.node_sound.default = mcl_sounds.node_sound_defaults()
|
||||
mesecon.node_sound.glass = mcl_sounds.node_sound_glass_defaults()
|
||||
mesecon.node_sound.leaves = mcl_sounds.node_sound_leaves_defaults()
|
||||
mesecon.node_sound.stone = mcl_sounds.node_sound_stone_defaults()
|
||||
mesecon.node_sound.wood = mcl_sounds.node_sound_wood_defaults()
|
||||
|
||||
if minetest.get_modpath("mcl_fire") then
|
||||
mesecon.sound_name.fire = "fire_fire"
|
||||
end
|
||||
|
||||
if minetest.get_modpath("mcl_tnt") then
|
||||
mesecon.sound_name.explode = "tnt_explode"
|
||||
end
|
||||
|
||||
-- Textures
|
||||
|
||||
mesecon.texture.steel_block = "default_steel_block.png"
|
@ -59,10 +59,6 @@ if minetest.get_modpath("mesecons_mvps") then
|
||||
"doors:hidden",
|
||||
"doors:trapdoor_steel",
|
||||
"doors:trapdoor_steel_open",
|
||||
"beds:bed_bottom",
|
||||
"beds:bed_top",
|
||||
"beds:fancy_bed_bottom",
|
||||
"beds:fancy_bed_top",
|
||||
"xpanes:door_steel_bar_a",
|
||||
"xpanes:door_steel_bar_b",
|
||||
"xpanes:door_steel_bar_c",
|
||||
|
@ -13,8 +13,3 @@ if minetest.get_modpath("default") then
|
||||
minetest.log("info", "Mesecons: detected Minetest Game for game compatibility")
|
||||
dofile(minetest.get_modpath("mesecons_gamecompat").."/compat_mtg.lua")
|
||||
end
|
||||
|
||||
if minetest.get_modpath("mcl_core") then
|
||||
minetest.log("info", "Mesecons: detected MineClonia Game for game compatibility")
|
||||
dofile(minetest.get_modpath("mesecons_gamecompat").."/compat_mcl.lua")
|
||||
end
|
||||
|
@ -1,3 +1,3 @@
|
||||
name = mesecons_gamecompat
|
||||
depends = mesecons
|
||||
optional_depends = fire, default, dye, mesecons_mvps, tnt, mcl_fire, mcl_core, mcl_dye, mcl_tnt
|
||||
optional_depends = fire, default, dye, mesecons_mvps, tnt
|
||||
|
Before Width: | Height: | Size: 84 B After Width: | Height: | Size: 84 B |
Before Width: | Height: | Size: 84 B After Width: | Height: | Size: 84 B |
Before Width: | Height: | Size: 98 B After Width: | Height: | Size: 98 B |
Before Width: | Height: | Size: 99 B After Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 109 B |
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_hydroturbine
|
||||
Water Turbine=Wasserturbine
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_hydroturbine
|
||||
|
||||
### init.lua ###
|
||||
Water Turbine=Détecteur de courant
|
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_insulated
|
||||
Straight Insulated Mesecon=Isolierte Mesecongerade
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_insulated
|
||||
|
||||
### init.lua ###
|
||||
Straight Insulated Mesecon=Mesecon isolé droit
|
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_lamp
|
||||
Mesecon Lamp=Meseconlampe
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_lamp
|
||||
|
||||
### init.lua ###
|
||||
Mesecon Lamp=Lampe de Mesecon
|
@ -1,13 +0,0 @@
|
||||
# textdomain: mesecons_lightstone
|
||||
Red Lightstone=Roter Leuchtstein
|
||||
Green Lightstone=Grüner Leuchtstein
|
||||
Blue Lightstone=Blauer Leuchtstein
|
||||
Grey Lightstone=Grauer Leuchtstein
|
||||
Dark Grey Lightstone=Dunkelgrauer Leuchtstein
|
||||
Yellow Lightstone=Gelber Leuchtstein
|
||||
Orange Lightstone=Orange Leuchtstein
|
||||
White Lightstone=Weißer Leuchtstein
|
||||
Pink Lightstone=Rosa Leuchtstein
|
||||
Magenta Lightstone=Magenta Leuchtstein
|
||||
Cyan Lightstone=Türkiser Leuchtstein
|
||||
Violet Lightstone=Violetter Leuchtstein
|
@ -1,15 +0,0 @@
|
||||
# textdomain: mesecons_lightstone
|
||||
|
||||
### init.lua ###
|
||||
Red Lightstone=Pierre lumineuse rouge
|
||||
Green Lightstone=Pierre lumineuse verte
|
||||
Blue Lightstone=Pierre lumineuse bleue
|
||||
Grey Lightstone=Pierre lumineuse grise
|
||||
Dark Grey Lightstone=Pierre lumineuse gris foncée
|
||||
Yellow Lightstone=Pierre lumineuse jaune
|
||||
Orange Lightstone=Pierre lumineuse orange
|
||||
White Lightstone=Pierre lumineuse blanche
|
||||
Pink Lightstone=Pierre lumineuse rose
|
||||
Magenta Lightstone=Pierre lumineuse magenta
|
||||
Cyan Lightstone=Pierre lumineuse bleu clair
|
||||
Violet Lightstone=Pierre lumineuse violette
|
@ -238,16 +238,6 @@ local function safe_string_find(...)
|
||||
return string.find(...)
|
||||
end
|
||||
|
||||
-- do not allow pattern matching in string.split (see string.find for details)
|
||||
local function safe_string_split(...)
|
||||
if select(5, ...) then
|
||||
debug.sethook() -- Clear hook
|
||||
error("string.split: 'sep_is_pattern' (fifth parameter) may not be used in a Luacontroller")
|
||||
end
|
||||
|
||||
return string.split(...)
|
||||
end
|
||||
|
||||
local function remove_functions(x)
|
||||
local tp = type(x)
|
||||
if tp == "function" then
|
||||
@ -388,10 +378,7 @@ local function clean_and_weigh_digiline_message(msg, back_references)
|
||||
return msg, #msg + 25
|
||||
elseif t == "number" then
|
||||
-- Numbers are passed by value so need not be touched, and cost 8 bytes
|
||||
-- as all numbers in Lua are doubles. NaN values are removed.
|
||||
if msg ~= msg then
|
||||
return nil, 0
|
||||
end
|
||||
-- as all numbers in Lua are doubles.
|
||||
return msg, 8
|
||||
elseif t == "boolean" then
|
||||
-- Booleans are passed by value so need not be touched, and cost 1
|
||||
@ -520,7 +507,6 @@ local function create_environment(pos, mem, event, itbl, send_warning)
|
||||
reverse = string.reverse,
|
||||
sub = string.sub,
|
||||
find = safe_string_find,
|
||||
split = safe_string_split,
|
||||
},
|
||||
math = {
|
||||
abs = math.abs,
|
||||
|
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_luacontroller
|
||||
Luacontroller=Luacontroller
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_luacontroller
|
||||
|
||||
### init.lua ###
|
||||
Luacontroller=Programmateur LUA
|
BIN
mesecons_luacontroller/textures/jeija_luacontroller_LED_A.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
mesecons_luacontroller/textures/jeija_luacontroller_LED_B.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
mesecons_luacontroller/textures/jeija_luacontroller_LED_C.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
mesecons_luacontroller/textures/jeija_luacontroller_LED_D.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_materials
|
||||
Glue=Klebstoff
|
||||
Fiber=Faser
|
||||
Silicon=Silizium
|
@ -1,6 +0,0 @@
|
||||
# textdomain: mesecons_materials
|
||||
|
||||
### init.lua ###
|
||||
Glue=Colle
|
||||
Fiber=Fibre
|
||||
Silicon=Silicone
|
@ -1,64 +0,0 @@
|
||||
<!-- Generate `description.html` from this by using `$ md2html -o description.html description.md`. -->
|
||||
<p>The Microcontroller is a semi-advanced programmable component with a persistent
|
||||
256 bit EEPROM memory.</p>
|
||||
<p>Warning: This device is largely considered deprecated and might contain bugs. It
|
||||
is recommended to use a Luacontroller instead.</p>
|
||||
<p>Detailed documentation can be found below:</p>
|
||||
<ul>
|
||||
<li>The Microcontroller's code is executed whenever any of the following events
|
||||
happens:<ul>
|
||||
<li>The Microcontroller is programmed. In this case the EEPROM and ports are all
|
||||
reset to <code>0</code> before.</li>
|
||||
<li>An incoming signal changes its state.</li>
|
||||
<li>An <code>after</code> event happens (see command <code>after</code> below).</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>There are 4 I/O ports (ABCD) and 256 EEPROM bits (1 to 256).</li>
|
||||
<li>The code consists of a sequence of commands.</li>
|
||||
<li>Everything after <code>:</code> is a comment.</li>
|
||||
<li>Strings are enclosed in <code>"</code>s.</li>
|
||||
<li>Spaces and tabs outside of strings are ignored.</li>
|
||||
<li>Basic command syntax:<pre><code> command_name`(`param1`,` param2`,` ...`)`
|
||||
</code></pre>
|
||||
</li>
|
||||
<li>Commands:<ul>
|
||||
<li><code>if(condition) commands [> else_commands];</code>:
|
||||
Evaluates the given condition and takes the corresponding branch.
|
||||
The else branch is optional (as indicated by the <code>[</code> and <code>]</code>). The <code>></code> is part
|
||||
of the syntax and indicates the start of the else branch. The <code>;</code> marks the
|
||||
end of the if command.</li>
|
||||
<li><code>on(port1, port2, ...)</code>:
|
||||
Sets the given ports to <code>1</code>.</li>
|
||||
<li><code>off(port1, port2, ...)</code>:
|
||||
Sets the given ports to <code>0</code>.</li>
|
||||
<li><code>print("string" or codition, ...)</code>:
|
||||
Evaluates the conditions and prints the concatenation of all params to stdout
|
||||
(only useful in singleplayer).</li>
|
||||
<li><code>after(time, "more commands")</code>:
|
||||
Executes the commands in the string after the given time in seconds.
|
||||
There can only be one waiting <code>after</code> event at once.
|
||||
Warning: This is not reliable, ie. <code>minetest.after</code> is used.</li>
|
||||
<li><code>sbi(port_or_eeprom, condition)</code>:
|
||||
Evaluates the condition and sets the port or EEPROM bit to the resulting value.
|
||||
Note: EEPROM indices don't use <code>#</code> here, ie. it's <code>sbi(1, #2)</code>, not <code>sbi(#1, #2)</code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Conditions (sorted by descending precedence; they are all evaluated from left
|
||||
to right):<ul>
|
||||
<li><code>0</code>, <code>1</code>: constant</li>
|
||||
<li><code>A</code>, ..., <code>D</code>: value of a port. Takes writes that already happened during the
|
||||
current execution into account.</li>
|
||||
<li><code>#1</code>, ..., <code>#256</code>: value of an EEPROM bit. Takes writes that already happened
|
||||
during the current execution into account.</li>
|
||||
<li><code>!condition</code>: negation (can only be applied once, ie. not <code>!!1</code>)</li>
|
||||
<li><code>condition1 = condition2</code>: XNOR (equality)</li>
|
||||
<li><code>condition1 op condition2</code> where <code>op</code> is one of:<ul>
|
||||
<li><code>&</code>: AND</li>
|
||||
<li><code>|</code>: OR</li>
|
||||
<li><code>~</code>: XOR (inequality)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Note: Explicit precedence using parentheses is not supported.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
@ -1,59 +0,0 @@
|
||||
<!-- Generate `description.html` from this by using `$ md2html -o description.html description.md`. -->
|
||||
|
||||
The Microcontroller is a semi-advanced programmable component with a persistent
|
||||
256 bit EEPROM memory.
|
||||
|
||||
Warning: This device is largely considered deprecated and might contain bugs. It
|
||||
is recommended to use a Luacontroller instead.
|
||||
|
||||
Detailed documentation can be found below:
|
||||
|
||||
* The Microcontroller's code is executed whenever any of the following events
|
||||
happens:
|
||||
* The Microcontroller is programmed. In this case the EEPROM and ports are all
|
||||
reset to `0` before.
|
||||
* An incoming signal changes its state.
|
||||
* An `after` event happens (see command `after` below).
|
||||
* There are 4 I/O ports (ABCD) and 256 EEPROM bits (1 to 256).
|
||||
* The code consists of a sequence of commands.
|
||||
* Everything after `:` is a comment.
|
||||
* Strings are enclosed in `"`s.
|
||||
* Spaces and tabs outside of strings are ignored.
|
||||
* Basic command syntax:
|
||||
```
|
||||
command_name`(`param1`,` param2`,` ...`)`
|
||||
```
|
||||
* Commands:
|
||||
* `if(condition) commands [> else_commands];`:
|
||||
Evaluates the given condition and takes the corresponding branch.
|
||||
The else branch is optional (as indicated by the `[` and `]`). The `>` is part
|
||||
of the syntax and indicates the start of the else branch. The `;` marks the
|
||||
end of the if command.
|
||||
* `on(port1, port2, ...)`:
|
||||
Sets the given ports to `1`.
|
||||
* `off(port1, port2, ...)`:
|
||||
Sets the given ports to `0`.
|
||||
* `print("string" or codition, ...)`:
|
||||
Evaluates the conditions and prints the concatenation of all params to stdout
|
||||
(only useful in singleplayer).
|
||||
* `after(time, "more commands")`:
|
||||
Executes the commands in the string after the given time in seconds.
|
||||
There can only be one waiting `after` event at once.
|
||||
Warning: This is not reliable, ie. `minetest.after` is used.
|
||||
* `sbi(port_or_eeprom, condition)`:
|
||||
Evaluates the condition and sets the port or EEPROM bit to the resulting value.
|
||||
Note: EEPROM indices don't use `#` here, ie. it's `sbi(1, #2)`, not `sbi(#1, #2)`.
|
||||
* Conditions (sorted by descending precedence; they are all evaluated from left
|
||||
to right):
|
||||
* `0`, `1`: constant
|
||||
* `A`, ..., `D`: value of a port. Takes writes that already happened during the
|
||||
current execution into account.
|
||||
* `#1`, ..., `#256`: value of an EEPROM bit. Takes writes that already happened
|
||||
during the current execution into account.
|
||||
* `!condition`: negation (can only be applied once, ie. not `!!1`)
|
||||
* `condition1 = condition2`: XNOR (equality)
|
||||
* `condition1 op condition2` where `op` is one of:
|
||||
* `&`: AND
|
||||
* `|`: OR
|
||||
* `~`: XOR (inequality)
|
||||
* Note: Explicit precedence using parentheses is not supported.
|
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 2.9 KiB |
@ -12,16 +12,16 @@ for d = 0, 1 do
|
||||
local nodename = "mesecons_microcontroller:microcontroller"..tostring(d)..tostring(c)..tostring(b)..tostring(a)
|
||||
local top = "jeija_microcontroller_top.png"
|
||||
if tostring(a) == "1" then
|
||||
top = top.."^jeija_luacontroller_LED_A.png"
|
||||
top = top.."^jeija_microcontroller_LED_A.png"
|
||||
end
|
||||
if tostring(b) == "1" then
|
||||
top = top.."^jeija_luacontroller_LED_B.png"
|
||||
top = top.."^jeija_microcontroller_LED_B.png"
|
||||
end
|
||||
if tostring(c) == "1" then
|
||||
top = top.."^jeija_luacontroller_LED_C.png"
|
||||
top = top.."^jeija_microcontroller_LED_C.png"
|
||||
end
|
||||
if tostring(d) == "1" then
|
||||
top = top.."^jeija_luacontroller_LED_D.png"
|
||||
top = top.."^jeija_microcontroller_LED_D.png"
|
||||
end
|
||||
local groups
|
||||
if tostring(d)..tostring(c)..tostring(b)..tostring(a) ~= "0000" then
|
||||
@ -122,7 +122,7 @@ minetest.register_node(nodename, {
|
||||
elseif fields.bnand then
|
||||
fields.code = "sbi(C, !A|!B) :A and B are inputs, C is output"
|
||||
elseif fields.btflop then
|
||||
fields.code = "if(A)sbi(1,1);if(!A)sbi(B,!B)sbi(1,0); if(C)off(B); :A is input, B is output (Q), C is reset, toggles with falling edge"
|
||||
fields.code = "if(A)sbi(1,1);if(!A)sbi(B,!B)sbi(1,0); if(C)off(B,1); :A is input, B is output (Q), C is reset, toggles with falling edge"
|
||||
elseif fields.brsflop then
|
||||
fields.code = "if(A)on(C);if(B)off(C); :A is S (Set), B is R (Reset), C is output (R dominates)"
|
||||
end
|
||||
|
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_microcontroller
|
||||
Microcontroller=Mikrocontroller
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_microcontroller
|
||||
|
||||
### init.lua ###
|
||||
Microcontroller=Micro-controlleur
|
@ -1,7 +0,0 @@
|
||||
# textdomain: mesecons_movestones
|
||||
|
||||
### init.lua ###
|
||||
Movestone=Pierre mouvante
|
||||
Sticky Movestone=Pierre collante mouvante
|
||||
Vertical Movestone=Pierre mouvante verticalement
|
||||
Vertical Sticky Movestone=Pierre collante mouvante verticalement
|
@ -1,5 +0,0 @@
|
||||
# textdomain: mesecons_movestones
|
||||
Movestone=Laufstein
|
||||
Sticky Movestone=Klebriger Laufstein
|
||||
Vertical Movestone=Vertikaler Laufstein
|
||||
Vertical Sticky Movestone=Vertikaler klebriger Laufstein
|
@ -53,16 +53,11 @@ end
|
||||
|
||||
-- tests if the node can be pushed into, e.g. air, water, grass
|
||||
local function node_replaceable(name)
|
||||
local nodedef = minetest.registered_nodes[name]
|
||||
|
||||
-- everything that can be an mvps stopper (unknown nodes and nodes in the
|
||||
-- mvps_stoppers table) must not be replacable
|
||||
-- Note: ignore (a stopper) is buildable_to, but we do not want to push into it
|
||||
if not nodedef or mesecon.mvps_stoppers[name] then
|
||||
return false
|
||||
if minetest.registered_nodes[name] then
|
||||
return minetest.registered_nodes[name].buildable_to or false
|
||||
end
|
||||
|
||||
return nodedef.buildable_to or false
|
||||
return false
|
||||
end
|
||||
|
||||
function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||
@ -81,9 +76,9 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||
if #nodes > maximum then return nil end
|
||||
|
||||
-- add connected nodes to frontiers
|
||||
local nndef = minetest.registered_nodes[nn.name]
|
||||
if nndef and nndef.mvps_sticky then
|
||||
local connected = nndef.mvps_sticky(np, nn)
|
||||
if minetest.registered_nodes[nn.name]
|
||||
and minetest.registered_nodes[nn.name].mvps_sticky then
|
||||
local connected = minetest.registered_nodes[nn.name].mvps_sticky(np, nn)
|
||||
for _, cp in ipairs(connected) do
|
||||
frontiers:add(cp)
|
||||
end
|
||||
@ -96,9 +91,10 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||
for _, r in ipairs(mesecon.rules.alldirs) do
|
||||
local adjpos = vector.add(np, r)
|
||||
local adjnode = minetest.get_node(adjpos)
|
||||
local adjdef = minetest.registered_nodes[adjnode.name]
|
||||
if adjdef and adjdef.mvps_sticky then
|
||||
local sticksto = adjdef.mvps_sticky(adjpos, adjnode)
|
||||
if minetest.registered_nodes[adjnode.name]
|
||||
and minetest.registered_nodes[adjnode.name].mvps_sticky then
|
||||
local sticksto = minetest.registered_nodes[adjnode.name]
|
||||
.mvps_sticky(adjpos, adjnode)
|
||||
|
||||
-- connects to this position?
|
||||
for _, link in ipairs(sticksto) do
|
||||
|
@ -1,2 +0,0 @@
|
||||
# textdomain: mesecons_noteblock
|
||||
Noteblock=Notenblock
|
@ -1,4 +0,0 @@
|
||||
# textdomain: mesecons_noteblock
|
||||
|
||||
### init.lua ###
|
||||
Noteblock=Bloc de musique
|
@ -270,9 +270,9 @@ minetest.register_node("mesecons_pistons:piston_normal_off", {
|
||||
description = S("Piston"),
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_top.png^[transform2",
|
||||
"mesecons_piston_top.png^[transform3",
|
||||
"mesecons_piston_top.png^[transform1",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_pusher_front.png"
|
||||
},
|
||||
@ -296,9 +296,9 @@ minetest.register_node("mesecons_pistons:piston_normal_on", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_top.png^[transform2",
|
||||
"mesecons_piston_top.png^[transform3",
|
||||
"mesecons_piston_top.png^[transform1",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_on_front.png"
|
||||
},
|
||||
@ -325,9 +325,9 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_pusher_top.png",
|
||||
"mesecons_piston_pusher_top.png^[transform2",
|
||||
"mesecons_piston_pusher_top.png^[transform3",
|
||||
"mesecons_piston_pusher_top.png^[transform1",
|
||||
"mesecons_piston_pusher_bottom.png",
|
||||
"mesecons_piston_pusher_left.png",
|
||||
"mesecons_piston_pusher_right.png",
|
||||
"mesecons_piston_pusher_back.png",
|
||||
"mesecons_piston_pusher_front.png"
|
||||
},
|
||||
@ -349,9 +349,9 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", {
|
||||
description = S("Sticky Piston"),
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_top.png^[transform2",
|
||||
"mesecons_piston_top.png^[transform3",
|
||||
"mesecons_piston_top.png^[transform1",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_pusher_front_sticky.png"
|
||||
},
|
||||
@ -375,9 +375,9 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_top.png",
|
||||
"mesecons_piston_top.png^[transform2",
|
||||
"mesecons_piston_top.png^[transform3",
|
||||
"mesecons_piston_top.png^[transform1",
|
||||
"mesecons_piston_bottom.png",
|
||||
"mesecons_piston_left.png",
|
||||
"mesecons_piston_right.png",
|
||||
"mesecons_piston_back.png",
|
||||
"mesecons_piston_on_front.png"
|
||||
},
|
||||
@ -404,9 +404,9 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"mesecons_piston_pusher_top.png",
|
||||
"mesecons_piston_pusher_top.png^[transform2",
|
||||
"mesecons_piston_pusher_top.png^[transform3",
|
||||
"mesecons_piston_pusher_top.png^[transform1",
|
||||
"mesecons_piston_pusher_bottom.png",
|
||||
"mesecons_piston_pusher_left.png",
|
||||
"mesecons_piston_pusher_right.png",
|
||||
"mesecons_piston_pusher_back.png",
|
||||
"mesecons_piston_pusher_front_sticky.png"
|
||||
},
|
||||
|
@ -1,7 +0,0 @@
|
||||
# textdomain: mesecons_pistons
|
||||
Piston=Kolben
|
||||
Activated Piston Base=Aktivierter Kolbenkörper
|
||||
Piston Pusher=Kolbenschieber
|
||||
Sticky Piston=Haftender Kolben
|
||||
Activated Sticky Piston Base=Aktivierter haftender Kolbenkörper
|
||||
Sticky Piston Pusher=Haftender Kolbenschieber
|
@ -1,9 +0,0 @@
|
||||
# textdomain: mesecons_pistons
|
||||
|
||||
### init.lua ###
|
||||
Piston=Piston
|
||||
Activated Piston Base=Base de piston activé
|
||||
Piston Pusher=Bras de piston
|
||||
Sticky Piston=Piston collant
|
||||
Activated Sticky Piston Base=Base de piston collant activé
|
||||
Sticky Piston Pusher=Bras de piston collant
|
BIN
mesecons_pistons/textures/mesecons_piston_bottom.png
Normal file
After Width: | Height: | Size: 738 B |
BIN
mesecons_pistons/textures/mesecons_piston_left.png
Normal file
After Width: | Height: | Size: 740 B |
BIN
mesecons_pistons/textures/mesecons_piston_pusher_bottom.png
Normal file
After Width: | Height: | Size: 720 B |
BIN
mesecons_pistons/textures/mesecons_piston_pusher_left.png
Normal file
After Width: | Height: | Size: 733 B |