Improve corner stair texturing

Wuzzy 2018-05-29 14:28:26 +02:00
parent 85975a2d26
commit d3f5942d7d
3 changed files with 34 additions and 26 deletions

@ -314,14 +314,14 @@ end
function mcl_stairs.register_stair_and_slab(subname, recipeitem, function mcl_stairs.register_stair_and_slab(subname, recipeitem,
groups, images, desc_stair, desc_slab, sounds, hardness, groups, images, desc_stair, desc_slab, sounds, hardness,
double_description) double_description, corner_stair_texture_override)
mcl_stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds, hardness) mcl_stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds, hardness, corner_stair_texture_override)
mcl_stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds, hardness, double_description) mcl_stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds, hardness, double_description)
end end
-- Very simple registration function -- Very simple registration function
-- Makes stair and slab out of a source node -- Makes stair and slab out of a source node
function mcl_stairs.register_stair_and_slab_simple(subname, sourcenode, desc_stair, desc_slab, desc_double_slab) function mcl_stairs.register_stair_and_slab_simple(subname, sourcenode, desc_stair, desc_slab, desc_double_slab, corner_stair_texture_override)
local def = minetest.registered_nodes[sourcenode] local def = minetest.registered_nodes[sourcenode]
local groups = {} local groups = {}
-- Only allow a strict set of groups to be added to stairs and slabs for more predictable results -- Only allow a strict set of groups to be added to stairs and slabs for more predictable results
@ -331,6 +331,6 @@ function mcl_stairs.register_stair_and_slab_simple(subname, sourcenode, desc_sta
groups[allowed_groups[a]] = def.groups[allowed_groups[a]] groups[allowed_groups[a]] = def.groups[allowed_groups[a]]
end end
end end
mcl_stairs.register_stair_and_slab(subname, sourcenode, groups, def.tiles, desc_stair, desc_slab, def.sounds, def._mcl_hardness, desc_double_slab) mcl_stairs.register_stair_and_slab(subname, sourcenode, groups, def.tiles, desc_stair, desc_slab, def.sounds, def._mcl_hardness, desc_double_slab, corner_stair_texture_override)
end end

@ -208,17 +208,25 @@ function mcl_stairs.cornerstair.add(name, stairtiles)
local outer_tiles local outer_tiles
local inner_tiles local inner_tiles
if stairtiles == "woodlike" then if stairtiles == "woodlike" then
outer_tiles = table.copy(node_def.tiles)
inner_tiles = table.copy(node_def.tiles)
for i=2,6 do
if outer_tiles[i] == nil then
outer_tiles[i] = outer_tiles[i-1]
end
if inner_tiles[i] == nil then
inner_tiles[i] = inner_tiles[i-1]
end
end
local t = node_def.tiles[1] local t = node_def.tiles[1]
outer_tiles = { outer_tiles[1] = t.."^("..t.."^[transformR90^mcl_stairs_turntexture.png^[makealpha:255,0,255)"
t.."^("..t.."^[transformR90^mcl_stairs_turntexture.png^[makealpha:255,0,255)", outer_tiles[2] = t.."^("..t.."^mcl_stairs_turntexture.png^[transformR270^[makealpha:255,0,255)"
t.."^("..t.."^mcl_stairs_turntexture.png^[transformR270^[makealpha:255,0,255)", inner_tiles[1] = t.."^("..t.."^[transformR90^(mcl_stairs_turntexture.png^[transformR180)^[makealpha:255,0,255)"
t inner_tiles[2] = t.."^("..t.."^[transformR270^(mcl_stairs_turntexture.png^[transformR90)^[makealpha:255,0,255)"
} for i=3,6 do
inner_tiles = { -- outer_tiles[i] = t
t.."^("..t.."^[transformR90^(mcl_stairs_turntexture.png^[transformR180)^[makealpha:255,0,255)", -- inner_tiles[i] = t
t.."^("..t.."^[transformR270^(mcl_stairs_turntexture.png^[transformR90)^[makealpha:255,0,255)", end
t
}
elseif stairtiles == nil or stairtiles == "default" then elseif stairtiles == nil or stairtiles == "default" then
outer_tiles = node_def.tiles outer_tiles = node_def.tiles
inner_tiles = node_def.tiles inner_tiles = node_def.tiles

@ -4,30 +4,30 @@ mcl_stairs.register_stair_and_slab_simple("red_nether_brick", "mcl_nether:red_ne
mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", "Moss Stone Stairs", "Moss Stone Slab", "Double Moss Stone Slab") mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", "Moss Stone Stairs", "Moss Stone Slab", "Double Moss Stone Slab")
mcl_stairs.register_stair_and_slab_simple("tree_bark", "mcl_core:tree_bark", "Oak Bark Stairs", "Oak Bark Slab", "Double Oak Bark Slab") mcl_stairs.register_stair_and_slab_simple("tree_bark", "mcl_core:tree_bark", "Oak Bark Stairs", "Oak Bark Slab", "Double Oak Bark Slab", "woodlike")
mcl_stairs.register_stair_and_slab_simple("acaciatree_bark", "mcl_core:acaciatree_bark", "Acacia Bark Stairs", "Acacia Bark Slab", "Double Acacia Bark Slab") mcl_stairs.register_stair_and_slab_simple("acaciatree_bark", "mcl_core:acaciatree_bark", "Acacia Bark Stairs", "Acacia Bark Slab", "Double Acacia Bark Slab", "woodlike")
mcl_stairs.register_stair_and_slab_simple("sprucetree_bark", "mcl_core:sprucetree_bark", "Spruce Bark Stairs", "Spruce Bark Slab", "Double Spruce Bark Slab") mcl_stairs.register_stair_and_slab_simple("sprucetree_bark", "mcl_core:sprucetree_bark", "Spruce Bark Stairs", "Spruce Bark Slab", "Double Spruce Bark Slab", "woodlike")
mcl_stairs.register_stair_and_slab_simple("birchtree_bark", "mcl_core:birchtree_bark", "Birch Bark Stairs", "Birch Bark Slab", "Double Birch Bark Slab") mcl_stairs.register_stair_and_slab_simple("birchtree_bark", "mcl_core:birchtree_bark", "Birch Bark Stairs", "Birch Bark Slab", "Double Birch Bark Slab", "woodlike")
mcl_stairs.register_stair_and_slab_simple("jungletree_bark", "mcl_core:jungletree_bark", "Jungle Bark Stairs", "Jungle Bark Slab", "Double Jungle Bark Slab") mcl_stairs.register_stair_and_slab_simple("jungletree_bark", "mcl_core:jungletree_bark", "Jungle Bark Stairs", "Jungle Bark Slab", "Double Jungle Bark Slab", "woodlike")
mcl_stairs.register_stair_and_slab_simple("darktree_bark", "mcl_core:darktree_bark", "Dark Oak Bark Stairs", "Dark Oak Bark Slab", "Double Dark Oak Bark Slab") mcl_stairs.register_stair_and_slab_simple("darktree_bark", "mcl_core:darktree_bark", "Dark Oak Bark Stairs", "Dark Oak Bark Slab", "Double Dark Oak Bark Slab", "woodlike")
mcl_stairs.register_slab("lapisblock", "mcl_core:lapisblock", {pickaxey=3}, {"mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, "Lapis Lazuli Slab", nil, nil, "Double Lapis Lazuli Slab") mcl_stairs.register_slab("lapisblock", "mcl_core:lapisblock", {pickaxey=3}, {"mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, "Lapis Lazuli Slab", nil, nil, "Double Lapis Lazuli Slab")
mcl_stairs.register_stair("lapisblock", "mcl_core:lapisblock", {pickaxey=3}, {"mcl_stairs_lapis_block_slab.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, "Lapis Lazuli Stair") mcl_stairs.register_stair("lapisblock", "mcl_core:lapisblock", {pickaxey=3}, {"mcl_stairs_lapis_block_slab.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_core_lapis_block.png", "mcl_stairs_lapis_block_slab.png"}, "Lapis Lazuli Stair", nil, nil, "woodlike")
mcl_stairs.register_slab("goldblock", "mcl_core:goldblock", {pickaxey=4}, {"default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, "Slab of Gold", nil, nil, "Double Slab of Gold") mcl_stairs.register_slab("goldblock", "mcl_core:goldblock", {pickaxey=4}, {"default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, "Slab of Gold", nil, nil, "Double Slab of Gold")
mcl_stairs.register_stair("goldblock", "mcl_core:goldblock", {pickaxey=4}, {"mcl_stairs_gold_block_slab.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, "Stair of Gold") mcl_stairs.register_stair("goldblock", "mcl_core:goldblock", {pickaxey=4}, {"mcl_stairs_gold_block_slab.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "default_gold_block.png", "mcl_stairs_gold_block_slab.png"}, "Stair of Gold", nil, nil, "woodlike")
mcl_stairs.register_slab("ironblock", "mcl_core:ironblock", {pickaxey=2}, {"default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, "Slab of Iron", nil, nil, "Double Slab of Iron") mcl_stairs.register_slab("ironblock", "mcl_core:ironblock", {pickaxey=2}, {"default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, "Slab of Iron", nil, nil, "Double Slab of Iron")
mcl_stairs.register_stair("ironblock", "mcl_core:ironblock", {pickaxey=2}, {"mcl_stairs_iron_block_slab.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, "Stair of Iron") mcl_stairs.register_stair("ironblock", "mcl_core:ironblock", {pickaxey=2}, {"mcl_stairs_iron_block_slab.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "default_steel_block.png", "mcl_stairs_iron_block_slab.png"}, "Stair of Iron", nil, nil, "woodlike")
mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, "Polished Andesite Slab", nil, nil, "Double Polished Andesite Slab") mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, "Polished Andesite Slab", nil, nil, "Double Polished Andesite Slab")
mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, "Polished Andesite Stair") mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, "Polished Andesite Stair", nil, nil, "woodlike")
mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, "Polished Granite Slab", nil, nil, "Double Polished Granite Slab") mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, "Polished Granite Slab", nil, nil, "Double Polished Granite Slab")
mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, "Polished Granite Stair") mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, "Polished Granite Stair", nil, nil, "woodlike")
mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, "Polished Diorite Slab", nil, nil, "Double Polished Diorite Slab") mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, "Polished Diorite Slab", nil, nil, "Double Polished Diorite Slab")
mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, "Polished Diorite Stair") mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, "Polished Diorite Stair", nil, nil, "woodlike")
mcl_stairs.register_stair("stonebrickmossy", "mcl_core:stonebrickmossy", mcl_stairs.register_stair("stonebrickmossy", "mcl_core:stonebrickmossy",
{pickaxey=1}, {pickaxey=1},