Adjust tree nodes. Return bucket from sap.
This commit is contained in:
parent
5763c4888e
commit
2e978e540c
3 changed files with 71 additions and 7 deletions
35
treegen.lua
35
treegen.lua
|
@ -166,6 +166,27 @@ minetest.register_node("fun_caves:syrup", {
|
|||
sounds = default.node_sound_glass_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
local name = itemstack:get_name()
|
||||
if not (name and name == 'fun_caves:syrup') then
|
||||
return
|
||||
end
|
||||
|
||||
local bucket
|
||||
local index
|
||||
for i = 1, player:get_inventory():get_size("craft") do
|
||||
if (old_craft_grid[i]:get_name()):find('^fun_caves:bucket') then
|
||||
bucket = old_craft_grid[i]
|
||||
index = i
|
||||
end
|
||||
end
|
||||
if not bucket then
|
||||
return
|
||||
end
|
||||
|
||||
craft_inv:set_stack("craft", index, 'bucket:bucket_empty')
|
||||
end)
|
||||
|
||||
newnode = fun_caves.clone_node("default:tree")
|
||||
newnode.description = "Glowing Fungal Wood"
|
||||
newnode.tiles = {"fun_caves_tree.png^vmg_glowing_fungal.png",}
|
||||
|
@ -290,24 +311,24 @@ fun_caves.treegen = function(minp, maxp, data, p2data, area, node)
|
|||
if distance < r then
|
||||
if distance % 8 == 7 and wood_1[index3d] < 0.3 then
|
||||
data[ivm] = node['fun_caves:petrified_wood']
|
||||
elseif wood_1[index3d] < -0.98 then
|
||||
elseif wood_1[index3d] < -1.1 then
|
||||
data[ivm] = node['fun_caves:weightless_water']
|
||||
elseif wood_1[index3d] < -0.8 then
|
||||
elseif wood_1[index3d] < -0.9 then
|
||||
data[ivm] = node['air']
|
||||
elseif wood_1[index3d] < -0.05 then
|
||||
elseif wood_1[index3d] < -0.1 then
|
||||
data[ivm] = node['fun_caves:tree']
|
||||
elseif wood_1[index3d] < 0.05 then
|
||||
elseif wood_1[index3d] < 0.1 then
|
||||
data[ivm] = node['air']
|
||||
elseif wood_1[index3d] < 0.6 then
|
||||
elseif wood_1[index3d] < 0.9 then
|
||||
data[ivm] = node['fun_caves:tree']
|
||||
elseif wood_1[index3d] < 0.97 then
|
||||
elseif wood_1[index3d] < 1.3 then
|
||||
data[ivm] = node['fun_caves:ironwood']
|
||||
else
|
||||
data[ivm] = node['fun_caves:diamondwood']
|
||||
end
|
||||
|
||||
if data[ivm] ~= node['air'] and data[ivm] ~= node['fun_caves:weightless_water'] then
|
||||
if math_random(500) == 1 then
|
||||
if math_random(100) == 1 then
|
||||
data[ivm] = node['fun_caves:sap']
|
||||
elseif math_random(1000) == 1 then
|
||||
data[ivm] = node['fun_caves:tree_mineral']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue