summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2021-01-29 21:22:58 -0600
committercheapie <no-email-for-you@example.com>2021-01-29 21:22:58 -0600
commitfae9422116e7d27798a0fe2c0fb28a9c120a3cde (patch)
tree5c1ede08634bcc0ac6ccc6d4eda9bf715ff744b9
parent813ada878ea0d284ec9000ad6ee5ec665383bcee (diff)
downloaddigistuff-fae9422116e7d27798a0fe2c0fb28a9c120a3cde.tar
digistuff-fae9422116e7d27798a0fe2c0fb28a9c120a3cde.tar.gz
digistuff-fae9422116e7d27798a0fe2c0fb28a9c120a3cde.tar.bz2
digistuff-fae9422116e7d27798a0fe2c0fb28a9c120a3cde.tar.xz
digistuff-fae9422116e7d27798a0fe2c0fb28a9c120a3cde.zip
Add heatsink (decorative only)
-rw-r--r--init.lua1
-rw-r--r--sillystuff.lua94
2 files changed, 95 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 77d8e8a..84b5b37 100644
--- a/init.lua
+++ b/init.lua
@@ -18,6 +18,7 @@ local components = {
"controller",
"memory",
"gpu",
+ "sillystuff",
}
if minetest.get_modpath("mesecons_luacontroller") then table.insert(components,"ioexpander") end
diff --git a/sillystuff.lua b/sillystuff.lua
new file mode 100644
index 0000000..432c1ee
--- /dev/null
+++ b/sillystuff.lua
@@ -0,0 +1,94 @@
+local heatsinkable_nodes = {
+ ["digistuff:nic"] = true,
+ ["digistuff:gpu"] = true,
+ ["digistuff:ram"] = true,
+ ["digistuff:eeprom"] = true,
+}
+
+for i=0,15,1 do
+ local bit0 = i%2>0 and "1" or "0"
+ local bit1 = i%4>2 and "1" or "0"
+ local bit2 = i%8>4 and "1" or "0"
+ local bit3 = i%16>8 and "1" or "0"
+ heatsinkable_nodes["mesecons_luacontroller:luacontroller"..bit0..bit1..bit2..bit3] = true
+ heatsinkable_nodes["digistuff:ioexpander_"..i] = true
+end
+
+minetest.register_node("digistuff:heatsink", {
+ description = "Heatsink (decorative)",
+ groups = {cracky=3},
+ tiles = {
+ "digistuff_piezo_sides.png"
+ },
+ drawtype = "nodebox",
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.19,-0.5,-0.2,0.19,-0.3,0.2 },
+ },
+ node_box = {
+ --From Luacontroller
+ type = "fixed",
+ fixed = {
+ {-0.19, -0.5,-0.2, 0.19, -0.45, 0.2}, -- Base
+ {-0.19,-0.45,-0.2,-0.17, -0.3, 0.2},
+ {-0.15,-0.45,-0.2,-0.13, -0.3, 0.2},
+ {-0.11,-0.45,-0.2,-0.09, -0.3, 0.2},
+ {-0.07,-0.45,-0.2,-0.05, -0.3, 0.2},
+ {-0.03,-0.45,-0.2,-0.01, -0.3, 0.2},
+ { 0.19,-0.45,-0.2, 0.17, -0.3, 0.2},
+ { 0.15,-0.45,-0.2, 0.13, -0.3, 0.2},
+ { 0.11,-0.45,-0.2, 0.09, -0.3, 0.2},
+ { 0.07,-0.45,-0.2, 0.05, -0.3, 0.2},
+ { 0.03,-0.45,-0.2, 0.01, -0.3, 0.2},
+ }
+ },
+ after_place_node = function(pos)
+ local icpos = vector.add(pos,vector.new(0,-1,0))
+ if heatsinkable_nodes[minetest.get_node(icpos).name] then
+ minetest.set_node(pos,{name = "digistuff:heatsink_onic"})
+ end
+ end,
+ paramtype = "light",
+ sunlight_propagates = true,
+})
+
+minetest.register_node("digistuff:heatsink_onic", {
+ drop = "digistuff:heatsink",
+ description = "Heatsink (decorative, placed on IC - you hacker you!)",
+ groups = {cracky=3,not_in_creative_inventory=1,},
+ tiles = {
+ "digistuff_piezo_sides.png"
+ },
+ drawtype = "nodebox",
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.19,-1.3125,-0.2,0.19,-1.1525,0.2 },
+ },
+ node_box = {
+ --From Luacontroller
+ type = "fixed",
+ fixed = {
+ {-0.19, -1.3125,-0.2, 0.19, -1.2625, 0.2}, -- Base
+ {-0.19,-1.2625,-0.2,-0.17, -1.1525, 0.2},
+ {-0.15,-1.2625,-0.2,-0.13, -1.1525, 0.2},
+ {-0.11,-1.2625,-0.2,-0.09, -1.1525, 0.2},
+ {-0.07,-1.2625,-0.2,-0.05, -1.1525, 0.2},
+ {-0.03,-1.2625,-0.2,-0.01, -1.1525, 0.2},
+ { 0.19,-1.2625,-0.2, 0.17, -1.1525, 0.2},
+ { 0.15,-1.2625,-0.2, 0.13, -1.1525, 0.2},
+ { 0.11,-1.2625,-0.2, 0.09, -1.1525, 0.2},
+ { 0.07,-1.2625,-0.2, 0.05, -1.1525, 0.2},
+ { 0.03,-1.2625,-0.2, 0.01, -1.1525, 0.2},
+ }
+ },
+ paramtype = "light",
+ sunlight_propagates = true,
+})
+
+minetest.register_craft({
+ output = "digistuff:heatsink",
+ recipe = {
+ {"basic_materials:steel_strip","basic_materials:steel_strip","basic_materials:steel_strip"},
+ {"","default:steel_ingot",""}
+ }
+})