2016-04-01 20:02:19 -04:00
|
|
|
-- Solar Panel
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
mesecon.register_node("mesecons_solarpanel:solar_panel", {
|
|
|
|
description = "Solar Panel",
|
2016-04-01 20:02:19 -04:00
|
|
|
drawtype = "nodebox",
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
tiles = {"mesecons_solarpanel.png"},
|
|
|
|
inventory_image = "mesecons_solarpanel.png",
|
|
|
|
wield_image = "mesecons_solarpanel.png",
|
2016-04-01 20:02:19 -04:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
walkable = false,
|
removed boost_cart and carbone_mobs -- too many crashes
updated blox, homedecor, plantlifed, cottages, farming_redo,
framedglass, gloopblocks, mesecons, moreblocks, moretrees,
pipeworks, player_textures, replacer, signs_lib, stained_glass,
technic, travelnet, unified_inventory, unifieddyes, and worldedit.
2018-02-13 14:05:34 -05:00
|
|
|
is_ground_content = false,
|
2016-04-01 20:02:19 -04:00
|
|
|
node_box = {
|
|
|
|
type = "wallmounted",
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
wall_bottom = {-7/16, -8/16, -7/16, 7/16, -7/16, 7/16},
|
|
|
|
wall_top = {-7/16, 7/16, -7/16, 7/16, 8/16, 7/16},
|
|
|
|
wall_side = {-8/16, -7/16, -7/16, -7/16, 7/16, 7/16},
|
2016-04-01 20:02:19 -04:00
|
|
|
},
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
updated boost cart, homedecor modpack, castles modpack, currency, farming-redo,
maptools, mesecons, moreblocks, moreores, pipeworks, quartz
2017-10-27 15:13:31 -04:00
|
|
|
on_blast = mesecon.on_blastnode,
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
},{
|
|
|
|
groups = {dig_immediate = 3},
|
2016-04-01 20:02:19 -04:00
|
|
|
mesecons = {receptor = {
|
updated boost cart, homedecor modpack, castles modpack, currency, farming-redo,
maptools, mesecons, moreblocks, moreores, pipeworks, quartz
2017-10-27 15:13:31 -04:00
|
|
|
state = mesecon.state.off,
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
rules = mesecon.rules.wallmounted_get
|
|
|
|
}}
|
|
|
|
},{
|
|
|
|
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
|
|
|
|
mesecons = {receptor = {
|
|
|
|
state = mesecon.state.on,
|
|
|
|
rules = mesecon.rules.wallmounted_get
|
updated boost cart, homedecor modpack, castles modpack, currency, farming-redo,
maptools, mesecons, moreblocks, moreores, pipeworks, quartz
2017-10-27 15:13:31 -04:00
|
|
|
}},
|
2016-04-01 20:02:19 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
output = "mesecons_solarpanel:solar_panel_off",
|
2016-04-01 20:02:19 -04:00
|
|
|
recipe = {
|
|
|
|
{"mesecons_materials:silicon", "mesecons_materials:silicon"},
|
|
|
|
{"mesecons_materials:silicon", "mesecons_materials:silicon"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
minetest.register_abm({
|
|
|
|
label = "Solar Panel On/Off",
|
|
|
|
nodenames = {
|
|
|
|
"mesecons_solarpanel:solar_panel_off",
|
|
|
|
"mesecons_solarpanel:solar_panel_on"
|
|
|
|
},
|
2016-04-01 20:02:19 -04:00
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
catch_up = false,
|
2019-11-03 13:17:36 -05:00
|
|
|
action = function(pos, node)
|
|
|
|
local light = minetest.get_node_light(pos)
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
if light >= 12 and node.name == "mesecons_solarpanel:solar_panel_off" then
|
updated boost cart, homedecor modpack, castles modpack, currency, farming-redo,
maptools, mesecons, moreblocks, moreores, pipeworks, quartz
2017-10-27 15:13:31 -04:00
|
|
|
node.name = "mesecons_solarpanel:solar_panel_on"
|
|
|
|
minetest.swap_node(pos, node)
|
|
|
|
mesecon.receptor_on(pos, mesecon.rules.wallmounted_get(node))
|
update bakedclay, basic_materials, bonemeal, currency, farming_redo,
maptools, mesecons, moreblocks, moreores, new_campfire, cool_trees,
pipeworks, staines_glass, technic, unified_inventory, and unifieddyes.
2020-07-12 08:03:52 -04:00
|
|
|
elseif light < 12 and node.name == "mesecons_solarpanel:solar_panel_on" then
|
updated boost cart, homedecor modpack, castles modpack, currency, farming-redo,
maptools, mesecons, moreblocks, moreores, pipeworks, quartz
2017-10-27 15:13:31 -04:00
|
|
|
node.name = "mesecons_solarpanel:solar_panel_off"
|
|
|
|
minetest.swap_node(pos, node)
|
|
|
|
mesecon.receptor_off(pos, mesecon.rules.wallmounted_get(node))
|
2016-04-01 20:02:19 -04:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|