stairs and slab switching

Post Reply
User avatar
Cross_over
Member
Posts: 11
Joined: Fri Nov 10, 2017 18:28
In-game: Cross_over

stairs and slab switching

by Cross_over » Post

Hi all, i'm writing a simple mod to have concrete on my singleplayer mod (learning) i have already block, stairs and slab working, but, i can't get the slabs and the stairs to switch from up or down...

Code: Select all

-- Concrete node
minetest.register_node("mtserver:concrete_block", {
		description = "Concrete block",
		tile_images = {"mtserver_concrete_block.png"},
		drawtype = "normal",
		groups = {cracky = 2},
		sounds = default.node_sound_stone_defaults()
	})

minetest.register_craft({
	output = 'mtserver:concrete_block 4',
	recipe = {
		{'default:cobble', 'default:cobble', ''},
		{'default:cobble', 'default:gravel', ''},
		{'', '', ''},
	}
})
-- Concrete stairs
minetest.register_node("mtserver:stair_concrete_block", {
		description = "Concrete block stairs",
		drawtype = "nodebox",
		tiles = {
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				},
		paramtype = "light",
		paramtype2 = "facedir",
		is_ground_content = true,
		groups = {cracky = 2},
		drop = "mtserver:stair_concrete_block",
		node_box = {
			type = "fixed",
			fixed = {
				{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
				{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
			},
		},
		sounds = default.node_sound_stone_defaults,
	})
	
minetest.register_craft({
	output = 'mtserver:stair_concrete_block 6',
	recipe = {
		{'mtserver:concrete_block', '', ''},
		{'mtserver:concrete_block', 'mtserver:concrete_block', ''},
		{'mtserver:concrete_block', 'mtserver:concrete_block', 'mtserver:concrete_block'},
	}
})
-- Concrete slab
minetest.register_node("mtserver:slab_concrete_block", {
		description = "Concrete block slab",
		drawtype = "nodebox",
		tiles = {
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				"mtserver_concrete_block.png",
				},
		paramtype = "light",
		paramtype2 = "facedir",
		is_ground_content = true,
		groups = {cracky = 2},
		drop = "mtserver:slab_concrete_block",
		node_box = {
			type = "fixed",
			fixed = {
				{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
			},
		},
		sounds = default.node_sound_stone_defaults,
	})

minetest.register_craft({
	output = 'mtserver:slab_concrete_block 6',
	recipe = {
		{'', '', ''},
		{'', '', ''},
		{'mtserver:concrete_block', 'mtserver:concrete_block', 'mtserver:concrete_block'},
	}
})
im sure im missing something but i cant find out
thanks!

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: stairs and slab switching

by GamingAssociation39 » Post

Done hopefully it works the way that he wants it to. :)
Jesus Is Lord and Savior!!!

User avatar
v-rob
Developer
Posts: 971
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: stairs and slab switching

by v-rob » Post

Use this:

Code: Select all

stairs.register_stair_and_slab(
	"concrete_block",
	"mtserver:concrete_block",
	{cracky = 2},
	{"mtserver_concrete_block.png"},
	"Concrete Block Stair",
	"Concrete Block Slab",
	sounds = default.node_sound_stone_defaults,
)
This is the thing used for stairs in Minetest Game and has placing upside down built in to it. Just make sure to put "stairs" in depends.txt.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests