From 4ce2cbd4b8c821d8b8d5698bb2093e40a49c6c46 Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Sat, 5 Mar 2022 23:26:14 -0500 Subject: [PATCH] additionally game dig group support --- autocrafter.lua | 2 +- decorative_tubes.lua | 4 ++-- devices.lua | 34 +++++++++++++++++----------------- lua_tube.lua | 4 ++-- pipes.lua | 6 +++--- trashcan.lua | 2 +- tube_registration.lua | 4 ++-- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/autocrafter.lua b/autocrafter.lua index d6e7aa3..215a791 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -248,7 +248,7 @@ minetest.register_node("pipeworks:autocrafter", { description = S("Autocrafter"), drawtype = "normal", tiles = {"pipeworks_autocrafter.png"}, - groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, + groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1, dig_generic = 1}, tube = {insert_object = function(pos, node, stack, direction) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() diff --git a/decorative_tubes.lua b/decorative_tubes.lua index 6b7f80d..89a5130 100644 --- a/decorative_tubes.lua +++ b/decorative_tubes.lua @@ -14,7 +14,7 @@ minetest.register_node("pipeworks:steel_block_embedded_tube", { }, paramtype = "light", paramtype2 = "facedir", - groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1}, + groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2}, legacy_facedir_simple = true, _sound_def = { key = "node_sound_stone_defaults", @@ -70,7 +70,7 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", { collision_box = pane_box, paramtype = "light", paramtype2 = "facedir", - groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1}, + groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2}, legacy_facedir_simple = true, _sound_def = { key = "node_sound_stone_defaults", diff --git a/devices.lua b/devices.lua index 4180292..d6bfced 100644 --- a/devices.lua +++ b/devices.lua @@ -133,9 +133,9 @@ for s in ipairs(states) do local dgroups if states[s] == "off" then - dgroups = {snappy=3, pipe=1} + dgroups = {snappy=3, pipe=1, dig_generic = 4} else - dgroups = {snappy=3, pipe=1, not_in_creative_inventory=1} + dgroups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4} end local pumpname = "pipeworks:pump_"..states[s] @@ -251,7 +251,7 @@ minetest.register_node(nodename_valve_loaded, { type = "fixed", fixed = { -5/16, -4/16, -8/16, 5/16, 5/16, 8/16 } }, - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -303,7 +303,7 @@ minetest.register_node("pipeworks:grating", { }, sunlight_propagates = true, paramtype = "light", - groups = {snappy=3, pipe=1}, + groups = {snappy=3, pipe=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -330,7 +330,7 @@ minetest.register_node(nodename_spigot_empty, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, + groups = {snappy=3, pipe=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -367,7 +367,7 @@ minetest.register_node(nodename_spigot_loaded, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -425,7 +425,7 @@ minetest.register_node(nodename_panel_empty, { tiles = { "pipeworks_entry_panel.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, + groups = {snappy=3, pipe=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -447,7 +447,7 @@ minetest.register_node(nodename_panel_loaded, { tiles = { "pipeworks_entry_panel.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -479,7 +479,7 @@ minetest.register_node(nodename_sensor_empty, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, + groups = {snappy=3, pipe=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -520,7 +520,7 @@ minetest.register_node(nodename_sensor_loaded, { sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -567,12 +567,12 @@ new_flow_logic_register.transition_simple_set(sensor_pressure_set, { mesecons=pi -- TODO flow-logic-stub: these don't currently do anything under the new flow logic. for fill = 0, 10 do local filldesc=S("empty") - local sgroups = {snappy=3, pipe=1, tankfill=fill+1} + local sgroups = {snappy=3, pipe=1, tankfill=fill+1, dig_generic = 4} local image = nil if fill ~= 0 then filldesc=S("@1% full", 10*fill) - sgroups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1} + sgroups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1, dig_generic = 4} image = "pipeworks_storage_tank_fittings.png" end @@ -589,7 +589,7 @@ for fill = 0, 10 do inventory_image = image, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, tankfill=fill+1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -648,7 +648,7 @@ minetest.register_node(nodename_fountain_empty, { tiles = { "pipeworks_fountainhead.png" }, sunlight_propagates = true, paramtype = "light", - groups = {snappy=3, pipe=1}, + groups = {snappy=3, pipe=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -685,7 +685,7 @@ minetest.register_node(nodename_fountain_loaded, { tiles = { "pipeworks_fountainhead.png" }, sunlight_propagates = true, paramtype = "light", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -737,7 +737,7 @@ minetest.register_node(nodename_sp_empty, { tiles = { "pipeworks_straight_pipe_empty.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1}, + groups = {snappy=3, pipe=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, @@ -761,7 +761,7 @@ minetest.register_node(nodename_sp_loaded, { tiles = { "pipeworks_straight_pipe_loaded.png" }, paramtype = "light", paramtype2 = "facedir", - groups = {snappy=3, pipe=1, not_in_creative_inventory=1}, + groups = {snappy=3, pipe=1, not_in_creative_inventory=1, dig_generic = 4}, _sound_def = { key = "node_sound_metal_defaults", }, diff --git a/lua_tube.lua b/lua_tube.lua index f157efd..0898749 100644 --- a/lua_tube.lua +++ b/lua_tube.lua @@ -865,7 +865,7 @@ for white = 0, 1 do tiles[3] = tiles[3]..tiles_on_off.R270:format(white == 1 and "on" or "off"); tiles[4] = tiles[4]..tiles_on_off.R_90:format(white == 1 and "on" or "off"); - local groups = {snappy = 3, tube = 1, tubedevice = 1, overheat = 1} + local groups = {snappy = 3, tube = 1, tubedevice = 1, overheat = 1, dig_generic = 4} if red + blue + yellow + green + black + white ~= 0 then groups.not_in_creative_inventory = 1 end @@ -1023,7 +1023,7 @@ minetest.register_node(BASENAME .. "_burnt", { is_burnt = true, paramtype = "light", is_ground_content = false, - groups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory=1}, + groups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory=1, dig_generic = 4}, drop = BASENAME.."000000", sunlight_propagates = true, selection_box = selection_box, diff --git a/pipes.lua b/pipes.lua index 50eb9b1..5ab7c61 100644 --- a/pipes.lua +++ b/pipes.lua @@ -37,11 +37,11 @@ for index, connects in ipairs(cconnects) do end --]] - local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} + local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4} local pipedesc = S("Pipe Segment").." "..dump(connects) if #connects == 0 then - pgroups = {snappy = 3, tube = 1} + pgroups = {snappy = 3, tube = 1, dig_generic = 4} pipedesc = S("Pipe Segment") end @@ -93,7 +93,7 @@ for index, connects in ipairs(cconnects) do pipenumber = index }) - local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1} + local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4} minetest.register_node("pipeworks:pipe_"..index.."_loaded", { description = pipedesc, diff --git a/trashcan.lua b/trashcan.lua index d445c14..ae4b963 100644 --- a/trashcan.lua +++ b/trashcan.lua @@ -10,7 +10,7 @@ minetest.register_node("pipeworks:trashcan", { "pipeworks_trashcan_side.png", "pipeworks_trashcan_side.png", }, - groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1}, + groups = {snappy = 3, tubedevice = 1, tubedevice_receiver = 1, dig_generic = 4}, tube = { insert_object = function(pos, node, stack, direction) return ItemStack("") diff --git a/tube_registration.lua b/tube_registration.lua index c2d4799..c621cd8 100644 --- a/tube_registration.lua +++ b/tube_registration.lua @@ -61,13 +61,13 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e outimgs[vti[v]] = ends[v] end - local tgroups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory = 1} + local tgroups = {snappy = 3, tube = 1, tubedevice = 1, not_in_creative_inventory = 1, dig_generic = 4} local tubedesc = string.format("%s %s", desc, dump(connects)) local iimg = type(plain[1]) == "table" and plain[1].name or plain[1] local wscale = {x = 1, y = 1, z = 1} if #connects == 0 then - tgroups = {snappy = 3, tube = 1, tubedevice = 1} + tgroups = {snappy = 3, tube = 1, tubedevice = 1, dig_generic = 4} tubedesc = desc iimg=inv outimgs = {