3 Commits

Author SHA1 Message Date
18df2813a0 Comment print statements in battery_box.lua (#650) 2024-09-06 19:10:04 +02:00
221fc1376e technic_cnc: use programs definition to generate formspec (#647)
This deprecates the variables onesize_products and twosize_products by using a shared definition table.
With these changes, it should be easier to add new programs in the future.

New feature: Tooltips are added to all programs. (only applies to newly placed nodes)
2024-08-10 10:50:51 +02:00
9f373d6528 technic_cnc: Add group 'cracky'
Fixes a regression from ba2bdf836 where stone-like nodes could no longer be dug.
New sanity check to avoid such issues in the future.
2024-08-03 08:25:13 +02:00
2 changed files with 9 additions and 2 deletions

View File

@ -92,7 +92,7 @@ local dirtab = {
local tube = {
insert_object = function(pos, node, stack, direction)
print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2)
--print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2)
if direction.y == 1
or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then
return stack
@ -106,7 +106,7 @@ local tube = {
end
end,
can_insert = function(pos, node, stack, direction)
print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2)
--print(minetest.pos_to_string(direction), dirtab[direction.x+2+(direction.z+2)*2], node.param2)
if direction.y == 1
or (direction.y == 0 and dirtab[direction.x+2+(direction.z+2)*2] == node.param2) then
return false

View File

@ -10,6 +10,7 @@ local function register_material(nodename, tiles_override, descr_override)
end
local groups = {
cracky = ndef.groups.cracky,
crumbly = ndef.groups.crumbly,
choppy = ndef.groups.choppy,
flammable = ndef.groups.flammable,
@ -19,6 +20,12 @@ local function register_material(nodename, tiles_override, descr_override)
oddly_breakable_by_hand = ndef.groups.oddly_breakable_by_hand,
not_in_creative_inventory = 1,
}
local count = 0
for _ in pairs(groups) do
count = count + 1
end
assert(count >= 2, "Too few groups. node name=" .. nodename)
local tiles = tiles_override or { ndef.tiles[#ndef.tiles] }
assert(tiles and #tiles == 1, "Unknown tile format in node name=" .. nodename)