Cleanup indentation, add recipes for station signs

This commit is contained in:
Montandalar 2020-05-15 03:58:19 +10:00
parent 12a365d1c2
commit 4f4f6004e1
3 changed files with 161 additions and 187 deletions

View File

@ -25,18 +25,16 @@ local dyes1 = {"blue", "red", "violet", "green", "orange", "yellow", "gray", "ma
local dyes2 = {"white", "white", "white", "white", "white", "black", "white", "white", "white", "white"}
for count = 1, 10, 1 do
minetest.register_craft({
output = "trainblocks:line" .. count .. " 4",
recipe = {
{'', "dye:" .. dyes1[count] , ''},
{"dye:" .. dyes2[count], 'default:glass', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = "trainblocks:line" .. count .. " 4",
recipe = {
{'', "dye:" .. dyes1[count] , ''},
{"dye:" .. dyes2[count], 'default:glass', ''},
{'', '', ''},
}
})
end
--subway direction signs
minetest.register_craft({
@ -72,7 +70,50 @@ minetest.register_craft({
output = 'trainblocks:sbahnsignR 2',
recipe = {
{'', '', ''},
{'dye:blue', 'default:glass', 'dye:green'},
{'dye:white', 'default:glass', 'dye:green'},
{'', '', ''},
}
})
-- Station direction signs
minetest.register_craft({
output = 'trainblocks:stationsignL 2',
recipe = {
{'', '', ''},
{'dye:white', 'default:glass', 'dye:black'},
{'', '', ''}
}
})
minetest.register_craft({
output = 'trainblocks:stationsignR 2',
recipe = {
{'', '', ''},
{'dye:black', 'default:glass', 'dye:white'},
{'', '', ''}
}
})
-- Switch betwen modern station direction signs and older style
minetest.register_craft({
type = "shapeless",
output = 'trainblocks:stationsignR_modern',
recipe = {'trainblocks:stationsignR'}
})
minetest.register_craft({
type = "shapeless",
output = 'trainblocks:stationsignL_modern',
recipe = {'trainblocks:stationsignL'}
})
minetest.register_craft({
type = "shapeless",
recipe = {'trainblocks:stationsignR_modern'},
output = 'trainblocks:stationsignR'
})
minetest.register_craft({
type = "shapeless",
recipe = {'trainblocks:stationsignL_modern'},
output = 'trainblocks:stationsignL'
})

284
init.lua
View File

@ -1,15 +1,11 @@
--[[
Trainblocks_bc
=============
Trainblocks
===========
This mod adds signs for the advanced trains mod by orwell and it is bachwards-compatible to the advtrains_subwayblocks mod
PLEASE REMOVE THE _bc IN THE MODNAME!!!
version 0.3 by maxx and gpcf
Copyright (C) 2018 maxx and gpcf
Copyright (C) 2020 Montandalar/Blockhead
See LICENSE.txt for more information
@ -18,107 +14,91 @@
2018-03-05 version 0.2 added better node registrations and crafting receipes
2018-03-06 version 0.21 added alias
2018-03-07 version 0.3 removed alias in trainblocks and created trainblocks_bc for bachwards-compatibility | added new signs and blocks
2020-05-15 version 0.4 Added fixed s-bahnblock texture and mod.conf from maxx
cleaned up code indentation,
Added a modern station block with recipes
Added recipes for station blocks and signs.
Added platform 0 sign.
]]--
--import file /craft.lua
dofile(minetest.get_modpath("trainblocks") .. "/craft.lua")
dofile(minetest.get_modpath("trainblocks") .. "/alias.lua")
--subwayblock germany
minetest.register_node("trainblocks:subwayblock", {
description = "Subwayblock",
description = "Subwayblock",
light_source = 8,
tiles = {
"down_subwayblock.png",
"down_subwayblock.png",
"front_subwayblock.png",
"front_subwayblock.png",
"front_subwayblock.png",
"front_subwayblock.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:subwayblock"
tiles = {
"down_subwayblock.png",
"down_subwayblock.png",
"front_subwayblock.png",
"front_subwayblock.png",
"front_subwayblock.png",
"front_subwayblock.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:subwayblock"
})
--sbahn block
minetest.register_node("trainblocks:sbahnblock", {
description = "Sbahnblock",
light_source = 8,
description = "Sbahnblock",
light_source = 8,
tiles = {
"down_sbahnblock.png",
"down_sbahnblock.png",
"front_sbahnblock.png",
"front_sbahnblock.png",
"front_sbahnblock.png",
"front_sbahnblock.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:sbahnblock"
})
--subway signs Line 1 to 10
--[[for count = 1, 10, 1 do
minetest.register_node("trainblocks:line" .. count, {
description = "Line " .. count,
drawtype = "nodebox",
tiles = {"front_line" .. count .. ".png"},
inventory_image = "inventory_line" .. count .. ".png",
light_source = 5,
groups = {cracky = 3},
paramtype2 = "facedir",
paramtype = 'light',
node_box = {
type = "fixed",
fixed = {
{ -4/16, -4/16, 6/16, 4/16, 4/16, 8/16},
},
"down_sbahnblock.png",
"down_sbahnblock.png",
"front_sbahnblock.png",
"front_sbahnblock.png",
"front_sbahnblock.png",
"front_sbahnblock.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:sbahnblock"
})
end --]]
--for bachwards-compatibility there has to be a signlike drawtype
-- Subway signs Line 1 to 10
for count = 1, 10 do
minetest.register_node("trainblocks:line" .. count, {
description = "Line " .. count,
drawtype = "nodebox",
tiles = {"front_line" .. count .. ".png"},
inventory_image = "inventory_line" .. count .. ".png",
light_source = 5,
groups = {cracky = 3},
paramtype2 = "facedir",
paramtype = 'light',
node_box = {
type = "fixed",
fixed = {
{ -4/16, -4/16, 6/16, 4/16, 4/16, 8/16},
},
},
})
end
-- Platform signs from 1 to 10
for count = 0, 10, 1 do
minetest.register_node("trainblocks:platformsign" .. count, {
description = "Platform Sign " .. count,
drawtype = "nodebox",
tiles = {"front_platform" .. count .. ".png"},
inventory_image = "inventory_platform" .. count .. ".png",
light_source = 5,
groups = {cracky = 3},
paramtype2 = "facedir",
paramtype = 'light',
node_box = {
type = "fixed",
fixed = {
{ -4/16, -4/16, 6/16, 4/16, 4/16, 8/16},
},
},
})
end
for count = 1, 10, 1 do
minetest.register_node("trainblocks:line" .. count, {
description = "Line ".. count,
tiles = {"front_line" .. count .. ".png"},
drawtype = "nodebox",
paramtype2 = "wallmounted",
legacy_wallmounted = true,
paramtype=light,
light_source=12,
sunlight_propagates = true,
is_ground_content = false,
walkable = false,
groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3},
node_box = {
type = "wallmounted",
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_side = {-0.5, -0.25, -0.25, -0.4375, 0.25, 0.25},
}
})
end
--subway signs R and L
minetest.register_node("trainblocks:subwaysignL", {
description = "Subway Sign Left",
tiles = {
@ -136,8 +116,6 @@ minetest.register_node("trainblocks:subwaysignL", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -162,8 +140,6 @@ minetest.register_node("trainblocks:subwaysignR", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -171,9 +147,7 @@ minetest.register_node("trainblocks:subwaysignR", {
groups = {cracky = 3},
})
--subway signs R and L
-- S-bahn signs R and L
minetest.register_node("trainblocks:sbahnsignL", {
description = "SBahn Sign Left",
tiles = {
@ -191,8 +165,6 @@ minetest.register_node("trainblocks:sbahnsignL", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -217,8 +189,6 @@ minetest.register_node("trainblocks:sbahnsignR", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -226,10 +196,7 @@ minetest.register_node("trainblocks:sbahnsignR", {
groups = {cracky = 3},
})
--station signs
-- Station signs
minetest.register_node("trainblocks:stationsignR", {
description = "Station Sign Right",
tiles = {
@ -247,8 +214,6 @@ minetest.register_node("trainblocks:stationsignR", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -273,8 +238,6 @@ minetest.register_node("trainblocks:stationsignR_modern", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -299,8 +262,6 @@ minetest.register_node("trainblocks:stationsignL", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -325,8 +286,6 @@ minetest.register_node("trainblocks:stationsignL_modern", {
{ -8/16, -5/16, 6/16, 8/16, 5/16, 8/16},
},
},
paramtype2 = "facedir",
paramtype = 'light',
light_source = 6,
@ -335,77 +294,50 @@ minetest.register_node("trainblocks:stationsignL_modern", {
})
minetest.register_node("trainblocks:station_block", {
description = "Station Block",
light_source = 8,
description = "Station Block",
light_source = 8,
tiles = {
"down_station_sign.png",
"down_station_sign.png",
"front_station_sign.png",
"front_station_sign.png",
"front_station_sign.png",
"front_station_sign.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:station_block"
"down_station_sign.png",
"down_station_sign.png",
"front_station_sign.png",
"front_station_sign.png",
"front_station_sign.png",
"front_station_sign.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:station_block"
})
minetest.register_node("trainblocks:station_block_modern", {
description = "Station Block (modern)",
light_source = 8,
description = "Station Block (modern)",
light_source = 8,
tiles = {
"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",
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:station_block"
})
--platform signs from 1 to 10
for count = 0, 10, 1 do
minetest.register_node("trainblocks:platformsign" .. count, {
description = "Platform Sign " .. count,
drawtype = "nodebox",
tiles = {"front_platform" .. count .. ".png"},
inventory_image = "inventory_platform" .. count .. ".png",
light_source = 5,
groups = {cracky = 3},
paramtype2 = "facedir",
paramtype = 'light',
node_box = {
type = "fixed",
fixed = {
{ -4/16, -4/16, 6/16, 4/16, 4/16, 8/16},
},
"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",
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:station_block"
})
end
--gabriel's mountain railway block
-- gabriel's mountain railway block
minetest.register_node("trainblocks:mr", {
description = "Mountain Railway Block",
light_source = 8,
description = "Mountain Railway Block",
light_source = 8,
tiles = {
"down_mr.png",
"down_mr.png",
"front_mr.png",
"front_mr.png",
"front_mr.png",
"front_mr.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:sbahnblock"
"down_mr.png",
"down_mr.png",
"front_mr.png",
"front_mr.png",
"front_mr.png",
"front_mr.png"
},
is_ground_content = true,
groups = {cracky = 3},
drop = "trainblocks:sbahnblock"
})

1
mod.conf Normal file
View File

@ -0,0 +1 @@
name=trainblocks