Compare commits

..

4 Commits

Author SHA1 Message Date
1afb8f77a0 remove default dependency 2022-08-18 16:45:35 +02:00
loosewheel
69445d1eb4 Add files via upload 2022-08-11 00:44:04 +10:00
loosewheel
7b9d711a91 Add files via upload 2022-08-11 00:41:31 +10:00
loosewheel
cd3f250303 Add files via upload 2022-08-09 20:53:32 +10:00
33 changed files with 539 additions and 426 deletions

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -223,29 +223,6 @@ end
local function eject_item (pos, stack, eject_pos)
if utils.pipeworks_supported then
local node = utils.get_far_node (eject_pos)
if node and minetest.get_item_group (node.name, "tube") > 0 then
local owner = nil
local meta = minetest.get_meta (pos)
if meta then
local o = meta:get_string ("owner")
if o ~= "" then
owner = o
end
end
local vel = vector.subtract (eject_pos, pos)
pipeworks.tube_inject_item (pos, pos, vel, stack, owner)
return
end
end
utils.item_drop (stack, nil, eject_pos)
end
@@ -739,7 +716,6 @@ minetest.register_node("lwcomponents:breaker", {
"lwbreaker.png", "lwbreaker_rear.png", "lwbreaker_face.png"},
is_ground_content = false,
groups = table.copy (breaker_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -770,7 +746,6 @@ minetest.register_node("lwcomponents:breaker_locked", {
"lwbreaker.png", "lwbreaker_rear.png", "lwbreaker_face.png"},
is_ground_content = false,
groups = table.copy (breaker_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -802,7 +777,6 @@ minetest.register_node("lwcomponents:breaker_on", {
"lwbreaker.png", "lwbreaker_rear.png", "lwbreaker_face_on.png"},
is_ground_content = false,
groups = table.copy (breaker_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -834,7 +808,6 @@ minetest.register_node("lwcomponents:breaker_locked_on", {
"lwbreaker.png", "lwbreaker_rear.png", "lwbreaker_face_on.png"},
is_ground_content = false,
groups = table.copy (breaker_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -888,4 +861,3 @@ utils.hopper_add_container({
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -386,7 +386,6 @@ minetest.register_node("lwcomponents:camera", {
"lwcamera.png", "lwcamera.png", "lwcamera_lens.png"},
is_ground_content = false,
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -412,7 +411,6 @@ minetest.register_node("lwcomponents:camera_locked", {
"lwcamera.png", "lwcamera.png", "lwcamera_lens.png"},
is_ground_content = false,
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",

View File

@@ -1011,7 +1011,6 @@ minetest.register_node("lwcomponents:cannon", {
inventory_image = "lwcannon_item.png",
is_ground_content = false,
groups = table.copy (cannon_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
paramtype2 = "facedir",
param2 = 0,
@@ -1075,7 +1074,6 @@ minetest.register_node("lwcomponents:cannon_locked", {
inventory_image = "lwcannon_item.png",
is_ground_content = false,
groups = table.copy (cannon_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
paramtype2 = "facedir",
param2 = 0,

View File

@@ -184,3 +184,15 @@ v0.1.30
v0.1.31
* Added crafter.
v0.1.32
* Fixed crafter not return replacement items properly.
v0.1.33
* Added recipe list when crafting by item to UI in crafters.
* Added results message for crafters digilines messages "craft" and "craftitem".
* Added "can_craft" digilines message to crafters.
* Fixed crafter not outputing all items when output has full stack.
* Improved crafter crafting.

View File

@@ -549,7 +549,6 @@ minetest.register_node("lwcomponents:collector", {
"lwcollector.png", "lwcollector.png", "lwcollector.png"},
is_ground_content = false,
groups = table.copy (collector_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -577,7 +576,6 @@ minetest.register_node("lwcomponents:collector_locked", {
"lwcollector.png", "lwcollector.png", "lwcollector.png"},
is_ground_content = false,
groups = table.copy (collector_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -605,7 +603,6 @@ minetest.register_node("lwcomponents:collector_on", {
"lwcollector_on.png", "lwcollector_on.png", "lwcollector_on.png"},
is_ground_content = false,
groups = table.copy (collector_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -633,7 +630,6 @@ minetest.register_node("lwcomponents:collector_locked_on", {
"lwcollector_on.png", "lwcollector_on.png", "lwcollector_on.png"},
is_ground_content = false,
groups = table.copy (collector_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,

View File

@@ -1075,7 +1075,6 @@ minetest.register_node("lwcomponents:conduit", {
},
is_ground_content = false,
groups = table.copy (conduit_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "none",
@@ -1146,7 +1145,6 @@ minetest.register_node("lwcomponents:conduit_locked", {
},
is_ground_content = false,
groups = table.copy (conduit_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "none",

View File

@@ -331,12 +331,12 @@ end
-- removes items from storage and returns list where they were taken from or nil
local function get_input_items (items, inv_list)
-- tests storage for input items and returns list where they would be taken from or nil
local function check_input_items (items, inv_list)
local agg = { }
local input = { }
for i = 1, 9, 1 do
for i = 1, #items, 1 do
if items[i] then
if items[i]:len () > 0 then
if agg[items[i]] then
@@ -371,9 +371,10 @@ local function get_input_items (items, inv_list)
count = list[i].count
}
list.count = list.count - list[i].count
count = count - list[i].count
list[i] = nil
table.remove (list, i)
else
input[#input + 1] =
{
@@ -384,28 +385,39 @@ local function get_input_items (items, inv_list)
}
list[i].count = list[i].count - count
list.count = list.count - count
count = 0
end
if count < 1 then
break
end
end
end
for i = 1, #input, 1 do
if not remove_input_items (input[i]) then
-- put back
for j = i - 1, 1, -1 do
return_input_items (input[j])
end
return input
end
return nil
-- removes items from storage and returns input_items or nil
local function get_input_items (input_items)
if input_items then
for i = 1, #input_items, 1 do
if not remove_input_items (input_items[i]) then
-- put back
for j = i - 1, 1, -1 do
return_input_items (input_items[j])
end
return nil
end
end
end
return input
return input_items
end
@@ -435,7 +447,7 @@ local function can_fit_output (pos, output)
for j = 1, #list, 1 do
if utils.is_same_item (list[j], copy[i]) then
if (list[j]:get_count () + copy[i]:get_count ()) > list[j]:get_stack_max () then
copy[i]:set_count (list[j]:get_stack_max () - list[j]:get_count ())
copy[i]:set_count (copy[i]:get_count () - (list[j]:get_stack_max () - list[j]:get_count ()))
list[j]:set_count (list[j]:get_stack_max ())
else
list[j]:set_count (list[j]:get_count () + copy[i]:get_count ())
@@ -505,7 +517,9 @@ local function craft (pos, items, recipe, qty, inv_list)
if output and output.item and not output.item:is_empty () then
for q = 1, qty, 1 do
-- check for output space
local src_items = table.copy (items)
-- output itemstacks
local output_items = { ItemStack (output.item) }
for i = 1, #output.replacements, 1 do
if output.replacements[i] and not output.replacements[i]:is_empty () then
@@ -513,9 +527,30 @@ local function craft (pos, items, recipe, qty, inv_list)
end
end
-- adjust leftovers
for i = 1, #leftover.items, 1 do
if leftover.items[i] and not leftover.items[i]:is_empty () then
local count = leftover.items[i]:get_count ()
for j = #src_items, 1, -1 do
if src_items[j] == leftover.items[i]:get_name () then
table.remove (src_items, j)
count = count - 1
if count < 1 then
break
end
end
end
if count > 0 then
output_items[#output_items + 1] = ItemStack (leftover.items[i]:get_name ().." "..tostring (count))
end
end
end
-- implement crafting_mods.lua
local mods = utils.get_crafting_mods (output.item:get_name ())
local remove_items = { }
if mods then
if mods.add then
for i = 1, #mods.add do
@@ -540,67 +575,37 @@ local function craft (pos, items, recipe, qty, inv_list)
end
if not found then
remove_items[#remove_items + 1] = mods.remove[i]
src_items[#src_items + 1] = mods.remove[i]
end
end
end
end
-- get updated output inv if can fit
local input_items = check_input_items (src_items, inv_list)
if not input_items then
return crafted
end
local output_list = can_fit_output (pos, output_items)
if output_list then
local input_items = get_input_items (items, inv_list)
if not input_items then
return crafted
end
if not update_output (pos, output_list) then
for j = 1, #input_items, 1 do
return_input_items (input_items[j])
end
return crafted
end
for i = 1, #leftover.items, 1 do
if leftover.items[i] and not leftover.items[i]:is_empty () then
local count = leftover.items[i]:get_count ()
for j = 1, #input_items, 1 do
if input_items[j].name == leftover.items[i]:get_name () then
local over =
{
name = input_items[j].name,
pos = input_items[j].pos,
slot = input_items[j].slot,
count = input_items[j].count
}
if over.count < count then
count = count - over.count
else
over.count = count
count = 0
end
return_input_items (over)
if count < 1 then
break
end
end
end
end
end
-- removes from crafting_mods.lua if not taken from replacements
if #remove_items > 0 then
get_input_items (remove_items, inv_list)
end
crafted = crafted + 1
if not output_list then
return crafted
end
if not get_input_items (input_items) then
return crafted
end
if not update_output (pos, output_list) then
for j = 1, #input_items, 1 do
return_input_items (input_items[j])
end
return crafted
end
crafted = crafted + 1
end
end
@@ -609,6 +614,86 @@ end
-- items is list of recipe grid
local function can_craft (pos, items, recipe, inv_list)
local output, leftover = minetest.get_craft_result (recipe)
if output and output.item and not output.item:is_empty () then
local src_items = table.copy (items)
-- output itemstacks
local output_items = { ItemStack (output.item) }
for i = 1, #output.replacements, 1 do
if output.replacements[i] and not output.replacements[i]:is_empty () then
output_items[#output_items + 1] = ItemStack (output.replacements[i])
end
end
-- adjust leftovers
for i = 1, #leftover.items, 1 do
if leftover.items[i] and not leftover.items[i]:is_empty () then
local count = leftover.items[i]:get_count ()
for j = #src_items, 1, -1 do
if src_items[j] == leftover.items[i]:get_name () then
table.remove (src_items, j)
count = count - 1
if count < 1 then
break
end
end
end
if count > 0 then
output_items[#output_items + 1] = ItemStack (leftover.items[i]:get_name ().." "..tostring (count))
end
end
end
-- implement crafting_mods.lua
local mods = utils.get_crafting_mods (output.item:get_name ())
if mods then
if mods.add then
for i = 1, #mods.add do
output_items[#output_items + 1] = ItemStack (mods.add[i])
end
end
if mods.remove then
for i = 1, #mods.remove do
local found = false
for j = #output_items, 1, -1 do
if output_items[j]:get_name () == mods.remove[i] then
if output_items[j]:get_count () > 1 then
output_items[j]:set_count (output_items[j]:get_count () - 1)
else
output_items[j] = nil
end
found = true
end
end
if not found then
src_items[#src_items + 1] = mods.remove[i]
end
end
end
end
if check_input_items (src_items, inv_list) and
can_fit_output (pos, output_items) then
return true
end
end
return false
end
local function get_recipe_grid (pos)
local meta = minetest.get_meta (pos)
@@ -638,30 +723,6 @@ end
local function set_recipe_grid (pos, items)
local meta = minetest.get_meta (pos)
if meta then
local inv = meta:get_inventory ()
if inv then
if type (items) ~= "table" then
items = { }
end
for i = 1, 9, 1 do
if items[i] and minetest.registered_items[items[i]] then
inv:set_stack ("craft", i, ItemStack (items[i]))
else
inv:set_stack ("craft", i, nil)
end
end
end
end
end
local function craft_recipe (pos, qty)
local inv_list = get_inventory_list (pos)
local items = get_recipe_grid (pos)
@@ -690,6 +751,46 @@ end
local function craft_item_by_recipe (pos, recipe, items, qty)
local inv_list = get_inventory_list (pos)
if items and recipe then
return craft (pos, items, recipe, qty, inv_list)
end
return 0
end
local function can_craft_recipe (pos)
local inv_list = get_inventory_list (pos)
local items = get_recipe_grid (pos)
local recipe =
{
method = "normal",
width = 3,
items = get_recipe_grid (pos)
}
return can_craft (pos, items, recipe, inv_list)
end
local function can_craft_item (pos, itemname)
local inv_list = get_inventory_list (pos)
local items, recipe = get_craft_items (itemname, inv_list)
if items and recipe then
return can_craft (pos, items, recipe, inv_list)
end
return false
end
local function preview_craft (pos)
local items = get_recipe_grid (pos)
local recipe =
@@ -719,6 +820,32 @@ end
local function set_recipe_grid (pos, items)
local meta = minetest.get_meta (pos)
if meta then
local inv = meta:get_inventory ()
if inv then
if type (items) ~= "table" then
items = { }
end
for i = 1, 9, 1 do
if items[i] and minetest.registered_items[items[i]] then
inv:set_stack ("craft", i, ItemStack (items[i]))
else
inv:set_stack ("craft", i, nil)
end
end
preview_craft (pos)
end
end
end
local function run_automatic (pos, run)
local timer = minetest.get_node_timer (pos)
local meta = minetest.get_meta (pos)
@@ -782,6 +909,80 @@ end
local function get_item_craft (pos, itemname, index)
if itemname:len () < 1 or index < 1 then
return nil
end
local inv_list = get_inventory_list (pos)
local names = { }
names[itemname] = true
for alias, name in pairs (minetest.registered_aliases) do
if alias == itemname then
names[name] = true
elseif name == itemname then
names[alias] = true
end
end
local recipes = { }
local grid = { }
for name, _ in pairs (names) do
local r = minetest.get_all_craft_recipes (name)
if r then
for i = 1, #r, 1 do
local items = get_craft_recipe_items (r[i].items, inv_list)
if items then
recipes[#recipes + 1] = r[i]
grid[#grid + 1] = items
end
end
end
end
if recipes and recipes[index] then
return recipes[index], #recipes, grid[index]
end
return nil
end
local function get_craft_items_grid (recipe, items)
local grid = { "", "", "", "", "", "", "", "", "" }
if recipe.width == 1 then
for i = 1, 3, 1 do
grid[((i - 1) * 3) + 2] = items[i] or ""
end
elseif recipe.width == 2 then
for i = 1, 6, 1 do
grid[(((i - 1) % 2) * 3) + math.floor ((i - 1) / 2) + 1] = items[i] or ""
end
else
for i = 1, 9, 1 do
grid[i] = items[i] or ""
end
end
return grid
end
local function get_item_button (item, x, y, element_name)
local name = item or ""
return string.format ("item_image_button[%f,%f;1.0,1.0;%s;%s;]",
x, y, name, element_name)
end
local function get_formspec (pos, search)
local spec = ""
local meta = minetest.get_meta (pos)
@@ -808,6 +1009,40 @@ local function get_formspec (pos, search)
item.name)
end
local craft_grid
local craftitem = meta:get_string ("craftitem")
local recipe_index = meta:get_int ("recipe_index")
local item_recipe, recipe_count, item_items = get_item_craft (pos, craftitem, recipe_index)
if item_recipe and item_items then
local grid = get_craft_items_grid (item_recipe, item_items)
local prior_button = ((recipe_index > 1) and "button[15.5,3.9;1.0,0.8;prior_craft;<]") or ""
local next_button = ((recipe_index < recipe_count) and "button[16.5,3.9;1.0,0.8;next_craft;>]") or ""
craft_grid = string.format ("%s%s%s%s%s%s%s%s%s"..
"button[15.5,2.5;2.0,0.8;close_item_craft;Close]"..
"%s%s"..
"button[15.5,5.3;2.0,0.8;craft_item;Craft]",
get_item_button (grid[1], 11.5, 2.5, "guide_1"),
get_item_button (grid[2], 12.75, 2.5, "guide_2"),
get_item_button (grid[3], 14.0, 2.5, "guide_3"),
get_item_button (grid[4], 11.5, 3.75, "guide_4"),
get_item_button (grid[5], 12.75, 3.75, "guide_5"),
get_item_button (grid[6], 14.0, 3.75, "guide_6"),
get_item_button (grid[7], 11.5, 5.0, "guide_7"),
get_item_button (grid[8], 12.75, 5.0, "guide_8"),
get_item_button (grid[9], 14.0, 5.0, "guide_9"),
prior_button,
next_button)
else
craft_grid = string.format ("list[context;craft;11.5,2.5;3,3;]"..
"checkbox[15.5,2.7;automatic;Automatic;%s]"..
"button[15.5,5.3;2.0,0.8;craft;Craft]"..
"list[context;preview;16.0,3.75;1,1;]",
automatic)
end
spec = string.format ("formspec_version[3]"..
"size[24.7,13.0,false]"..
"set_focus[search_field;true]"..
@@ -819,10 +1054,7 @@ local function get_formspec (pos, search)
"field[11.5,1.21;3.0,0.8;channel;Channel;${channel}]"..
"field_close_on_enter[channel;false]"..
"button[14.5,1.21;1.5,0.8;setchannel;Set]"..
"list[context;craft;11.5,2.5;3,3;]"..
"checkbox[15.5,2.7;automatic;Automatic;%s]"..
"button[15.5,5.3;2.0,0.8;craft;Craft]"..
"list[context;preview;16.0,3.75;1,1;]"..
"%s"..
"label[11.5,6.95;Output]"..
"list[context;output;11.5,7.2;5,4;]"..
"listring[current_player;main]"..
@@ -834,7 +1066,7 @@ local function get_formspec (pos, search)
"scroll_container[18.2,2.0;5.0,10.0;crafter_scrollbar;vertical;0.1]"..
"%s"..
"scroll_container_end[]",
automatic,
craft_grid,
search,
scroll_height,
thumb_size,
@@ -1018,6 +1250,8 @@ local function on_rightclick (pos, node, clicker, itemstack, pointed_thing)
local meta = minetest.get_meta (pos)
if meta then
meta:set_string ("craftitem", "")
meta:set_int ("recipe_index", 0)
meta:set_string ("formspec", get_formspec (pos))
end
end
@@ -1054,18 +1288,80 @@ local function on_receive_fields (pos, formname, fields, sender)
local meta = minetest.get_meta (pos)
if meta then
meta:set_string ("craftitem", "")
meta:set_int ("recipe_index", 0)
meta:set_string ("formspec", get_formspec (pos, fields.search_field))
end
elseif fields.craft then
craft_recipe (pos, 1)
elseif fields.prior_craft then
local meta = minetest.get_meta (pos)
if meta then
meta:set_int ("recipe_index", meta:get_int ("recipe_index") - 1)
meta:set_string ("formspec", get_formspec (pos, fields.search_field))
end
elseif fields.next_craft then
local meta = minetest.get_meta (pos)
if meta then
meta:set_int ("recipe_index", meta:get_int ("recipe_index") + 1)
meta:set_string ("formspec", get_formspec (pos, fields.search_field))
end
elseif fields.close_item_craft then
local meta = minetest.get_meta (pos)
if meta then
meta:set_string ("craftitem", "")
meta:set_int ("recipe_index", 0)
meta:set_string ("formspec", get_formspec (pos, fields.search_field))
end
elseif fields.craft_item then
local meta = minetest.get_meta (pos)
if meta then
local itemname = meta:get_string ("craftitem")
local index = meta:get_int ("recipe_index")
if itemname:len () > 0 then
local recipe, _, items = get_item_craft (pos, itemname, index)
if recipe then
craft_item_by_recipe (pos, recipe, items, 1)
end
end
end
else
for k, v in pairs (fields) do
if k:sub (1, 5) == "ITEM_" then
local itemname = k:sub (6, -1)
local _, count = get_item_craft (pos, itemname, 1)
craft_item (pos, itemname, 1)
if count > 1 then
local meta = minetest.get_meta (pos)
if meta then
meta:set_string ("craftitem", itemname)
meta:set_int ("recipe_index", 1)
meta:set_string ("formspec", get_formspec (pos, fields.search_field))
end
elseif count == 1 then
craft_item (pos, itemname, 1)
local meta = minetest.get_meta (pos)
if meta and meta:get_string ("craftitem"): len () > 0 then
meta:set_string ("craftitem", "")
meta:set_int ("recipe_index", 0)
meta:set_string ("formspec", get_formspec (pos, fields.search_field))
end
end
break
end
@@ -1314,6 +1610,59 @@ end
local function send_craft_result_message (pos, itemname, qty, crafted)
if utils.digilines_supported then
local meta = minetest.get_meta (pos)
if meta then
local channel = meta:get_string ("channel")
if channel:len () > 0 then
local msg =
{
action = "crafted",
itemname = itemname,
qty = qty,
crafted = crafted
}
utils.digilines_receptor_send (pos,
utils.digilines_default_rules,
channel,
msg)
end
end
end
end
local function send_can_craft_message (pos, itemname, result)
if utils.digilines_supported then
local meta = minetest.get_meta (pos)
if meta then
local channel = meta:get_string ("channel")
if channel:len () > 0 then
local msg =
{
action = "can_craft",
itemname = itemname,
result = result
}
utils.digilines_receptor_send (pos,
utils.digilines_default_rules,
channel,
msg)
end
end
end
end
local function digilines_support ()
if utils.digilines_supported then
return
@@ -1346,17 +1695,28 @@ local function digilines_support ()
qty = math.floor (math.max (math.min (tonumber (m[2]), 10), 1))
end
craft_recipe (pos, qty)
send_craft_result_message (pos, nil, qty, craft_recipe (pos, qty))
elseif m[1] == "craftitem" then
local qty = 1
if m[3] and tonumber (m[3]) then
qty = math.floor (math.max (math.min (tonumber (m[3]), 10), 1))
end
if m[2] and minetest.registered_items[m[2]] then
local qty = 1
send_craft_result_message (pos, m[2], qty, craft_item (pos, m[2], qty))
else
send_craft_result_message (pos, m[2] or "", qty, 0)
end
if m[3] and tonumber (m[3]) then
qty = math.floor (math.max (math.min (tonumber (m[3]), 10), 1))
end
craft_item (pos, m[2], qty)
elseif m[1] == "can_craft" then
if m[2] and not minetest.registered_items[m[2]] then
send_can_craft_message (pos, m[2], false)
elseif m[2] then
send_can_craft_message (pos, m[2], can_craft_item (pos, m[2]))
else
send_can_craft_message (pos, nil, can_craft_recipe (pos))
end
elseif m[1] == "automatic" then
@@ -1499,9 +1859,7 @@ minetest.register_node("lwcomponents:crafter", {
"lwcomponents_storage_crafter.png", "lwcomponents_storage_crafter.png",
"lwcomponents_storage_crafter.png", "lwcomponents_storage_crafter.png" },
is_ground_content = false,
groups = table.copy (crafter_groups),
sounds = default.node_sound_wood_defaults (),
paramtype = "none",
groups = table.copy (crafter_groups), paramtype = "none",
param1 = 0,
paramtype2 = "none",
param2 = 0,
@@ -1535,9 +1893,7 @@ minetest.register_node("lwcomponents:crafter_locked", {
"lwcomponents_storage_crafter.png", "lwcomponents_storage_crafter.png",
"lwcomponents_storage_crafter.png", "lwcomponents_storage_crafter.png" },
is_ground_content = false,
groups = table.copy (crafter_groups),
sounds = default.node_sound_wood_defaults (),
paramtype = "none",
groups = table.copy (crafter_groups), paramtype = "none",
param1 = 0,
paramtype2 = "none",
param2 = 0,

View File

@@ -1,9 +0,0 @@
default
mesecons?
digilines?
unifieddyes?
intllib?
hopper?
digistuff?
pipeworks?
lwwires?

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -663,7 +663,6 @@ minetest.register_node("lwcomponents:deployer", {
"lwdeployer.png", "lwdeployer.png", "lwdeployer_face.png"},
is_ground_content = false,
groups = table.copy (deployer_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -692,7 +691,6 @@ minetest.register_node("lwcomponents:deployer_locked", {
"lwdeployer.png", "lwdeployer.png", "lwdeployer_face.png"},
is_ground_content = false,
groups = table.copy (deployer_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -722,7 +720,6 @@ minetest.register_node("lwcomponents:deployer_on", {
"lwdeployer.png", "lwdeployer.png", "lwdeployer_face_on.png"},
is_ground_content = false,
groups = table.copy (deployer_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -753,7 +750,6 @@ minetest.register_node("lwcomponents:deployer_locked_on", {
"lwdeployer.png", "lwdeployer.png", "lwdeployer_face_on.png"},
is_ground_content = false,
groups = table.copy (deployer_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -809,7 +805,6 @@ utils.hopper_add_container({
})
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -1 +0,0 @@
Various components for mesecons and digilines.

View File

@@ -137,7 +137,6 @@ minetest.register_node("lwcomponents:destroyer", {
"lwcomponents_destroyer_side.png", "lwcomponents_destroyer_side.png" },
is_ground_content = false,
groups = table.copy (destroyer_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "none",

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -731,7 +731,6 @@ minetest.register_node("lwcomponents:detector", {
"lwdetector.png", "lwdetector.png", "lwdetector_face.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -760,7 +759,6 @@ minetest.register_node("lwcomponents:detector_locked", {
"lwdetector.png", "lwdetector.png", "lwdetector_face.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -789,7 +787,6 @@ minetest.register_node("lwcomponents:detector_on", {
"lwdetector.png", "lwdetector.png", "lwdetector_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -818,7 +815,6 @@ minetest.register_node("lwcomponents:detector_locked_on", {
"lwdetector.png", "lwdetector.png", "lwdetector_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -847,7 +843,6 @@ minetest.register_node("lwcomponents:detector_on_on", {
"lwdetector.png", "lwdetector.png", "lwdetector_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -876,7 +871,6 @@ minetest.register_node("lwcomponents:detector_locked_on_on", {
"lwdetector.png", "lwdetector.png", "lwdetector_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -899,7 +893,6 @@ minetest.register_node("lwcomponents:detector_locked_on_on", {
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -335,7 +335,6 @@ minetest.register_node ("lwcomponents:digiswitch", {
paramtype = "none",
param1 = 0,
groups = { cracky = 2, oddly_breakable_by_hand = 2, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
mesecons = mesecon_support (),
digiline = digilines_support (),
_digistuff_channelcopier_fieldname = "channel",
@@ -363,7 +362,6 @@ minetest.register_node ("lwcomponents:digiswitch_on", {
paramtype = "none",
param1 = 0,
groups = { cracky = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
mesecons = mesecon_support_on (),
digiline = digilines_support (),
_digistuff_channelcopier_fieldname = "channel",

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -527,7 +527,6 @@ minetest.register_node("lwcomponents:dispenser", {
"lwdispenser.png", "lwdispenser.png", "lwdispenser_face.png"},
is_ground_content = false,
groups = table.copy (dispenser_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -555,7 +554,6 @@ minetest.register_node("lwcomponents:dispenser_locked", {
"lwdispenser.png", "lwdispenser.png", "lwdispenser_face.png"},
is_ground_content = false,
groups = table.copy (dispenser_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -593,7 +591,6 @@ utils.hopper_add_container({
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -44,6 +44,13 @@ pulled from here.
The automatic crafting is only operable when the crafter is in an active
block. Mesecons and digilines operations operate in unloaded blocks.
When crafting by item, if more than one recipe is satisfied by the input
items, the crafting grid is replaced with the available crafts for that
item. Clicking the < and > buttons walks through the recipes. Clicking
Craft performs one craft with the displayed recipe. Clicking Close displays
the crafting grid. If only one recipe is satisfied by the input items one
craft is immediately performed without displaying the recipe.
Hoppers placed to the top or sides of a crafter will feed items into the
input. Hoppers placed below a crafter will take items from the output.
@@ -56,12 +63,37 @@ Mesecons
Digilines messages
"craft [qty]"
Craft from the recipe if possible. qty is optional, if given must be an
integer between 1 to 10.
integer between 1 to 10. If not given defaults to 1. A return message
is sent with it's own channel in the following format:
{
action = "crafted",
qty = number, -- craft qty requested
crafted = number -- crafts successfully performed
}
"craftitem itemname [qty]"
Craft the given item if possible. itemname must be a valid item name
(eg. "default:wood"). qty is optional, if given must be an integer
between 1 to 10.
between 1 to 10. If not given defaults to 1. A return message is sent
with it's own channel in the following format:
{
action = "crafted",
itemname = string, -- the name of the item requested to craft
qty = number, -- craft qty requested
crafted = number -- crafts successfully performed
}
"can_craft [itemname]"
Test whether a single craft can be performed for the item. itemname is
optional, if given will test craft by item. If not given will test if
the recipe in the crafting grid can be performed. A return message is
sent with it's own channel in the following format:
{
action = "can_craft",
itemname = string, -- the name of the item requested, nil for recipe
result = boolean -- true if craft can be performed, false if not
}
"automatic state"
Sets the automatic running state of the crafter. state must be true or
@@ -107,15 +139,15 @@ Set recipe grid:
items = { ... }
}
items must be a string list of item names as <mod>:<name>. The grid is
fill left to right, top to bottom. Up to the first 9 items are used.
filled left to right, top to bottom. Up to the first 9 items are used.
* When crafting by item the output quantities may not be as expected. The
first found recipe for the craft which is satisfied by the available
items is used. So if you have saplings and wood in the input and try
to craft sticks, if the first recipe found uses the saplings 1 stick will
be output, if wood then 4 sticks. Also, sometimes the same recipe is
registered for more than 1 item. In this case, what item will actually
be crafted is ambiguous.
* When crafting by item the output may not be as expected. For the digilines
"craftitem" message, the first found recipe for the craft which is
satisfied by the available items is used. So if you have saplings and
wood in the input and try to craft sticks, if the first recipe found
uses the saplings 1 stick will be output, if wood then 4 sticks.
Also, sometimes the same recipe is registered for more than 1 item.
In this case, what item will actually be crafted is ambiguous.
* The file 'crafting_mods.lua' in the mod folder contains a list of
crafting modifications. Modify this file as necessary. The field name

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -536,7 +536,6 @@ minetest.register_node("lwcomponents:dropper", {
"lwdropper.png", "lwdropper.png", "lwdropper_face.png"},
is_ground_content = false,
groups = table.copy (dropper_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -564,7 +563,6 @@ minetest.register_node("lwcomponents:dropper_locked", {
"lwdropper.png", "lwdropper.png", "lwdropper_face.png"},
is_ground_content = false,
groups = table.copy (dropper_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -601,7 +599,6 @@ utils.hopper_add_container({
})
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -485,7 +485,7 @@ minetest.register_node ("lwcomponents:boom", {
tiles = { "lwcomponents_boom.png" },
inventory_image = "lwcomponents_boom.png",
wield_image = "lwcomponents_boom.png",
light_source = default.LIGHT_MAX,
light_source = 14,
use_texture_alpha = "blend",
sunlight_propagates = true,
walkable = false,

View File

@@ -31,15 +31,6 @@ if touchscreen then
}
minetest.register_node ("lwcomponents:touchscreen", touchblock)
minetest.register_craft({
output = "lwcomponents:touchscreen",
recipe = {
{"mesecons_luacontroller:luacontroller0000","default:glass","default:glass"},
{"default:glass","digilines:lcd","default:glass"},
{"default:glass","default:glass","default:stone"}
}
})
end
@@ -72,15 +63,6 @@ if panel then
}
minetest.register_node ("lwcomponents:panel", panelblock)
minetest.register_craft({
output = "lwcomponents:panel",
recipe = {
{"","digistuff:button",""},
{"digistuff:button","digilines:lcd","digistuff:button"},
{"","digistuff:button","default:stone"}
}
})
end

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -342,7 +342,6 @@ minetest.register_node("lwcomponents:fan", {
"lwfan.png", "lwfan.png", "lwfan_face.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -370,7 +369,6 @@ minetest.register_node("lwcomponents:fan_locked", {
"lwfan.png", "lwfan.png", "lwfan_face.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -398,7 +396,6 @@ minetest.register_node("lwcomponents:fan_on", {
"lwfan.png", "lwfan.png", "lwfan_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -427,7 +424,6 @@ minetest.register_node("lwcomponents:fan_locked_on", {
"lwfan.png", "lwfan.png", "lwfan_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -450,4 +446,3 @@ minetest.register_node("lwcomponents:fan_locked_on", {
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -842,7 +842,6 @@ minetest.register_node("lwcomponents:force_field", {
"lwcomponents_force_field.png", "lwcomponents_force_field.png", "lwcomponents_force_field.png"},
is_ground_content = false,
groups = table.copy (force_field_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "none",
@@ -872,7 +871,6 @@ minetest.register_node("lwcomponents:force_field_locked", {
"lwcomponents_force_field.png", "lwcomponents_force_field.png", "lwcomponents_force_field.png"},
is_ground_content = false,
groups = table.copy (force_field_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "none",
@@ -902,7 +900,6 @@ minetest.register_node("lwcomponents:force_field_on", {
"lwcomponents_force_field_on.png", "lwcomponents_force_field_on.png", "lwcomponents_force_field_on.png"},
is_ground_content = false,
groups = table.copy (force_field_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "none",
@@ -933,7 +930,6 @@ minetest.register_node("lwcomponents:force_field_locked_on", {
"lwcomponents_force_field_on.png", "lwcomponents_force_field_on.png", "lwcomponents_force_field_on.png"},
is_ground_content = false,
groups = table.copy (force_field_on_groups),
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "none",

View File

@@ -329,7 +329,6 @@ minetest.register_node("lwcomponents:hologram", {
"lwhologram.png", "lwhologram.png", "lwhologram_face.png"},
is_ground_content = false,
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -355,7 +354,6 @@ minetest.register_node("lwcomponents:hologram_locked", {
"lwhologram.png", "lwhologram.png", "lwhologram_face.png"},
is_ground_content = false,
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",

View File

@@ -382,7 +382,6 @@ minetest.register_node ("lwcomponents:hopper", {
param2 = 0,
drop = "lwcomponents:hopper",
groups = { cracky = 3 },
sounds = default.node_sound_stone_defaults (),
on_construct = on_construct,
on_destruct = on_destruct,
@@ -431,7 +430,6 @@ minetest.register_node ("lwcomponents:hopper_horz", {
param2 = 0,
drop = "lwcomponents:hopper",
groups = { cracky = 3, not_in_creative_inventory = 1 },
sounds = default.node_sound_stone_defaults (),
on_construct = on_construct,
on_destruct = on_destruct,

View File

@@ -1,4 +1,4 @@
local version = "0.1.31"
local version = "0.1.33"
local mod_storage = minetest.get_mod_storage ()
@@ -46,8 +46,6 @@ loadfile (modpath.."/destroyer.lua") (utils)
loadfile (modpath.."/extras.lua") (utils)
loadfile (modpath.."/digiswitch.lua") (utils)
loadfile (modpath.."/movefloor.lua") (utils)
loadfile (modpath.."/solid_conductor.lua") (utils)
loadfile (modpath.."/crafting.lua") (utils)

View File

@@ -2,5 +2,3 @@ author = loosewheel
description = Various components for mesecons and digilines.
title = LWComponents
name = lwcomponents
depends = default
optional_depends = mesecons, digilines, unifieddyes, intllib, hopper, digistuff, pipeworks, lwwires

View File

@@ -429,9 +429,7 @@ minetest.register_node("lwcomponents:movefloor", {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
}
},
groups = { cracky = 2 },
sounds = default.node_sound_wood_defaults (),
mesecons = mesecon_support (),
groups = { cracky = 2 }, mesecons = mesecon_support (),
})

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -1109,7 +1109,6 @@ minetest.register_node("lwcomponents:piston", {
"lwcomponents_piston_base.png", "lwcomponents_piston_pusher.png" },
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -1156,7 +1155,6 @@ minetest.register_node("lwcomponents:piston_1", {
},
is_ground_content = false,
groups = { cracky = 3 , not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -1203,7 +1201,6 @@ minetest.register_node("lwcomponents:piston_2", {
},
is_ground_content = false,
groups = { cracky = 3 , not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -1233,7 +1230,6 @@ minetest.register_node("lwcomponents:piston_sticky", {
"lwcomponents_piston_base.png", "lwcomponents_piston_pusher_sticky.png" },
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -1280,7 +1276,6 @@ minetest.register_node("lwcomponents:piston_sticky_1", {
},
is_ground_content = false,
groups = { cracky = 3 , not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -1327,7 +1322,6 @@ minetest.register_node("lwcomponents:piston_sticky_2", {
},
is_ground_content = false,
groups = { cracky = 3 , not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "light",
param1 = 0,
paramtype2 = "facedir",
@@ -1350,4 +1344,3 @@ minetest.register_node("lwcomponents:piston_sticky_2", {
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -114,8 +114,6 @@ minetest.register_node ("lwcomponents:player_button", {
},
groups = { dig_immediate = 2, digiline_receiver = 1 },
_digistuff_channelcopier_fieldname = "channel",
sounds = default and default.node_sound_stone_defaults(),
digiline =
{
receptor = {},
@@ -163,8 +161,6 @@ minetest.register_node ("lwcomponents:player_button_off", {
},
groups = { dig_immediate = 2, digiline_receiver = 1, not_in_creative_inventory = 1 },
_digistuff_channelcopier_fieldname = "channel",
sounds = default and default.node_sound_stone_defaults(),
digiline =
{
receptor = {},
@@ -214,8 +210,6 @@ minetest.register_node ("lwcomponents:player_button_on", {
},
groups = { dig_immediate = 2, digiline_receiver = 1, not_in_creative_inventory = 1 },
_digistuff_channelcopier_fieldname = "channel",
sounds = default and default.node_sound_stone_defaults(),
digiline =
{
receptor = {},

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -483,7 +483,6 @@ minetest.register_node("lwcomponents:puncher", {
"lwpuncher.png", "lwpuncher.png", "lwpuncher_face.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -510,7 +509,6 @@ minetest.register_node("lwcomponents:puncher_locked", {
"lwpuncher.png", "lwpuncher.png", "lwpuncher_face.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -537,7 +535,6 @@ minetest.register_node("lwcomponents:puncher_on", {
"lwpuncher.png", "lwpuncher.png", "lwpuncher_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -564,7 +561,6 @@ minetest.register_node("lwcomponents:puncher_locked_on", {
"lwpuncher.png", "lwpuncher.png", "lwpuncher_face_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
paramtype2 = "facedir",
@@ -585,7 +581,6 @@ minetest.register_node("lwcomponents:puncher_locked_on", {
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -13,7 +13,7 @@ CC BY-SA 3.0
Version
=======
0.1.31
0.1.33
Minetest Version

View File

@@ -3,7 +3,7 @@ local S = utils.S
if utils.digilines_supported or utils.mesecon_supported then
@@ -492,7 +492,6 @@ minetest.register_node("lwcomponents:siren", {
"lwsiren.png", "lwsiren.png", "lwsiren.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -519,7 +518,6 @@ minetest.register_node("lwcomponents:siren_locked", {
"lwsiren.png", "lwsiren.png", "lwsiren.png"},
is_ground_content = false,
groups = { cracky = 3, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -546,7 +544,6 @@ minetest.register_node("lwcomponents:siren_on", {
"lwsiren_on.png", "lwsiren_on.png", "lwsiren_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -573,7 +570,6 @@ minetest.register_node("lwcomponents:siren_locked_on", {
"lwsiren_on.png", "lwsiren_on.png", "lwsiren_on.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
floodable = false,
@@ -600,7 +596,6 @@ minetest.register_node("lwcomponents:siren_alarm", {
"lwsiren_alarm.png", "lwsiren_alarm.png", "lwsiren_alarm.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
light_source = 3,
@@ -628,7 +623,6 @@ minetest.register_node("lwcomponents:siren_locked_alarm", {
"lwsiren_alarm.png", "lwsiren_alarm.png", "lwsiren_alarm.png"},
is_ground_content = false,
groups = { cracky = 3, not_in_creative_inventory = 1, wires_connect = 1 },
sounds = default.node_sound_stone_defaults (),
paramtype = "none",
param1 = 0,
light_source = 3,
@@ -650,7 +644,6 @@ minetest.register_node("lwcomponents:siren_locked_alarm", {
end -- utils.digilines_supported or utils.mesecon_supported

View File

@@ -1,146 +0,0 @@
local utils = ...
local S = utils.S
if utils.unifieddyes_supported and utils.mesecon_supported then
mesecon.register_node (":lwcomponents:solid_conductor",
{
description = S("Solid Color Conductor"),
tiles = { "lwsolid_conductor.png" },
is_ground_content = false,
sounds = ( default and default.node_sound_wood_defaults() ),
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
on_rotate = false,
drop = "lwcomponents:solid_conductor_off",
digiline = { wire = { rules = utils.digilines_default_rules } },
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
},
{
tiles = { "lwsolid_conductor.png" },
mesecons =
{
conductor =
{
rules = utils.mesecon_default_rules,
state = utils.mesecon_state_off,
onstate = "lwcomponents:solid_conductor_on",
}
},
groups = {
dig_immediate = 2,
ud_param2_colorable = 1,
wires_connect = 1
},
},
{
tiles = { "lwsolid_conductor.png" },
mesecons =
{
conductor =
{
rules = utils.mesecon_default_rules,
state = utils.mesecon_state_on,
offstate = "lwcomponents:solid_conductor_off",
}
},
groups = {
dig_immediate = 2,
ud_param2_colorable = 1,
not_in_creative_inventory = 1,
wires_connect = 1
},
}
)
unifieddyes.register_color_craft ({
output = "lwcomponents:solid_conductor_off 3",
palette = "extended",
type = "shapeless",
neutral_node = "lwcomponents:solid_conductor_off",
recipe = {
"NEUTRAL_NODE",
"NEUTRAL_NODE",
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
mesecon.register_node (":lwcomponents:solid_horizontal_conductor",
{
description = S("Solid Color Horizontal Conductor"),
tiles = { "lwsolid_conductor.png" },
is_ground_content = false,
sounds = ( default and default.node_sound_wood_defaults() ),
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
on_rotate = false,
drop = "lwcomponents:solid_horizontal_conductor_off",
digiline = { wire = { rules = utils.digilines_flat_rules } },
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
},
{
tiles = { "lwsolid_conductor.png" },
mesecons =
{
conductor =
{
rules = utils.mesecon_flat_rules,
state = utils.mesecon_state_off,
onstate = "lwcomponents:solid_horizontal_conductor_on",
}
},
groups = {
dig_immediate = 2,
ud_param2_colorable = 1,
wires_connect = 1
},
},
{
tiles = { "lwsolid_conductor.png" },
mesecons =
{
conductor =
{
rules = utils.mesecon_flat_rules,
state = utils.mesecon_state_on,
offstate = "lwcomponents:solid_horizontal_conductor_off",
}
},
groups = {
dig_immediate = 2,
ud_param2_colorable = 1,
not_in_creative_inventory = 1,
wires_connect = 1
},
}
)
unifieddyes.register_color_craft ({
output = "lwcomponents:solid_horizontal_conductor_off 3",
palette = "extended",
type = "shapeless",
neutral_node = "lwcomponents:solid_horizontal_conductor_off",
recipe = {
"NEUTRAL_NODE",
"NEUTRAL_NODE",
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
end -- utils.unifieddyes_supported and utils.mesecon_supported then

View File

@@ -156,9 +156,7 @@ minetest.register_node("lwcomponents:storage_unit", {
drawtype = "glasslike_framed",
tiles = { "lwcomponents_storage_framed.png", "lwcomponents_storage.png" },
is_ground_content = false,
groups = { choppy = 2 },
sounds = default.node_sound_wood_defaults (),
paramtype = "none",
groups = { choppy = 2 }, paramtype = "none",
param1 = 0,
paramtype2 = "none",
param2 = 0,
@@ -177,9 +175,7 @@ minetest.register_node("lwcomponents:storage_unit_locked", {
drawtype = "glasslike_framed",
tiles = { "lwcomponents_storage_framed.png", "lwcomponents_storage.png" },
is_ground_content = false,
groups = { choppy = 2 },
sounds = default.node_sound_wood_defaults (),
paramtype = "none",
groups = { choppy = 2 }, paramtype = "none",
param1 = 0,
paramtype2 = "none",
param2 = 0,
@@ -1352,9 +1348,7 @@ minetest.register_node("lwcomponents:storage_indexer", {
"lwcomponents_storage_indexer.png", "lwcomponents_storage_indexer.png",
"lwcomponents_storage_indexer.png", "lwcomponents_storage_indexer.png",},
is_ground_content = false,
groups = table.copy (indexer_groups),
sounds = default.node_sound_wood_defaults (),
paramtype = "none",
groups = table.copy (indexer_groups), paramtype = "none",
param1 = 0,
paramtype2 = "none",
param2 = 0,
@@ -1386,9 +1380,7 @@ minetest.register_node("lwcomponents:storage_indexer_locked", {
"lwcomponents_storage_indexer.png", "lwcomponents_storage_indexer.png",
"lwcomponents_storage_indexer.png", "lwcomponents_storage_indexer.png",},
is_ground_content = false,
groups = table.copy (indexer_groups),
sounds = default.node_sound_wood_defaults (),
paramtype = "none",
groups = table.copy (indexer_groups), paramtype = "none",
param1 = 0,
paramtype2 = "none",
param2 = 0,

View File

@@ -47,9 +47,7 @@ mesecon.register_node ("lwcomponents:through_wire", {
{ -2/32, -1/2 , -16/32+0.001 , 2/32, -14/32, 7/16+0.002 } -- the horizontal wire
}
},
drop = "lwcomponents:through_wire_off",
sounds = default.node_sound_defaults(),
}, {
drop = "lwcomponents:through_wire_off",}, {
tiles = { "mesecons_wire_off.png" },
groups = { dig_immediate = 3 },
mesecons = {