Railcorridors: Use dark oak wood in terracotta

This commit is contained in:
Wuzzy 2017-12-08 16:12:31 +01:00
parent da8729a7a1
commit 3443e68b76
2 changed files with 43 additions and 21 deletions

View File

@ -12,15 +12,30 @@ tsm_railcorridors.nodes = {
torch_wall = "mcl_torches:torch_wall", torch_wall = "mcl_torches:torch_wall",
cobweb = "mcl_core:cobweb", cobweb = "mcl_core:cobweb",
spawner = "mcl_mobspawners:spawner", spawner = "mcl_mobspawners:spawner",
}
local mg_name = minetest.get_mapgen_setting("mg_name")
if mg_name == "v6" then
-- In v6, wood is chosen randomly.
--[[ Wood types for the corridors. Corridors are made out of full wood blocks --[[ Wood types for the corridors. Corridors are made out of full wood blocks
and posts. For each corridor system, a random wood type is chosen with the chance and posts. For each corridor system, a random wood type is chosen with the chance
specified in per mille. ]] specified in per mille. ]]
corridor_woods = { tsm_railcorridors.nodes.corridor_woods = {
{ wood = "mcl_core:wood", post = "mcl_fences:fence", chance = 900}, { wood = "mcl_core:wood", post = "mcl_fences:fence", chance = 900},
{ wood = "mcl_core:darkwood", post = "mcl_fences:dark_oak_fence", chance = 100}, { wood = "mcl_core:darkwood", post = "mcl_fences:dark_oak_fence", chance = 100},
},
} }
else
-- This generates dark oak wood in mesa biomes and oak wood everywhere else.
tsm_railcorridors.nodes.corridor_woods_function = function(pos, node)
if minetest.get_item_group(node.name, "hardened_clay") ~= 0 then
return "mcl_core:darkwood", "mcl_fences:dark_oak_fence"
else
return "mcl_core:wood", "mcl_fences:fence"
end
end
end
-- TODO: Use minecart with chest instead of normal minecart -- TODO: Use minecart with chest instead of normal minecart
tsm_railcorridors.carts = { "mcl_minecarts:minecart" } tsm_railcorridors.carts = { "mcl_minecarts:minecart" }
@ -41,8 +56,6 @@ function tsm_railcorridors.on_construct_spawner(pos)
mcl_mobspawners.setup_spawner(pos, "mobs_mc:cave_spider") mcl_mobspawners.setup_spawner(pos, "mobs_mc:cave_spider")
end end
local mg_name = minetest.get_mapgen_setting("mg_name")
-- MineClone 2's treasure function. Gets all treasures for a single chest. -- MineClone 2's treasure function. Gets all treasures for a single chest.
-- Based on information from Minecraft Wiki. -- Based on information from Minecraft Wiki.
function tsm_railcorridors.get_treasures(pr) function tsm_railcorridors.get_treasures(pr)

View File

@ -746,6 +746,7 @@ local function place_corridors(main_cave_coords, psra)
if not IsGround(main_cave_coords) then if not IsGround(main_cave_coords) then
return return
end end
local center_node = minetest.get_node(main_cave_coords)
-- Determine if this corridor system is “damaged” (some rails removed) and to which extent -- Determine if this corridor system is “damaged” (some rails removed) and to which extent
local damage = 0 local damage = 0
@ -769,11 +770,17 @@ local function place_corridors(main_cave_coords, psra)
local xs = pr:next(0, 2) < 1 local xs = pr:next(0, 2) < 1
local zs = pr:next(0, 2) < 1; local zs = pr:next(0, 2) < 1;
-- Get wood and fence post types, using gameconfig.
local wood, post
if tsm_railcorridors.nodes.corridor_woods_function then
-- Get wood type by gameconfig function
wood, post = tsm_railcorridors.nodes.corridor_woods_function(main_cave_coords, center_node)
else
-- Select random wood type (found in gameconfig.lua) -- Select random wood type (found in gameconfig.lua)
local rnd = pr:next(1,1000) local rnd = pr:next(1,1000)
local woodtype = 1 local woodtype = 1
local accumulated_chance = 0 local accumulated_chance = 0
for w=1, #tsm_railcorridors.nodes.corridor_woods do for w=1, #tsm_railcorridors.nodes.corridor_woods do
local woodtable = tsm_railcorridors.nodes.corridor_woods[w] local woodtable = tsm_railcorridors.nodes.corridor_woods[w]
accumulated_chance = accumulated_chance + woodtable.chance accumulated_chance = accumulated_chance + woodtable.chance
@ -786,8 +793,10 @@ local function place_corridors(main_cave_coords, psra)
break break
end end
end end
local wood = tsm_railcorridors.nodes.corridor_woods[woodtype].wood wood = tsm_railcorridors.nodes.corridor_woods[woodtype].wood
local post = tsm_railcorridors.nodes.corridor_woods[woodtype].post post = tsm_railcorridors.nodes.corridor_woods[woodtype].post
end
start_corridor(main_cave_coords, "x", xs, pr:next(way_min,way_max), psra, wood, post, damage, false) start_corridor(main_cave_coords, "x", xs, pr:next(way_min,way_max), psra, wood, post, damage, false)
start_corridor(main_cave_coords, "z", zs, pr:next(way_min,way_max), psra, wood, post, damage, false) start_corridor(main_cave_coords, "z", zs, pr:next(way_min,way_max), psra, wood, post, damage, false)
-- Auch mal die andere Richtung? -- Auch mal die andere Richtung?