summaryrefslogtreecommitdiff
path: root/mesecons/mesecons_gates
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons/mesecons_gates')
-rw-r--r--mesecons/mesecons_gates/depends.txt6
-rw-r--r--mesecons/mesecons_gates/doc/and/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/and/preview.pngbin69906 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/and/recipe.pngbin2732 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/diode/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/diode/preview.pngbin72562 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/diode/recipe.pngbin2058 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/nand/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/nand/preview.pngbin63320 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/nand/recipe.pngbin2733 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/nor/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/nor/preview.pngbin27039 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/nor/recipe.pngbin2468 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/not/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/not/preview.pngbin70313 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/not/recipe.pngbin2083 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/or/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/or/preview.pngbin26286 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/or/recipe.pngbin2417 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/xor/description.html1
-rw-r--r--mesecons/mesecons_gates/doc/xor/preview.pngbin70940 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/doc/xor/recipe.pngbin2659 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/init.lua134
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_and.pngbin233 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_diode.pngbin231 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_nand.pngbin251 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_nor.pngbin251 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_not.pngbin241 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_off.pngbin195 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_on.pngbin195 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_or.pngbin243 -> 0 bytes
-rw-r--r--mesecons/mesecons_gates/textures/jeija_gate_xor.pngbin245 -> 0 bytes
32 files changed, 0 insertions, 147 deletions
diff --git a/mesecons/mesecons_gates/depends.txt b/mesecons/mesecons_gates/depends.txt
deleted file mode 100644
index f3e0392..0000000
--- a/mesecons/mesecons_gates/depends.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-mesecons
-mesecons_microcontroller
-mesecons_delayer
-
-mesecons_torch
-mesecons_materials
diff --git a/mesecons/mesecons_gates/doc/and/description.html b/mesecons/mesecons_gates/doc/and/description.html
deleted file mode 100644
index eafbeda..0000000
--- a/mesecons/mesecons_gates/doc/and/description.html
+++ /dev/null
@@ -1 +0,0 @@
-And gates power their output if both inputs (from left and right) are powered.
diff --git a/mesecons/mesecons_gates/doc/and/preview.png b/mesecons/mesecons_gates/doc/and/preview.png
deleted file mode 100644
index b2b5301..0000000
--- a/mesecons/mesecons_gates/doc/and/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/and/recipe.png b/mesecons/mesecons_gates/doc/and/recipe.png
deleted file mode 100644
index ae6bf63..0000000
--- a/mesecons/mesecons_gates/doc/and/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/diode/description.html b/mesecons/mesecons_gates/doc/diode/description.html
deleted file mode 100644
index 174fd64..0000000
--- a/mesecons/mesecons_gates/doc/diode/description.html
+++ /dev/null
@@ -1 +0,0 @@
-Mesecon diodes, just like real ones, only transfer power (signals) in one direction only.
diff --git a/mesecons/mesecons_gates/doc/diode/preview.png b/mesecons/mesecons_gates/doc/diode/preview.png
deleted file mode 100644
index ced541b..0000000
--- a/mesecons/mesecons_gates/doc/diode/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/diode/recipe.png b/mesecons/mesecons_gates/doc/diode/recipe.png
deleted file mode 100644
index 71086bf..0000000
--- a/mesecons/mesecons_gates/doc/diode/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/nand/description.html b/mesecons/mesecons_gates/doc/nand/description.html
deleted file mode 100644
index a520fd2..0000000
--- a/mesecons/mesecons_gates/doc/nand/description.html
+++ /dev/null
@@ -1 +0,0 @@
-Nand gates do not power their output if both inputs (from left and right) are powered, but power it in every other case.
diff --git a/mesecons/mesecons_gates/doc/nand/preview.png b/mesecons/mesecons_gates/doc/nand/preview.png
deleted file mode 100644
index d8db780..0000000
--- a/mesecons/mesecons_gates/doc/nand/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/nand/recipe.png b/mesecons/mesecons_gates/doc/nand/recipe.png
deleted file mode 100644
index e6118b3..0000000
--- a/mesecons/mesecons_gates/doc/nand/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/nor/description.html b/mesecons/mesecons_gates/doc/nor/description.html
deleted file mode 100644
index cfcd4c0..0000000
--- a/mesecons/mesecons_gates/doc/nor/description.html
+++ /dev/null
@@ -1 +0,0 @@
-Nor gates only power their output if none of their two inputs is powered. They are basically or gates with a not gate at their output.
diff --git a/mesecons/mesecons_gates/doc/nor/preview.png b/mesecons/mesecons_gates/doc/nor/preview.png
deleted file mode 100644
index b6d2781..0000000
--- a/mesecons/mesecons_gates/doc/nor/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/nor/recipe.png b/mesecons/mesecons_gates/doc/nor/recipe.png
deleted file mode 100644
index a2063c7..0000000
--- a/mesecons/mesecons_gates/doc/nor/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/not/description.html b/mesecons/mesecons_gates/doc/not/description.html
deleted file mode 100644
index 8bd6795..0000000
--- a/mesecons/mesecons_gates/doc/not/description.html
+++ /dev/null
@@ -1 +0,0 @@
-Not gates invert signals, just like a mesecon torch does, but faster. The input is at the opposite side of the output.
diff --git a/mesecons/mesecons_gates/doc/not/preview.png b/mesecons/mesecons_gates/doc/not/preview.png
deleted file mode 100644
index 4a33cd1..0000000
--- a/mesecons/mesecons_gates/doc/not/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/not/recipe.png b/mesecons/mesecons_gates/doc/not/recipe.png
deleted file mode 100644
index ee1c0d6..0000000
--- a/mesecons/mesecons_gates/doc/not/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/or/description.html b/mesecons/mesecons_gates/doc/or/description.html
deleted file mode 100644
index 0a74abd..0000000
--- a/mesecons/mesecons_gates/doc/or/description.html
+++ /dev/null
@@ -1 +0,0 @@
-Or gates power their output if either of their inputs (or both) are powered. You could basically get the same behaviour with two diodes, but or gates save some space.
diff --git a/mesecons/mesecons_gates/doc/or/preview.png b/mesecons/mesecons_gates/doc/or/preview.png
deleted file mode 100644
index b7a8cdc..0000000
--- a/mesecons/mesecons_gates/doc/or/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/or/recipe.png b/mesecons/mesecons_gates/doc/or/recipe.png
deleted file mode 100644
index b94169d..0000000
--- a/mesecons/mesecons_gates/doc/or/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/xor/description.html b/mesecons/mesecons_gates/doc/xor/description.html
deleted file mode 100644
index f52f3fc..0000000
--- a/mesecons/mesecons_gates/doc/xor/description.html
+++ /dev/null
@@ -1 +0,0 @@
-XOR gates power their output if only one input is powered, they're off if either both or none of the inputs is powered.
diff --git a/mesecons/mesecons_gates/doc/xor/preview.png b/mesecons/mesecons_gates/doc/xor/preview.png
deleted file mode 100644
index 3d3941e..0000000
--- a/mesecons/mesecons_gates/doc/xor/preview.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/doc/xor/recipe.png b/mesecons/mesecons_gates/doc/xor/recipe.png
deleted file mode 100644
index 1e129bf..0000000
--- a/mesecons/mesecons_gates/doc/xor/recipe.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/init.lua b/mesecons/mesecons_gates/init.lua
deleted file mode 100644
index f3d6f09..0000000
--- a/mesecons/mesecons_gates/init.lua
+++ /dev/null
@@ -1,134 +0,0 @@
-local nodebox = {
- type = "fixed",
- fixed = {{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16 }},
-}
-
-local function gate_rotate_rules(node, rules)
- for rotations = 0, node.param2 - 1 do
- rules = mesecon.rotate_rules_left(rules)
- end
- return rules
-end
-
-local function gate_get_output_rules(node)
- return gate_rotate_rules(node, {{x=1, y=0, z=0}})
-end
-
-local function gate_get_input_rules_oneinput(node)
- return gate_rotate_rules(node, {{x=-1, y=0, z=0}})
-end
-
-local function gate_get_input_rules_twoinputs(node)
- return gate_rotate_rules(node, {{x=0, y=0, z=1, name="input1"},
- {x=0, y=0, z=-1, name="input2"}})
-end
-
-local function set_gate(pos, node, state)
- local gate = minetest.registered_nodes[node.name]
-
- if mesecon.do_overheat(pos) then
- minetest.remove_node(pos)
- mesecon.receptor_off(pos, gate_get_output_rules(node))
- minetest.add_item(pos, gate.drop)
- elseif state then
- minetest.swap_node(pos, {name = gate.onstate, param2=node.param2})
- mesecon.receptor_on(pos, gate_get_output_rules(node))
- else
- minetest.swap_node(pos, {name = gate.offstate, param2=node.param2})
- mesecon.receptor_off(pos, gate_get_output_rules(node))
- end
-end
-
-local function update_gate(pos, node, link, newstate)
- local gate = minetest.registered_nodes[node.name]
-
- if gate.inputnumber == 1 then
- set_gate(pos, node, gate.assess(newstate == "on"))
- elseif gate.inputnumber == 2 then
- local meta = minetest.get_meta(pos)
- meta:set_int(link.name, newstate == "on" and 1 or 0)
-
- local val1 = meta:get_int("input1") == 1
- local val2 = meta:get_int("input2") == 1
- set_gate(pos, node, gate.assess(val1, val2))
- end
-end
-
-function register_gate(name, inputnumber, assess, recipe)
- local get_inputrules = inputnumber == 2 and gate_get_input_rules_twoinputs or
- gate_get_input_rules_oneinput
- local description = "Mesecons Logic Gate: "..name
-
- local basename = "mesecons_gates:"..name
- mesecon.register_node(basename, {
- description = description,
- inventory_image = "jeija_gate_off.png^jeija_gate_"..name..".png",
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "nodebox",
- drop = basename.."_off",
- selection_box = nodebox,
- node_box = nodebox,
- walkable = true,
- sounds = default.node_sound_stone_defaults(),
- assess = assess,
- onstate = basename.."_on",
- offstate = basename.."_off",
- inputnumber = inputnumber
- },{
- tiles = {"jeija_microcontroller_bottom.png^".."jeija_gate_off.png^"..
- "jeija_gate_"..name..".png"},
- groups = {dig_immediate = 2, overheat = 1},
- mesecons = { receptor = {
- state = "off",
- rules = gate_get_output_rules
- }, effector = {
- rules = get_inputrules,
- action_change = update_gate
- }}
- },{
- tiles = {"jeija_microcontroller_bottom.png^".."jeija_gate_on.png^"..
- "jeija_gate_"..name..".png"},
- groups = {dig_immediate = 2, not_in_creative_inventory = 1, overheat = 1},
- mesecons = { receptor = {
- state = "on",
- rules = gate_get_output_rules
- }, effector = {
- rules = get_inputrules,
- action_change = update_gate
- }}
- })
-
- minetest.register_craft({output = basename.."_off", recipe = recipe})
-end
-
-register_gate("diode", 1, function (input) return input end,
- {{"mesecons:mesecon", "mesecons_torch:mesecon_torch_on", "mesecons_torch:mesecon_torch_on"}})
-
-register_gate("not", 1, function (input) return not input end,
- {{"mesecons:mesecon", "mesecons_torch:mesecon_torch_on", "mesecons:mesecon"}})
-
-register_gate("and", 2, function (val1, val2) return val1 and val2 end,
- {{"mesecons:mesecon", "", ""},
- {"", "mesecons_materials:silicon", "mesecons:mesecon"},
- {"mesecons:mesecon", "", ""}})
-
-register_gate("nand", 2, function (val1, val2) return not (val1 and val2) end,
- {{"mesecons:mesecon", "", ""},
- {"", "mesecons_materials:silicon", "mesecons_torch:mesecon_torch_on"},
- {"mesecons:mesecon", "", ""}})
-
-register_gate("xor", 2, function (val1, val2) return (val1 or val2) and not (val1 and val2) end,
- {{"mesecons:mesecon", "", ""},
- {"", "mesecons_materials:silicon", "mesecons_materials:silicon"},
- {"mesecons:mesecon", "", ""}})
-
-register_gate("nor", 2, function (val1, val2) return not (val1 or val2) end,
- {{"mesecons:mesecon", "", ""},
- {"", "mesecons:mesecon", "mesecons_torch:mesecon_torch_on"},
- {"mesecons:mesecon", "", ""}})
-
-register_gate("or", 2, function (val1, val2) return (val1 or val2) end,
- {{"mesecons:mesecon", "", ""},
- {"", "mesecons:mesecon", "mesecons:mesecon"},
- {"mesecons:mesecon", "", ""}})
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_and.png b/mesecons/mesecons_gates/textures/jeija_gate_and.png
deleted file mode 100644
index 0ddc043..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_and.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_diode.png b/mesecons/mesecons_gates/textures/jeija_gate_diode.png
deleted file mode 100644
index ffa403f..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_diode.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_nand.png b/mesecons/mesecons_gates/textures/jeija_gate_nand.png
deleted file mode 100644
index 0e4294e..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_nand.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_nor.png b/mesecons/mesecons_gates/textures/jeija_gate_nor.png
deleted file mode 100644
index c4298e3..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_nor.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_not.png b/mesecons/mesecons_gates/textures/jeija_gate_not.png
deleted file mode 100644
index 939fb76..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_not.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_off.png b/mesecons/mesecons_gates/textures/jeija_gate_off.png
deleted file mode 100644
index 44017b0..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_off.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_on.png b/mesecons/mesecons_gates/textures/jeija_gate_on.png
deleted file mode 100644
index 47028a8..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_on.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_or.png b/mesecons/mesecons_gates/textures/jeija_gate_or.png
deleted file mode 100644
index 09f0661..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_or.png
+++ /dev/null
Binary files differ
diff --git a/mesecons/mesecons_gates/textures/jeija_gate_xor.png b/mesecons/mesecons_gates/textures/jeija_gate_xor.png
deleted file mode 100644
index afbd6ab..0000000
--- a/mesecons/mesecons_gates/textures/jeija_gate_xor.png
+++ /dev/null
Binary files differ