Add craftable and invisible move block

This commit is contained in:
Joachim Stolberg 2023-03-21 20:00:26 +01:00
parent d92c2a7b91
commit 6159ccaa96
4 changed files with 35 additions and 28 deletions

View File

@ -56,12 +56,10 @@ local function set_node(item, playername)
return
elseif ndef2.buildable_to then
local meta = M(dest_pos)
if name ~= "techage:moveblock" then
minetest.set_node(dest_pos, {name=name, param2=param2})
meta:from_table(item.metadata or {})
meta:set_string("ta_move_block", "")
meta:set_int("ta_door_locked", 1)
end
minetest.set_node(dest_pos, {name=name, param2=param2})
meta:from_table(item.metadata or {})
meta:set_string("ta_move_block", "")
meta:set_int("ta_door_locked", 1)
return
end
local meta = M(dest_pos)
@ -70,9 +68,7 @@ local function set_node(item, playername)
return
end
elseif ndef1 then
if name ~= "techage:moveblock" then
minetest.add_item(dest_pos, ItemStack(name))
end
minetest.add_item(dest_pos, ItemStack(name))
end
end
@ -564,10 +560,6 @@ end
local function is_simple_node(pos)
local node = techage.get_node_lvm(pos)
if not minecart.is_rail(pos, node.name) then
if node.name == "air" then
minetest.swap_node(pos, {name = "techage:moveblock", param2 = 0})
return true
end
local ndef = minetest.registered_nodes[node.name]
return not techage.is_air_like(node.name) and techage.can_dig_node(node.name, ndef) or minecart.is_cart(node.name)
end
@ -830,21 +822,6 @@ function flylib.remove_node(pos)
end
end
minetest.register_node("techage:moveblock", {
description = "Techage Move Block",
drawtype = "normal",
tiles = {"techage_invisible.png"},
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
floodable = true,
is_ground_content = false,
groups = {not_in_creative_inventory=1},
drop = "",
})
minetest.register_on_joinplayer(function(player)
unlock_player(player)
end)

View File

@ -137,6 +137,14 @@ techage.furnace.register_recipe({
time = 4,
})
techage.furnace.register_recipe({
output = "techage:moveblock",
recipe = {
"techage:sieved_basalt_gravel",
},
time = 4,
})
techage.furnace.register_recipe({
output = "basic_materials:concrete_block 4",
recipe = {

View File

@ -293,6 +293,28 @@ minetest.register_node("techage:rack_and_pinion", {
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("techage:moveblock", {
description = "Techage Invisible Move Block",
drawtype = "glasslike_framed_optional",
inventory_image = 'techage_inv_invisible.png',
tiles = {"techage_invisible.png"},
selection_box = {
type = "fixed",
fixed = {
{-16/32, -16/32, -16/32, 16/32, -14/32, 16/32},
},
},
paramtype = "light",
light_source = 0,
sunlight_propagates = true,
walkable = false,
pointable = true,
is_ground_content = false,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft({
output = "techage:ta4_movecontroller",
recipe = {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 97 B