Apply changes from https://github.com/Montandalar/trainblocks
44
.gitignore
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
# Compiled Lua sources
|
||||
luac.out
|
||||
|
||||
# luarocks build files
|
||||
*.src.rock
|
||||
*.zip
|
||||
*.tar.gz
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.os
|
||||
*.ko
|
||||
*.obj
|
||||
!models/*.obj
|
||||
*.elf
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
*.def
|
||||
*.exp
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
*.tr.old
|
||||
|
172
craft.lua
@ -36,17 +36,18 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
--lineblocks from 1 to 10
|
||||
local dyes1 = { "blue", "red", "violet", "green", "orange", "yellow", "gray", "magenta", "cyan", "black" }
|
||||
local dyes2 = { "white", "white", "white", "white", "white", "black", "white", "white", "white", "white" }
|
||||
-- lineblocks from 1 to 10
|
||||
-- gray -> grey from https://github.com/Montandalar/trainblocks/commit/5e6f906f7d5716127a4b760df8bc6ea1f61c84ea
|
||||
-- Bonus: Line 0
|
||||
local dyes1 = { "blue", "blue", "red", "violet", "green", "orange", "yellow", "grey", "magenta", "cyan", "black" }
|
||||
local dyes2 = { "blue", "white", "white", "white", "white", "white", "black", "white", "white", "white", "white" }
|
||||
|
||||
for count = 1, 10, 1 do
|
||||
for count = 0, 10, 1 do
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:line" .. count .. " 4",
|
||||
recipe = {
|
||||
{ '', "dye:" .. dyes1[count], '' },
|
||||
{ "dye:" .. dyes2[count], 'default:glass', '' },
|
||||
{ '', '', '' },
|
||||
{ '', "dye:" .. dyes1[count + 1], '' },
|
||||
{ "dye:" .. dyes2[count + 1], 'default:glass', '' },
|
||||
}
|
||||
})
|
||||
end
|
||||
@ -58,18 +59,14 @@ end
|
||||
minetest.register_craft({
|
||||
output = 'trainblocks:subwaysignL 2',
|
||||
recipe = {
|
||||
{ '', '', '' },
|
||||
{ 'dye:white', 'default:glass', 'dye:blue' },
|
||||
{ '', '', '' },
|
||||
{ 'dye:white', 'default:glass', 'dye:blue' }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'trainblocks:subwaysignR 2',
|
||||
recipe = {
|
||||
{ '', '', '' },
|
||||
{ 'dye:blue', 'default:glass', 'dye:white' },
|
||||
{ '', '', '' },
|
||||
}
|
||||
})
|
||||
|
||||
@ -78,17 +75,160 @@ minetest.register_craft({
|
||||
minetest.register_craft({
|
||||
output = 'trainblocks:sbahnsignL 2',
|
||||
recipe = {
|
||||
{ '', '', '' },
|
||||
{ 'dye:white', 'default:glass', 'dye:green' },
|
||||
{ '', '', '' },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'trainblocks:sbahnsignR 2',
|
||||
recipe = {
|
||||
{ '', '', '' },
|
||||
{ 'dye:blue', 'default:glass', 'dye:green' },
|
||||
{ '', '', '' },
|
||||
}
|
||||
})
|
||||
|
||||
-- Switch betwen modern station direction signs and older style
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/4f4f6004e1e5067969fcc0efd8785a55ef36a6e2
|
||||
|
||||
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'
|
||||
})
|
||||
|
||||
-- Platform signs 0-10
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/f5e86f18f437ba3cb3337369d0b009e94dd5a8f5
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign0",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'', 'dye:white', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign1",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', 'dye:white'},
|
||||
{'', '', 'dye:white'},
|
||||
{'', '' ,'dye:white'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign2",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'dye:white', 'dye:white', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign3",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'dye:white', 'dye:white', 'dye:white'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign4",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'dye:white', 'dye:white', ''},
|
||||
{'dye:white', 'dye:white' ,''}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign5",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'dye:white', 'dye:white', 'dye:white'},
|
||||
{'dye:white', 'dye:white' ,''}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign6",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'dye:white', 'dye:white', 'dye:white'},
|
||||
{'dye:white', 'dye:white' ,'dye:white'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign7",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', 'dye:white'},
|
||||
{'', '', 'dye:white'},
|
||||
{'', 'dye:white' ,''}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign8",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', 'dye:white'},
|
||||
{'dye:white', '', 'dye:white'},
|
||||
{'dye:white', 'dye:white' ,'dye:white'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign9",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', 'dye:white'},
|
||||
{'', 'dye:white', 'dye:white'},
|
||||
{'', '' ,'dye:white'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "trainblocks:platformsign10",
|
||||
recipe = {
|
||||
{'dye:blue', 'default:glass', ''},
|
||||
{'dye:white', '', ''},
|
||||
{'dye:white', '' ,'dye:white'}
|
||||
}
|
||||
})
|
||||
|
||||
-- Recipies for (modern) station blocks
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/735e61288ad55317d4fffcdb4e58b5feebc419d0
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'trainblocks:station_block',
|
||||
recipe = {
|
||||
{'', 'dye:black', ''},
|
||||
{'dye:white', 'default:glass', 'dye:white'},
|
||||
{'', 'dye:black', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = 'trainblocks:station_block_modern',
|
||||
recipe = {'trainblocks:station_block'}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
recipe = {'trainblocks:station_block_modern'},
|
||||
output = 'trainblocks:station_block'
|
||||
})
|
132
init.lua
@ -2,6 +2,7 @@
|
||||
-- Adds signs fitting the advtrains theme
|
||||
--[[
|
||||
Copyright (C) 2018 maxx, LuLa, gpcf
|
||||
Copyright (C) 2020, 2021 Montandalar/Blockhead
|
||||
Copyright (C) 2024 1F616EMO
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -36,12 +37,21 @@ minetest.register_node("trainblocks:subwayblock", {
|
||||
drop = "trainblocks:subwayblock"
|
||||
})
|
||||
|
||||
minetest.register_node("trainblocks:sbahnblock", {
|
||||
do
|
||||
-- Add a setting for legacy sbahnblock textures
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/0fa3f52123bfe5aea386f987e7204c94aba72725
|
||||
|
||||
local sbahncolorize = ""
|
||||
if minetest.settings:get_bool("trainblocks_legacy_sbahnblock", false) then
|
||||
sbahncolorize = "^[colorize:#00DF11FF"
|
||||
end --00E876FF
|
||||
|
||||
minetest.register_node("trainblocks:sbahnblock", {
|
||||
description = S("S-Bahn block"),
|
||||
light_source = 8,
|
||||
tiles = {
|
||||
"down_sbahnblock.png",
|
||||
"down_sbahnblock.png",
|
||||
"down_sbahnblock.png" .. sbahncolorize,
|
||||
"front_sbahnblock.png",
|
||||
"front_sbahnblock.png",
|
||||
"front_sbahnblock.png",
|
||||
@ -50,9 +60,12 @@ minetest.register_node("trainblocks:sbahnblock", {
|
||||
is_ground_content = true,
|
||||
groups = { cracky = 3 },
|
||||
drop = "trainblocks:sbahnblock"
|
||||
})
|
||||
})
|
||||
end
|
||||
|
||||
for count = 1, 10, 1 do
|
||||
-- Platform 0 from https://github.com/Montandalar/trainblocks/commit/12a365d1c280d2b106621a8088229ee50937c488
|
||||
-- Bonus: Line 0
|
||||
for count = 0, 10, 1 do
|
||||
minetest.register_node("trainblocks:line" .. count, {
|
||||
description = S("Line sign @1", count),
|
||||
tiles = { "front_line" .. count .. ".png" },
|
||||
@ -76,7 +89,6 @@ for count = 1, 10, 1 do
|
||||
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 },
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@ -296,6 +308,114 @@ minetest.register_node("trainblocks:mr", {
|
||||
drop = "trainblocks:sbahnblock"
|
||||
})
|
||||
|
||||
-- Modern station blocks
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/12a365d1c280d2b106621a8088229ee50937c488
|
||||
|
||||
minetest.register_node("trainblocks:stationsignL_modern", {
|
||||
description = S("Modern Station Sign (Left)"),
|
||||
tiles = {
|
||||
"station_sign3.png",
|
||||
"station_sign3.png",
|
||||
"station_sign3.png",
|
||||
"station_sign3.png",
|
||||
"station_sign2_modern.png",
|
||||
"station_sign2_modern.png^[transformFX",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
|
||||
},
|
||||
},
|
||||
|
||||
paramtype2 = "facedir",
|
||||
paramtype = 'light',
|
||||
light_source = 6,
|
||||
is_ground_content = false,
|
||||
groups = { cracky = 3 },
|
||||
})
|
||||
|
||||
minetest.register_node("trainblocks:stationsignR_modern", {
|
||||
description = S("Modern Station Sign (Right)"),
|
||||
tiles = {
|
||||
"station_sign3.png",
|
||||
"station_sign3.png",
|
||||
"station_sign3.png",
|
||||
"station_sign3.png",
|
||||
"station_sign2_modern.png",
|
||||
"station_sign2_modern.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -8 / 16, -5 / 16, 6 / 16, 8 / 16, 5 / 16, 8 / 16 },
|
||||
},
|
||||
},
|
||||
|
||||
paramtype2 = "facedir",
|
||||
paramtype = 'light',
|
||||
light_source = 6,
|
||||
is_ground_content = false,
|
||||
groups = { cracky = 3 },
|
||||
})
|
||||
|
||||
minetest.register_node("trainblocks:station_block_modern", {
|
||||
description = S("Modern Station Block"),
|
||||
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"
|
||||
})
|
||||
|
||||
-- "No Pedestrains" signs
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/3e00d5cf40759c085deccc915f1fa6fb2c092523
|
||||
-- train blocking fix from https://github.com/Montandalar/trainblocks/commit/a312afc27c2967e0ba04d6b4da3a074cf54f73df
|
||||
|
||||
local box_flat = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5000, -0.4375, -0.5000, 0.5000, -0.4375, 0.5000 }
|
||||
}
|
||||
|
||||
local pedsigns = {
|
||||
{ name = "no_pedestrians", desc = S("No Pedestrians Sign") },
|
||||
{ name = "durchgang_verboten", desc = S("No Pedestrians Sign (German)") }
|
||||
}
|
||||
|
||||
for _, v in pairs(pedsigns) do
|
||||
minetest.register_node("trainblocks:" .. v.name, {
|
||||
description = v.desc,
|
||||
light_source = 2,
|
||||
drawtype = "signlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
tiles = { v.name .. ".png" },
|
||||
inventory_image = v.name .. ".png",
|
||||
wield_image = v.name .. ".png",
|
||||
groups = {
|
||||
cracky = 3,
|
||||
not_blocking_trains = 1,
|
||||
},
|
||||
drop = "trainblocks:" .. v.name,
|
||||
is_ground_content = true,
|
||||
node_box = box_flat,
|
||||
selection_box = box_flat,
|
||||
})
|
||||
end
|
||||
|
||||
-- Add a setting to disable crafting recipes
|
||||
-- from https://github.com/Montandalar/trainblocks/commit/15e2b88f44671aa68d1a758a6aca363b602a1282
|
||||
if not minetest.settings:get_bool('trainblocks_disable_recipes', false) then
|
||||
dofile(minetest.get_modpath("trainblocks") .. "/craft.lua")
|
||||
end
|
||||
|
||||
dofile(minetest.get_modpath("trainblocks") .. "/craft.lua")
|
||||
dofile(minetest.get_modpath("trainblocks") .. "/alias.lua")
|
||||
|
@ -1,4 +1,6 @@
|
||||
# textdomain: trainblocks
|
||||
|
||||
### init.lua ###
|
||||
Subway block=
|
||||
S-Bahn block=
|
||||
Line sign @1=
|
||||
@ -11,3 +13,6 @@ Station Sign (Left)=
|
||||
Station Sign (Right)=
|
||||
Station Block=
|
||||
Mountain Railway Block=
|
||||
Modern Station Sign (Left)=
|
||||
Modern Station Sign (Right)=
|
||||
Modern Station Block=
|
||||
|
@ -1,4 +1,6 @@
|
||||
# textdomain: trainblocks
|
||||
|
||||
### init.lua ###
|
||||
Subway block=地鐵方塊
|
||||
S-Bahn block=城鐵方塊
|
||||
Line sign @1=路線告示牌 @1
|
||||
@ -11,3 +13,6 @@ Station Sign (Left)=車站告示牌(左)
|
||||
Station Sign (Right)=車站告示牌(右)
|
||||
Station Block=車站方塊
|
||||
Mountain Railway Block=山區鐵路方塊
|
||||
Modern Station Sign (Left)=現代車站告示牌(左)
|
||||
Modern Station Sign (Right)=現代車站告示牌(右)
|
||||
Modern Station Block=現代車站方塊
|
||||
|
7
settingtypes.txt
Normal file
@ -0,0 +1,7 @@
|
||||
# Disable crafting recipes. Server admins may want to disable crafting of the
|
||||
# blocks in this mod to restrict their use.
|
||||
trainblocks_disable_recipes (Disable crafting recipes) bool false
|
||||
|
||||
# Puts a vibrant green texture on top of the s-bahn block, which used to be a
|
||||
# missing texture.
|
||||
trainblocks_legacy_sbahnblock (Legacy S-Bahn block) bool false
|
BIN
textures/durchgang_verboten.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
textures/front_line0.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
textures/front_platform0.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
textures/front_station_sign_modern.png
Normal file
After Width: | Height: | Size: 120 B |
BIN
textures/inventory_line0.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
textures/inventory_platform0.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
textures/no_pedestrians.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
textures/station_sign2_modern.png
Normal file
After Width: | Height: | Size: 1.5 KiB |