diff options
author | Jeija <norrepli@gmail.com> | 2015-02-28 13:42:39 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2015-02-28 13:42:39 +0100 |
commit | a6d0a523ba896762ac8b0d327863e523ab86dc47 (patch) | |
tree | faf6b15af9ae1b056ee45651b12ce2ed6e28e6fe /mesecons_stickyblocks/init.lua | |
parent | aa5538a7348f56b654b9204bf0644c11ee5f8b1d (diff) |
Add support for sticky blocks for pistons and a a sample sticky blockorigin/sticky_blocks
Diffstat (limited to 'mesecons_stickyblocks/init.lua')
-rw-r--r-- | mesecons_stickyblocks/init.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mesecons_stickyblocks/init.lua b/mesecons_stickyblocks/init.lua new file mode 100644 index 0000000..c1eb121 --- /dev/null +++ b/mesecons_stickyblocks/init.lua @@ -0,0 +1,16 @@ +-- Sticky blocks can be used together with pistons or movestones to push / pull +-- structures that are "glued" together using sticky blocks + +-- All sides sticky block +minetest.register_node("mesecons_stickyblocks:sticky_block_all", { + description = "All-sides sticky block", + tiles = {"default_grass_footsteps.png"}, + groups = {dig_immediate=2}, + mvps_sticky = function (pos, node) + local connected = {} + for _, r in ipairs(mesecon.rules.alldirs) do + table.insert(connected, vector.add(pos, r)) + end + return connected + end +}) |