Add a setting for disabling the wireless jammer

Fixes #17
This commit is contained in:
upsilon 2021-03-07 10:23:29 +01:00
parent 227cba54b2
commit 021100b3d4
2 changed files with 75 additions and 70 deletions

View File

@ -330,6 +330,15 @@ mesecon.register_node("moremesecons_wireless:wireless", {
minetest.register_alias("moremesecons_wireless:wireless", "moremesecons_wireless:wireless_off") minetest.register_alias("moremesecons_wireless:wireless", "moremesecons_wireless:wireless_off")
minetest.register_craft({
output = "moremesecons_wireless:wireless_off 2",
recipe = {
{"group:mesecon_conductor_craftable", "", "group:mesecon_conductor_craftable"},
{"", "mesecons_torch:mesecon_torch_on", ""},
{"group:mesecon_conductor_craftable", "", "group:mesecon_conductor_craftable"},
}
})
local function remove_jammer(pos) local function remove_jammer(pos)
moremesecons.remove_data_from_pos(jammers, pos) moremesecons.remove_data_from_pos(jammers, pos)
end end
@ -357,6 +366,7 @@ function is_jammed(pos)
return false return false
end end
if moremesecons.setting("wireless", "enable_jammer", true) then
mesecon.register_node("moremesecons_wireless:jammer", { mesecon.register_node("moremesecons_wireless:jammer", {
description = "Wireless Jammer", description = "Wireless Jammer",
paramtype = "light", paramtype = "light",
@ -425,15 +435,7 @@ minetest.register_craft({
{"moremesecons_wireless:wireless", "mesecons_torch:mesecon_torch_on", "moremesecons_wireless:wireless"} {"moremesecons_wireless:wireless", "mesecons_torch:mesecon_torch_on", "moremesecons_wireless:wireless"}
} }
}) })
end
minetest.register_craft({
output = "moremesecons_wireless:wireless_off 2",
recipe = {
{"group:mesecon_conductor_craftable", "", "group:mesecon_conductor_craftable"},
{"", "mesecons_torch:mesecon_torch_on", ""},
{"group:mesecon_conductor_craftable", "", "group:mesecon_conductor_craftable"},
}
})
if moremesecons.setting("wireless", "enable_lbm", false) then if moremesecons.setting("wireless", "enable_lbm", false) then
minetest.register_lbm({ minetest.register_lbm({

View File

@ -63,6 +63,9 @@ moremesecons_teleporter.enable_lbm (Enable Registration LBM) bool false
[Wireless] [Wireless]
# Whether to enable the wireless jammer node
moremesecons_wireless.enable_jammer (Enable wireless jammer) bool true
# Wireless Jammer action range # Wireless Jammer action range
# Any value less than or equal to 0 will be changed to 1 and a NaN value will be changed to the default value # Any value less than or equal to 0 will be changed to 1 and a NaN value will be changed to the default value
moremesecons_wireless.jammer_max_distance (Wireless Jammer action range) float 15 moremesecons_wireless.jammer_max_distance (Wireless Jammer action range) float 15