mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-07-01 07:10:21 +02:00
New node
Linear sticky block Flat sticky block Slippy block
This commit is contained in:
2
mesecons_slippyblocks/depends.txt
Normal file
2
mesecons_slippyblocks/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
mesecons
|
||||
mesecons_mvps
|
76
mesecons_slippyblocks/init.lua
Normal file
76
mesecons_slippyblocks/init.lua
Normal file
@ -0,0 +1,76 @@
|
||||
-- Stippy blocks can be used together with pistons or movestones
|
||||
|
||||
minetest.register_node("mesecons_slippyblocks:slippy_block", {
|
||||
description = "Slippy block)",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"mesecons_slippyblocks.png"},
|
||||
walkable = true,
|
||||
pointable = true,
|
||||
diggable = true,
|
||||
buildable_to = true,
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
drop = "mesecons_slippyblocks:slippy_block",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.4375, -0.4375, 0.4375, 0.4375, 0.4375}, -- MiddleBox
|
||||
{0.4375, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- f1
|
||||
{0.4375, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- f2
|
||||
{-0.5, 0.4375, -0.5, -0.4375, 0.5, 0.5}, -- f3
|
||||
{-0.5, -0.5, -0.5, -0.4375, -0.4375, 0.5}, -- f4
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.4375, -0.4375}, -- r1
|
||||
{-0.5, 0.4375, -0.5, 0.5, 0.5, -0.4375}, -- r2
|
||||
{-0.5, 0.4375, 0.4375, 0.5, 0.5, 0.5}, -- r3
|
||||
{-0.5, -0.5, 0.4375, 0.5, -0.4375, 0.5}, -- r4
|
||||
{0.4375, -0.5, -0.5, 0.5, 0.5, -0.4375}, -- t1
|
||||
{-0.5, -0.5, -0.5, -0.4375, 0.5, -0.4375}, -- t2
|
||||
{-0.5, -0.5, 0.4375, -0.4375, 0.5, 0.5}, -- t3
|
||||
{0.4375, -0.5, 0.4375, 0.5, 0.5, 0.5}, -- t4
|
||||
}
|
||||
},
|
||||
on_destruct = function(pos)
|
||||
minetest.add_item(pos, "mesecons_slippyblocks:slippy_block")
|
||||
end,
|
||||
-- Swap the node to a normal one while diging or building node.
|
||||
on_dig = function(pos, node, player)
|
||||
minetest.swap_node(pos, {name = "mesecons_slippyblocks:slippy_block_temp" })
|
||||
minetest.node_dig(pos, node, player)
|
||||
end,
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
minetest.swap_node(pos, {name = "mesecons_slippyblocks:slippy_block_temp" })
|
||||
minetest.item_place_node(itemstack, placer, pointed_thing, param2)
|
||||
minetest.swap_node(pos, {name = "mesecons_slippyblocks:slippy_block" })
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("mesecons_slippyblocks:slippy_block_temp", {
|
||||
description = "Slippy block)",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"mesecons_slippyblocks.png"},
|
||||
walkable = true,
|
||||
pointable = true,
|
||||
diggable = true,
|
||||
buildable_to = false,
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory = 1},
|
||||
drop = "mesecons_slippyblocks:slippy_block",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.4375, -0.4375, 0.4375, 0.4375, 0.4375}, -- MiddleBox
|
||||
{0.4375, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- f1
|
||||
{0.4375, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- f2
|
||||
{-0.5, 0.4375, -0.5, -0.4375, 0.5, 0.5}, -- f3
|
||||
{-0.5, -0.5, -0.5, -0.4375, -0.4375, 0.5}, -- f4
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.4375, -0.4375}, -- r1
|
||||
{-0.5, 0.4375, -0.5, 0.5, 0.5, -0.4375}, -- r2
|
||||
{-0.5, 0.4375, 0.4375, 0.5, 0.5, 0.5}, -- r3
|
||||
{-0.5, -0.5, 0.4375, 0.5, -0.4375, 0.5}, -- r4
|
||||
{0.4375, -0.5, -0.5, 0.5, 0.5, -0.4375}, -- t1
|
||||
{-0.5, -0.5, -0.5, -0.4375, 0.5, -0.4375}, -- t2
|
||||
{-0.5, -0.5, 0.4375, -0.4375, 0.5, 0.5}, -- t3
|
||||
{0.4375, -0.5, 0.4375, 0.5, 0.5, 0.5}, -- t4
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
|
BIN
mesecons_slippyblocks/textures/mesecons_slippyblocks.png
Normal file
BIN
mesecons_slippyblocks/textures/mesecons_slippyblocks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 373 B |
Reference in New Issue
Block a user