This commit is contained in:
1F616EMO 2024-01-30 20:16:47 +08:00
parent 11a441f274
commit 9f13da0971
No known key found for this signature in database
GPG Key ID: EF52EFA8E05859B2
3 changed files with 462 additions and 462 deletions

View File

@ -1,16 +1,16 @@
TRAINBLOCKS: Adds signs fitting the advtrains theme TRAINBLOCKS: Adds signs fitting the advtrains theme
Copyright (C) 2018 maxx, LuLa, gpcf Copyright (C) 2018 maxx, LuLa, gpcf
Copyright (C) 2024 1F616EMO Copyright (C) 2024 1F616EMO
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.

View File

@ -1,26 +1,26 @@
-- trainblocks/alias.lua -- trainblocks/alias.lua
-- For compactibility with advtrains_subwayblocks -- For compactibility with advtrains_subwayblocks
--[[ --[[
Copyright (C) 2018 maxx, LuLa, gpcf Copyright (C) 2018 maxx, LuLa, gpcf
Copyright (C) 2024 1F616EMO Copyright (C) 2024 1F616EMO
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
]] ]]
for count = 1, 10, 1 do for count = 1, 10, 1 do
minetest.register_alias("advtrains_subwayblocks:line" .. count, "trainblocks:line" .. count) minetest.register_alias("advtrains_subwayblocks:line" .. count, "trainblocks:line" .. count)
end end
minetest.register_alias("advtrains_subwayblocks:germany", "trainblocks:subwayblock") minetest.register_alias("advtrains_subwayblocks:germany", "trainblocks:subwayblock")
minetest.register_alias("advtrains_subwayblocks:mr", "trainblocks:mr") minetest.register_alias("advtrains_subwayblocks:mr", "trainblocks:mr")

842
init.lua
View File

@ -1,421 +1,421 @@
-- trainblocks/init.lua -- trainblocks/init.lua
-- Adds signs fitting the advtrains theme -- Adds signs fitting the advtrains theme
--[[ --[[
Copyright (C) 2018 maxx, LuLa, gpcf Copyright (C) 2018 maxx, LuLa, gpcf
Copyright (C) 2020, 2021 Montandalar/Blockhead Copyright (C) 2020, 2021 Montandalar/Blockhead
Copyright (C) 2024 1F616EMO Copyright (C) 2024 1F616EMO
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
]] ]]
local S = minetest.get_translator("trainblocks") local S = minetest.get_translator("trainblocks")
minetest.register_node("trainblocks:subwayblock", { minetest.register_node("trainblocks:subwayblock", {
description = S("Subway block"), description = S("Subway block"),
light_source = 8, light_source = 8,
tiles = { tiles = {
"down_subwayblock.png", "down_subwayblock.png",
"down_subwayblock.png", "down_subwayblock.png",
"front_subwayblock.png", "front_subwayblock.png",
"front_subwayblock.png", "front_subwayblock.png",
"front_subwayblock.png", "front_subwayblock.png",
"front_subwayblock.png" "front_subwayblock.png"
}, },
is_ground_content = true, is_ground_content = true,
groups = { cracky = 3 }, groups = { cracky = 3 },
drop = "trainblocks:subwayblock" drop = "trainblocks:subwayblock"
}) })
do do
-- Add a setting for legacy sbahnblock textures -- Add a setting for legacy sbahnblock textures
-- from https://github.com/Montandalar/trainblocks/commit/0fa3f52123bfe5aea386f987e7204c94aba72725 -- from https://github.com/Montandalar/trainblocks/commit/0fa3f52123bfe5aea386f987e7204c94aba72725
local sbahncolorize = "" local sbahncolorize = ""
if minetest.settings:get_bool("trainblocks_legacy_sbahnblock", false) then if minetest.settings:get_bool("trainblocks_legacy_sbahnblock", false) then
sbahncolorize = "^[colorize:#00DF11FF" sbahncolorize = "^[colorize:#00DF11FF"
end --00E876FF end --00E876FF
minetest.register_node("trainblocks:sbahnblock", { minetest.register_node("trainblocks:sbahnblock", {
description = S("S-Bahn block"), description = S("S-Bahn block"),
light_source = 8, light_source = 8,
tiles = { tiles = {
"down_sbahnblock.png", "down_sbahnblock.png",
"down_sbahnblock.png" .. sbahncolorize, "down_sbahnblock.png" .. sbahncolorize,
"front_sbahnblock.png", "front_sbahnblock.png",
"front_sbahnblock.png", "front_sbahnblock.png",
"front_sbahnblock.png", "front_sbahnblock.png",
"front_sbahnblock.png" "front_sbahnblock.png"
}, },
is_ground_content = true, is_ground_content = true,
groups = { cracky = 3 }, groups = { cracky = 3 },
drop = "trainblocks:sbahnblock" drop = "trainblocks:sbahnblock"
}) })
end end
-- Platform 0 from https://github.com/Montandalar/trainblocks/commit/12a365d1c280d2b106621a8088229ee50937c488 -- Platform 0 from https://github.com/Montandalar/trainblocks/commit/12a365d1c280d2b106621a8088229ee50937c488
-- Bonus: Line 0 -- Bonus: Line 0
for count = 0, 10, 1 do for count = 0, 10, 1 do
minetest.register_node("trainblocks:line" .. count, { minetest.register_node("trainblocks:line" .. count, {
description = S("Line sign @1", count), description = S("Line sign @1", count),
tiles = { "front_line" .. count .. ".png" }, tiles = { "front_line" .. count .. ".png" },
drawtype = "nodebox", drawtype = "nodebox",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
legacy_wallmounted = true, legacy_wallmounted = true,
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
sunlight_propagates = true, sunlight_propagates = true,
is_ground_content = false, is_ground_content = false,
walkable = false, walkable = false,
groups = { groups = {
choppy = 2, choppy = 2,
attached_node = 1, attached_node = 1,
flammable = 2, flammable = 2,
oddly_breakable_by_hand = 3, oddly_breakable_by_hand = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
node_box = { node_box = {
type = "wallmounted", type = "wallmounted",
wall_top = { -0.5, -0.25, -0.25, -0.4375, 0.25, 0.25 }, wall_top = { -0.5, -0.25, -0.25, -0.4375, 0.25, 0.25 },
wall_bottom = { -0.5, -0.25, -0.25, -0.4375, 0.25, 0.25 }, wall_bottom = { -0.5, -0.25, -0.25, -0.4375, 0.25, 0.25 },
wall_side = { -0.5, -0.25, -0.25, -0.4375, 0.25, 0.25 }, wall_side = { -0.5, -0.25, -0.25, -0.4375, 0.25, 0.25 },
} }
}) })
minetest.register_node("trainblocks:platformsign" .. count, { minetest.register_node("trainblocks:platformsign" .. count, {
description = S("Platform sign @1", count), description = S("Platform sign @1", count),
drawtype = "nodebox", drawtype = "nodebox",
tiles = { "front_platform" .. count .. ".png" }, tiles = { "front_platform" .. count .. ".png" },
inventory_image = "inventory_platform" .. count .. ".png", inventory_image = "inventory_platform" .. count .. ".png",
light_source = 5, light_source = 5,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -4 / 16, -4 / 16, 6 / 16, 4 / 16, 4 / 16, 8 / 16 }, { -4 / 16, -4 / 16, 6 / 16, 4 / 16, 4 / 16, 8 / 16 },
}, },
}, },
}) })
end end
minetest.register_node("trainblocks:subwaysignL", { minetest.register_node("trainblocks:subwaysignL", {
description = S("Subway Sign (Left)"), description = S("Subway Sign (Left)"),
tiles = { tiles = {
"subway_sign3.png", "subway_sign3.png",
"subway_sign3.png", "subway_sign3.png",
"subway_sign3.png", "subway_sign3.png",
"subway_sign3.png", "subway_sign3.png",
"subway_sign2.png", "subway_sign2.png",
"subway_sign2.png^[transformFX", "subway_sign2.png^[transformFX",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
}) })
minetest.register_node("trainblocks:subwaysignR", { minetest.register_node("trainblocks:subwaysignR", {
description = S("Subway Sign (Right)"), description = S("Subway Sign (Right)"),
tiles = { tiles = {
"subway_sign3.png", "subway_sign3.png",
"subway_sign3.png", "subway_sign3.png",
"subway_sign3.png", "subway_sign3.png",
"subway_sign3.png", "subway_sign3.png",
"subway_sign2.png", "subway_sign2.png",
"subway_sign2.png", "subway_sign2.png",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
}) })
minetest.register_node("trainblocks:sbahnsignL", { minetest.register_node("trainblocks:sbahnsignL", {
description = S("S-Bahn Sign (Left)"), description = S("S-Bahn Sign (Left)"),
tiles = { tiles = {
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign2l.png", "sbahn_sign2l.png",
"sbahn_sign2l.png^[transformFX", "sbahn_sign2l.png^[transformFX",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
}) })
minetest.register_node("trainblocks:sbahnsignR", { minetest.register_node("trainblocks:sbahnsignR", {
description = S("S-Bahn Sign (Right)"), description = S("S-Bahn Sign (Right)"),
tiles = { tiles = {
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign3.png", "sbahn_sign3.png",
"sbahn_sign2.png", "sbahn_sign2.png",
"sbahn_sign2.png", "sbahn_sign2.png",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
}) })
minetest.register_node("trainblocks:stationsignL", { minetest.register_node("trainblocks:stationsignL", {
description = S("Station Sign (Left)"), description = S("Station Sign (Left)"),
tiles = { tiles = {
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign2.png", "station_sign2.png",
"station_sign2.png^[transformFX", "station_sign2.png^[transformFX",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
}) })
minetest.register_node("trainblocks:stationsignR", { minetest.register_node("trainblocks:stationsignR", {
description = S("Station Sign (Right)"), description = S("Station Sign (Right)"),
tiles = { tiles = {
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign2.png", "station_sign2.png",
"station_sign2.png", "station_sign2.png",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
}) })
minetest.register_node("trainblocks:station_block", { minetest.register_node("trainblocks:station_block", {
description = S("Station Block"), description = S("Station Block"),
light_source = 8, light_source = 8,
tiles = { tiles = {
"down_station_sign.png", "down_station_sign.png",
"down_station_sign.png", "down_station_sign.png",
"front_station_sign.png", "front_station_sign.png",
"front_station_sign.png", "front_station_sign.png",
"front_station_sign.png", "front_station_sign.png",
"front_station_sign.png" "front_station_sign.png"
}, },
is_ground_content = true, is_ground_content = true,
groups = { cracky = 3 }, groups = { cracky = 3 },
drop = "trainblocks:station_block" drop = "trainblocks:station_block"
}) })
minetest.register_node("trainblocks:mr", { minetest.register_node("trainblocks:mr", {
description = S("Mountain Railway Block"), description = S("Mountain Railway Block"),
light_source = 8, light_source = 8,
tiles = { tiles = {
"down_mr.png", "down_mr.png",
"down_mr.png", "down_mr.png",
"front_mr.png", "front_mr.png",
"front_mr.png", "front_mr.png",
"front_mr.png", "front_mr.png",
"front_mr.png" "front_mr.png"
}, },
is_ground_content = true, is_ground_content = true,
groups = { cracky = 3 }, groups = { cracky = 3 },
drop = "trainblocks:sbahnblock" drop = "trainblocks:sbahnblock"
}) })
-- Modern station blocks -- Modern station blocks
-- from https://github.com/Montandalar/trainblocks/commit/12a365d1c280d2b106621a8088229ee50937c488 -- from https://github.com/Montandalar/trainblocks/commit/12a365d1c280d2b106621a8088229ee50937c488
minetest.register_node("trainblocks:stationsignL_modern", { minetest.register_node("trainblocks:stationsignL_modern", {
description = S("Modern Station Sign (Left)"), description = S("Modern Station Sign (Left)"),
tiles = { tiles = {
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign2_modern.png", "station_sign2_modern.png",
"station_sign2_modern.png^[transformFX", "station_sign2_modern.png^[transformFX",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { cracky = 3 }, groups = { cracky = 3 },
}) })
minetest.register_node("trainblocks:stationsignR_modern", { minetest.register_node("trainblocks:stationsignR_modern", {
description = S("Modern Station Sign (Right)"), description = S("Modern Station Sign (Right)"),
tiles = { tiles = {
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign3.png", "station_sign3.png",
"station_sign2_modern.png", "station_sign2_modern.png",
"station_sign2_modern.png", "station_sign2_modern.png",
}, },
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 }, { -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
}, },
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
paramtype = 'light', paramtype = 'light',
light_source = 6, light_source = 6,
is_ground_content = false, is_ground_content = false,
groups = { cracky = 3 }, groups = { cracky = 3 },
}) })
minetest.register_node("trainblocks:station_block_modern", { minetest.register_node("trainblocks:station_block_modern", {
description = S("Modern Station Block"), description = S("Modern Station Block"),
light_source = 8, light_source = 8,
tiles = { tiles = {
"down_station_sign.png", "down_station_sign.png",
"down_station_sign.png", "down_station_sign.png",
"front_station_sign_modern.png", "front_station_sign_modern.png",
"front_station_sign_modern.png", "front_station_sign_modern.png",
"front_station_sign_modern.png", "front_station_sign_modern.png",
"front_station_sign_modern.png", "front_station_sign_modern.png",
}, },
is_ground_content = true, is_ground_content = true,
groups = { cracky = 3 }, groups = { cracky = 3 },
drop = "trainblocks:station_block" drop = "trainblocks:station_block"
}) })
-- "No Pedestrains" signs -- "No Pedestrains" signs
-- from https://github.com/Montandalar/trainblocks/commit/3e00d5cf40759c085deccc915f1fa6fb2c092523 -- from https://github.com/Montandalar/trainblocks/commit/3e00d5cf40759c085deccc915f1fa6fb2c092523
-- train blocking fix from https://github.com/Montandalar/trainblocks/commit/a312afc27c2967e0ba04d6b4da3a074cf54f73df -- train blocking fix from https://github.com/Montandalar/trainblocks/commit/a312afc27c2967e0ba04d6b4da3a074cf54f73df
local box_flat = { local box_flat = {
type = "fixed", type = "fixed",
fixed = { -0.5000, -0.4375, -0.5000, 0.5000, -0.4375, 0.5000 } fixed = { -0.5000, -0.4375, -0.5000, 0.5000, -0.4375, 0.5000 }
} }
local pedsigns = { local pedsigns = {
{ name = "no_pedestrians", desc = S("No Pedestrians Sign") }, { name = "no_pedestrians", desc = S("No Pedestrians Sign") },
{ name = "durchgang_verboten", desc = S("No Pedestrians Sign (German)") } { name = "durchgang_verboten", desc = S("No Pedestrians Sign (German)") }
} }
for _, v in pairs(pedsigns) do for _, v in pairs(pedsigns) do
minetest.register_node("trainblocks:" .. v.name, { minetest.register_node("trainblocks:" .. v.name, {
description = v.desc, description = v.desc,
light_source = 2, light_source = 2,
drawtype = "signlike", drawtype = "signlike",
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
tiles = { v.name .. ".png" }, tiles = { v.name .. ".png" },
inventory_image = v.name .. ".png", inventory_image = v.name .. ".png",
wield_image = v.name .. ".png", wield_image = v.name .. ".png",
groups = { groups = {
cracky = 3, cracky = 3,
not_blocking_trains = 1, not_blocking_trains = 1,
}, },
drop = "trainblocks:" .. v.name, drop = "trainblocks:" .. v.name,
is_ground_content = true, is_ground_content = true,
node_box = box_flat, node_box = box_flat,
selection_box = box_flat, selection_box = box_flat,
}) })
end end
-- Add a setting to disable crafting recipes -- Add a setting to disable crafting recipes
-- from https://github.com/Montandalar/trainblocks/commit/15e2b88f44671aa68d1a758a6aca363b602a1282 -- from https://github.com/Montandalar/trainblocks/commit/15e2b88f44671aa68d1a758a6aca363b602a1282
if not minetest.settings:get_bool('trainblocks_disable_recipes', false) then if not minetest.settings:get_bool('trainblocks_disable_recipes', false) then
dofile(minetest.get_modpath("trainblocks") .. "/craft.lua") dofile(minetest.get_modpath("trainblocks") .. "/craft.lua")
end end
dofile(minetest.get_modpath("trainblocks") .. "/alias.lua") dofile(minetest.get_modpath("trainblocks") .. "/alias.lua")