Add techage:ta4_cable_wall_entry item

This commit is contained in:
Joachim Stolberg 2021-05-13 18:19:28 +02:00
parent 67fd148241
commit 25c9340e5a
5 changed files with 67 additions and 3 deletions

View File

@ -117,6 +117,7 @@ dofile(MP.."/power/powerswitch.lua")
dofile(MP.."/power/protection.lua") dofile(MP.."/power/protection.lua")
dofile(MP.."/power/power_line.lua") dofile(MP.."/power/power_line.lua")
dofile(MP.."/power/ta4_cable.lua") dofile(MP.."/power/ta4_cable.lua")
dofile(MP.."/power/ta4_cable_wall_entry.lua")
dofile(MP.."/power/laser.lua") dofile(MP.."/power/laser.lua")
-- Iron Age -- Iron Age

View File

@ -27,10 +27,16 @@ local Cable = tubelib2.Tube:new({
max_tube_length = ELE2_MAX_CABLE_LENGHT, max_tube_length = ELE2_MAX_CABLE_LENGHT,
show_infotext = false, show_infotext = false,
tube_type = "ele2", tube_type = "ele2",
primary_node_names = {"techage:ta4_power_cableS", "techage:ta4_power_cableA"}, primary_node_names = {"techage:ta4_power_cableS", "techage:ta4_power_cableA",
"techage:ta4_cable_wall_entry"},
secondary_node_names = {}, secondary_node_names = {},
after_place_tube = function(pos, param2, tube_type, num_tubes) after_place_tube = function(pos, param2, tube_type, num_tubes)
local name = minetest.get_node(pos).name
if name == "techage:ta4_cable_wall_entry" then
minetest.swap_node(pos, {name = "techage:ta4_cable_wall_entry", param2 = param2})
else
minetest.swap_node(pos, {name = "techage:ta4_power_cable"..tube_type, param2 = param2}) minetest.swap_node(pos, {name = "techage:ta4_power_cable"..tube_type, param2 = param2})
end
end, end,
}) })
@ -143,7 +149,7 @@ minetest.register_node("techage:ta4_power_box", {
}, },
connects_to = {"techage:ta4_power_cableA", "techage:ta4_power_cableS", connects_to = {"techage:ta4_power_cableA", "techage:ta4_power_cableS",
"techage:ta4_solar_inverter", "techage:ta4_solar_carrier", "techage:ta4_solar_inverter", "techage:ta4_solar_carrier",
"techage:ta4_solar_carrierB"}, "techage:ta4_solar_carrierB", "techage:ta4_cable_wall_entry"},
after_place_node = function(pos, placer, itemstack, pointed_thing) after_place_node = function(pos, placer, itemstack, pointed_thing)
Cable:after_place_node(pos) Cable:after_place_node(pos)

View File

@ -0,0 +1,57 @@
--[[
TechAge
=======
Copyright (C) 2019-2020 Joachim Stolberg
AGPL v3
See LICENSE.txt for more information
TA4 cable wall entry
]]--
local S = techage.S
local TA4_Cable = techage.TA4_Cable
minetest.register_node("techage:ta4_cable_wall_entry", {
description = S("TA4 Cable Wall Entry"),
tiles = {
-- up, down, right, left, back, front
"basic_materials_concrete_block.png",
"basic_materials_concrete_block.png",
"basic_materials_concrete_block.png",
"basic_materials_concrete_block.png",
"basic_materials_concrete_block.png^techage_ta4_cable_hole.png",
"basic_materials_concrete_block.png^techage_ta4_cable_hole.png",
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
if not TA4_Cable:after_place_tube(pos, placer, pointed_thing) then
minetest.remove_node(pos)
return true
end
return false
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
TA4_Cable:after_dig_tube(pos, oldnode)
end,
paramtype2 = "facedir", -- important!
on_rotate = screwdriver.disallow, -- important!
groups = {crumbly = 2, cracky = 2, snappy = 2},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = "techage:ta4_cable_wall_entry",
recipe = {
{"", "techage:ta4_power_cableS", ""},
{"", "basic_materials:concrete_block", ""},
{"", "",""},
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

After

Width:  |  Height:  |  Size: 396 B