Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gpu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ end

minetest.register_node("digistuff:gpu", {
description = "Digilines 2D Graphics Processor",
groups = { cracky = 3 },
groups = { cracky = 3, heatsinkable = 1 },
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
Expand Down
2 changes: 1 addition & 1 deletion ioexpander.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ for i=0,15,1 do
local offstate = i == 0
minetest.register_node("digistuff:ioexpander_"..i, {
description = offstate and "Digilines I/O Expander" or string.format("Digilines I/O Expander (on state %X - you hacker you!)",i),
groups = offstate and {cracky = 3,} or {cracky = 3,not_in_creative_inventory = 1,},
groups = {cracky = 3,heatsinkable=1,not_in_creative_inventory = (not offstate) and 1,},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
Expand Down
4 changes: 2 additions & 2 deletions memory.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minetest.register_node("digistuff:ram", {
description = "Digilines 128Kbit SRAM",
groups = {cracky=3},
groups = {cracky=3, heatsinkable=1},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
Expand Down Expand Up @@ -64,7 +64,7 @@ minetest.register_node("digistuff:ram", {

minetest.register_node("digistuff:eeprom", {
description = "Digilines 128Kbit EEPROM",
groups = {cracky=3},
groups = {cracky=3, heatsinkable=1},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
Expand Down
2 changes: 1 addition & 1 deletion nic.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local http = ...
minetest.register_node("digistuff:nic", {
description = "Digilines NIC",
groups = {cracky=3},
groups = {cracky=3, heatsinkable=1},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
Expand Down
34 changes: 24 additions & 10 deletions sillystuff.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
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 > 1 and "1" or "0"
local bit2 = i % 8 > 3 and "1" or "0"
local bit3 = i % 16 > 7 and "1" or "0"
heatsinkable_nodes["mesecons_luacontroller:luacontroller" .. bit0 .. bit1 .. bit2 .. bit3] = true
heatsinkable_nodes["mooncontroller:mooncontroller" .. bit0 .. bit1 .. bit2 .. bit3] = true
heatsinkable_nodes["digistuff:ioexpander_" .. i] = true
local bits = bit0 .. bit1 .. bit2 .. bit3
do
local name = "mesecons_luacontroller:luacontroller" .. bits
local def = core.registered_nodes[name]
if def then
local groups = table.copy(def.groups)
groups.heatsinkable = 1
core.override_item(name, {
groups = groups
})
end
end
do
local name = "mooncontroller:mooncontroller" .. bits
local def = core.registered_nodes[name]
if def then
local groups = table.copy(def.groups)
groups.heatsinkable = 1
core.override_item(name, {
groups = groups
})
end
end
end

minetest.register_node("digistuff:heatsink", {
Expand Down Expand Up @@ -46,7 +60,7 @@ minetest.register_node("digistuff:heatsink", {
},
after_place_node = function(pos)
local icpos = vector.add(pos,vector.new(0,-1,0))
if heatsinkable_nodes[minetest.get_node(icpos).name] then
if core.get_item_group(core.get_node(icpos).name, "heatsinkable") then
minetest.set_node(pos,{name = "digistuff:heatsink_onic"})
end
end,
Expand Down