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_pistons/init.lua | |
parent | aa5538a7348f56b654b9204bf0644c11ee5f8b1d (diff) |
Add support for sticky blocks for pistons and a a sample sticky blockorigin/sticky_blocks
Diffstat (limited to 'mesecons_pistons/init.lua')
-rw-r--r-- | mesecons_pistons/init.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index 7db1073..678adca 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -100,9 +100,10 @@ local piston_off = function(pos, node) piston_remove_pusher(pos, node) if pistonspec.sticky then + local maxpull = mesecon.setting("piston_max_pull", 15) local dir = piston_get_direction(pistonspec.dir, node) - local pullpos = mesecon.addPosRule(pos, dir) - local stack = mesecon.mvps_pull_single(pullpos, dir) + local pullpos = vector.add(pos, vector.multiply(dir, 2)) + local stack = mesecon.mvps_pull_single(pullpos, vector.multiply(dir, -1), maxpull) mesecon.mvps_process_stack(pos, dir, stack) end end |