Skip to content

Commit

Permalink
Fix movestone to wire connection looks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeija committed Nov 25, 2014
1 parent e74241f commit f69caba
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions mesecons_movestones/init.lua
Expand Up @@ -67,7 +67,7 @@ minetest.register_node("mesecons_movestones:movestone", {
local direction=mesecon.get_movestone_direction(pos)
if not direction then return end
minetest.remove_node(pos)
mesecon.update_autoconnect(pos)
mesecon.on_dignode(pos, node)
minetest.add_entity(pos, "mesecons_movestones:movestone_entity")
end
}}
Expand Down Expand Up @@ -100,16 +100,20 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
or minetest.registered_nodes[name].liquidtype == "none") then
mesecon.mvps_push(pos, self.lastdir, maxpush)
end
minetest.add_node(pos, {name="mesecons_movestones:movestone"})
local nn = {name="mesecons_movestones:movestone"}
minetest.add_node(pos, nn)
self.object:remove()
mesecon.on_placenode(pos, nn)
return
end

local success, stack, oldstack =
mesecon.mvps_push(pos, direction, maxpush)
if not success then -- Too large stack/stopper in the way
minetest.add_node(pos, {name="mesecons_movestones:movestone"})
local nn = {name="mesecons_movestones:movestone"}
minetest.add_node(pos, nn)
self.object:remove()
mesecon.on_placenode(pos, nn)
return
else
mesecon.mvps_process_stack (stack)
Expand Down Expand Up @@ -147,7 +151,7 @@ minetest.register_node("mesecons_movestones:sticky_movestone", {
local direction=mesecon.get_movestone_direction(pos)
if not direction then return end
minetest.remove_node(pos)
mesecon.update_autoconnect(pos)
mesecon.on_dignode(pos, node)
minetest.add_entity(pos, "mesecons_movestones:sticky_movestone_entity")
end
}}
Expand Down Expand Up @@ -184,20 +188,25 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
if name ~= "air" and name ~= "ignore"
and ((not minetest.registered_nodes[name])
or minetest.registered_nodes[name].liquidtype == "none") then
mesecon.mvps_push(pos, self.lastdir, MOVESTONE_MAXIMUM_PUSH)
mesecon.mvps_push(pos, self.lastdir,
mesecon.setting("movestone_max_push", 50))
--STICKY
mesecon.mvps_pull_all(pos, self.lastdir)
end
minetest.add_node(pos, {name="mesecons_movestones:sticky_movestone"})
local nn = {name="mesecons_movestones:sticky_movestone"}
minetest.add_node(pos, nn)
self.object:remove()
mesecon.on_placenode(pos, nn)
return
end

local success, stack, oldstack =
mesecon.mvps_push(pos, direction, MOVESTONE_MAXIMUM_PUSH)
mesecon.mvps_push(pos, direction, mesecon.setting("movestone_max_push", 50))
if not success then -- Too large stack/stopper in the way
minetest.add_node(pos, {name="mesecons_movestones:sticky_movestone"})
local nn = {name="mesecons_movestones:sticky_movestone"}
minetest.add_node(pos, nn)
self.object:remove()
mesecon.on_placenode(pos, nn)
return
else
mesecon.mvps_process_stack (stack)
Expand Down

0 comments on commit f69caba

Please sign in to comment.