box recipe bugfix

dig box node bugfix
planting bugfix
This commit is contained in:
Joachim Stolberg 2019-07-07 22:09:16 +02:00
parent e82949378d
commit e07d61f3f4
10 changed files with 24 additions and 15 deletions

View File

@ -241,16 +241,20 @@ minetest.register_node("signs_bot:box", {
allow_metadata_inventory_take = allow_metadata_inventory_take,
allow_metadata_inventory_move = allow_metadata_inventory_move,
on_dig = function(pos, node, puncher, pointed_thing)
if minetest.is_protected(pos, puncher:get_player_name()) then
can_dig = function(pos, player)
if minetest.is_protected(pos, player:get_player_name()) then
return
end
local mem = tubelib2.get_mem(pos)
if mem.running then
return
end
local inv = M(pos):get_inventory()
return inv:is_empty("main") and inv:is_empty("sign")
end,
on_dig = function(pos, node, puncher, pointed_thing)
minetest.node_dig(pos, node, puncher, pointed_thing)
--tubelib.remove_node(pos)
end,
on_timer = node_timer,
@ -268,7 +272,7 @@ if minetest.global_exists("techage") then
output = "signs_bot:box",
recipe = {
{"default:steel_ingot", "group:wood", "default:steel_ingot"},
{"basic_materials:motor", "techage:wlanchip", "basic_materials:gear_steel"},
{"basic_materials:motor", "techage:ta4_wlanchip", "basic_materials:gear_steel"},
{"default:tin_ingot", "", "default:tin_ingot"}
}
})

View File

@ -53,7 +53,7 @@ local function planting(base_pos, mem, slot)
local stack = inv_get_item(base_pos, slot)
local plant = stack:get_name()
local item = stack and signs_bot.FarmingSeed[plant]
if item and item.seed then
if plant and minetest.registered_nodes[plant] and item and item.seed then
local p2 = minetest.registered_nodes[plant].place_param2 or 1
minetest.set_node(pos, {name = item.seed, param2 = p2})
minetest.sound_play("default_place_node", {pos = pos, gain = 1.0})

Binary file not shown.

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-06-29 00:01+0200\n"
"PO-Revision-Date: 2019-06-29 00:05+0200\n"
"PO-Revision-Date: 2019-07-06 21:25+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\n"
@ -779,7 +779,7 @@ msgstr "Ernte Sensor: Verbunden mit "
#: crop_sensor.lua
msgid "Crop Sensor"
msgstr "Ernte Sesor"
msgstr "Ernte Sensor"
#: crop_sensor.lua
msgid "The Crop Sensor sends a signal when, for example wheat is fully grown."

View File

@ -23,10 +23,15 @@ local lib = signs_bot.lib
function signs_bot.get_node_type(pos)
local node = lib.get_node_lvm(pos)
local ndef = minetest.registered_nodes[node.name]
if ndef and ndef.signs_bot_get_signal then
return "actuator"
elseif minetest.get_item_group(node.name, "sign_bot_sensor") == 1 then
return "sensor"
local is_sensor = minetest.get_item_group(node.name, "sign_bot_sensor") == 1
if ndef then
if ndef.signs_bot_get_signal and is_sensor then
return "repeater"
elseif ndef.signs_bot_get_signal then
return "actuator"
elseif is_sensor then
return "sensor"
end
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 233 B

View File

@ -96,22 +96,22 @@ local function node_timer(pos)
end
local function on_receive_fields(pos, formname, fields, player)
local mem = tubelib2.get_mem(pos)
local meta = M(pos)
if minetest.is_protected(pos, player:get_player_name()) then
return
end
if fields.key_enter_field == "time" or fields.start then
local mem = tubelib2.get_mem(pos)
local cycle_time = tonumber(fields.time)
if cycle_time and cycle_time > 0 and cycle_time < 9999 then
M(pos):set_int("cycle_time", cycle_time)
meta:set_int("cycle_time", cycle_time)
mem.time = cycle_time * 60
elseif cycle_time == 0 then
minetest.get_node_timer(pos):stop()
mem.time = 0
M(pos):set_int("cycle_time", 0)
meta:set_int("cycle_time", 0)
end
end
local meta = M(pos)
meta:set_string("formspec", formspec(meta))
update_infotext_local(pos)
end