Sokomine wrote:There's at least one other bamboo mod out there. Seems to be a popular plant :-)
It would be nice to provide a working download link. Mediafire is not a good place to place mods. The best (and most likely easiest) solution would be to just attach the mod as a .zip archive to your post.
/giveme bamboo:bamboo 99
Hm, I could add the natural spawning a pull reque.... oh wait, you use mediafireKrock wrote:Released v2
- Added 2 new slabs
- Added file in the first post as attachment
http://i.imgur.com/rP7HYnv.png
Thanks for your answers, I noticed, there's the following problem:
The bamboo does not generate in worlds automatically and needs to get planted first.
Well, I think the bamboo comes from far far away, therefore you need to import it first withYour 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
/giveme bamboo:bamboo 99
I can add more nodes or dependencies, give suggestions :)
Evergreen wrote:spawning a pull reque.... oh wait, you use mediafire
Right, bamboo isn't very common. I'll try using the papyrus spawning code and make it more rare.Krock wrote:Evergreen wrote:spawning a pull reque.... oh wait, you use mediafire
Well, I see you like GitHub - there's it.
If there should be an automatic spawn for bamboo, then it should be rare because there aren't many diffrent places where it grows. (naturally)
EDIT: added a rotated bamboo block, have fun!
minetest.register_node("default:tree", {
description = "Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
@@ -213,3 +213,47 @@ minetest.register_abm({
end
end,
})
+
+--Mapgen Stuff
+function make_bamboo(pos, size)
+ for y=0,size-1 do
+ local p = {x=pos.x, y=pos.y+y, z=pos.z}
+ local nn = minetest.get_node(p).name
+ if minetest.registered_nodes[nn] and
+ minetest.registered_nodes[nn].buildable_to then
+ minetest.set_node(p, {name="bamboo:bamboo"})
+ else
+ return
+ end
+ end
+end
+
+minetest.register_on_generated(function(minp, maxp, seed)
+ if maxp.y >= 2 and minp.y <= 0 then
+ -- Generate Bamboo
+ local perlin1 = minetest.get_perlin(354, 3, 0.7, 100)
+ -- Assume X and Z lengths are equal
+ local divlen = 8
+ local divs = (maxp.x-minp.x)/divlen+1;
+ for divx=0,divs-1 do
+ for divz=0,divs-1 do
+ local x0 = minp.x + math.floor((divx+0)*divlen)
+ local z0 = minp.z + math.floor((divz+0)*divlen)
+ local x1 = minp.x + math.floor((divx+1)*divlen)
+ local z1 = minp.z + math.floor((divz+1)*divlen)
+ -- Determine bamboo amount from perlin noise
+ local bamboo_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 45 - 20)
+ -- Find random positions for Bamboo based on this random
+ local pr = PseudoRandom(seed+1)
+ for i=0,bamboo_amount do
+ local x = pr:next(x0, x1)
+ local z = pr:next(z0, z1)
+ if minetest.get_node({x=x,y=1,z=z}).name == "default:dirt_with_grass" and
+ minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then
+ make_bamboo({x=x,y=2,z=z}, pr:next(2, 4))
+ end
+ end
+ end
+ end
+ end
+end)
local bamboo_amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 45 - 20)
Evergreen wrote:Added ongen for bamboo(did this in about 10 minutes, so tweak it to what you want)
...
Also, will make a pull request which adds support for 6d facedir, support for stairsplus(optional via settings.txt), and an abm to replace all the old horizontal bamboo with the new 6d bamboo(also optional via settings.txt).
...
You're welcome! About the generation, I just had to do it quickly, didn't have time for cleanup.Krock wrote:Evergreen wrote:Added ongen for bamboo(did this in about 10 minutes, so tweak it to what you want)
...
Also, will make a pull request which adds support for 6d facedir, support for stairsplus(optional via settings.txt), and an abm to replace all the old horizontal bamboo with the new 6d bamboo(also optional via settings.txt).
...
Thanks for your help but it simply generated "over" the papyrus node, so I reworked a faster system. It's not a good one but works well.
To the 2nd point: I don't know if a 6d facedir is even needed on this simple node, I think it also has positive things having 2 diffrent rotated nodes :)
Users browsing this forum: No registered users and 9 guests