forked from mrkubax10/industrialtest
Fix rubber tree
This commit is contained in:
@@ -214,9 +214,9 @@ end
|
||||
industrialtest.makeRubberTree=function(pos)
|
||||
-- FIXME: Replace this with placing schematic
|
||||
-- Taken and adapted from https://github.com/minetest/minetest_game/blob/master/mods/default/trees.lua#L182
|
||||
minetest.chat_send_all("Making rubber sapling")
|
||||
local height=industrialtest.random:next(4,5)
|
||||
local tree=minetest.get_content_id("industrialtest:rubber_wood")
|
||||
local treeWithRubber=minetest.get_content_id("industrialtest:rubber_wood_with_rubber")
|
||||
local leaves=minetest.get_content_id("industrialtest:rubber_leaves")
|
||||
local air=minetest.get_content_id("air")
|
||||
local ignore=minetest.get_content_id("ignore")
|
||||
@@ -235,7 +235,7 @@ industrialtest.makeRubberTree=function(pos)
|
||||
local index=area:index(pos.x,y,pos.z)
|
||||
local id=data[index]
|
||||
if id==air or id==ignore or id==leaves then
|
||||
data[index]=tree
|
||||
data[index]=(industrialtest.random:next(0,5)==1 and treeWithRubber or tree)
|
||||
end
|
||||
end
|
||||
-- Force leaves near the trunk
|
||||
|
||||
Reference in New Issue
Block a user