Page 1 of 1

Cobblestone Generator problem

PostPosted: Sun Sep 16, 2012 18:47
by princessjinifer
I built a cobblestone generator, from this video:

http://www.youtube.com/watch?v=fsYNNyvBiUg

and it turned out like this:
Image

and it doesn't produce any cobblestone. The thing in the middle is a piston, to push the cobble out after it is generated, but it isn't generating any.. so.

Was the feature removed? Or is there a bug preventing it from working? Or did they change the way it works?

Thanks in advance! :)

Princessjinifer.

PostPosted: Sun Sep 16, 2012 18:48
by sfan5
You can't generate Cobblestone in Minetest

PostPosted: Sun Sep 16, 2012 18:52
by Casimir
Read the info of the video. You need the obsidian mod.

PostPosted: Sun Sep 16, 2012 20:06
by princessjinifer
Thanks guys! Right after sfan5 responded, I did read the description, and saw that it was a mod.. After searching around, I found it on github, and took this code:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_abm(
{nodenames = {"default:lava_source"},
interval = 5,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
    for i=-1,1 do
        for j=-1,1 do
            for k=-1,1 do
                p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
                n = minetest.env:get_node(p)
                if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
                    minetest.env:add_node(pos, {name="default:cobble"})
                end
            end
        end
    end
end
})

minetest.register_abm(
{nodenames = {"default:lava_flowing"},
interval = 5,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
    for i=-1,1 do
        for j=-1,1 do
            for k=-1,1 do
                p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
                n = minetest.env:get_node(p)
                if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
                    if (j==-1) then
                        minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, {name="default:cobble"})
                    else
                        minetest.env:add_node(pos, {name="default:cobble"})
                    end
                end
            end
        end
    end
end
})

print("[Obsidian] Loaded!")


but changed one slight thing. A place where it would change flowing lave to a custom block (that cannot be removed) and I changed that to default:cobble. Then after a little trial and error, I realized that I needed to switch the sides of the lava and water, and it worked :)

So in the end result, I used a blinky plant, a switch, a microcontroller and a piston to push the blocks out after they are generated, but since it can only push 16, after the 16th, the circuit still goes, but the piston does not move at all. This is just the start of a self repairing bridge, or self repairing anything if implemented correctly :)

PostPosted: Mon Sep 17, 2012 01:21
by cornernote
I did it like this in my skyblock game:
https://github.com/cornernote/minetest-skyblock/blob/master/register_abm.lua#L191

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- lava_source next to water_flowing will turn the water_flowing to stone
-- lava_source next to water_source will turn the lava_source to stone
minetest.register_abm({
    nodenames = {"default:lava_source"},
    neighbors = {"default:water_source", "default:water_flowing"},
    interval = 2,
    chance = 1,
    action = function(pos)
        local waterpos = minetest.env:find_node_near(pos,1,{"default:water_flowing"})
        if waterpos==nil then
            minetest.env:add_node(pos, {name="default:stone"})
        else
            while waterpos ~=nil do
                minetest.env:add_node(waterpos, {name="default:stone"})
                waterpos = minetest.env:find_node_near(pos,1,{"default:water_flowing"})
            end
        end
    end,
})

PostPosted: Mon Sep 17, 2012 02:49
by jordan4ibanez
that was months ago, and i don't even know if the mod still exists