Generation of large twigs and setting for it
First three twig textures are the old ones again. All other twig textures are based on Neuromancer's "comboSticks". Added textures for twigs blocks again.
@ -2,8 +2,149 @@
|
|||||||
-- TWiGS
|
-- TWiGS
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
abstract_trunks.place_twig = function(pos)
|
abstract_trunks.place_twig = function(pos)
|
||||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
local twig_size = math.random(1,24)
|
||||||
minetest.add_node(right_here, {name="trunks:twig_"..math.random(1,3), param2=math.random(0,3)})
|
|
||||||
|
local right_here = {x=pos.x , y=pos.y+1, z=pos.z }
|
||||||
|
local north = {x=pos.x , y=pos.y+1, z=pos.z+1}
|
||||||
|
local north_east = {x=pos.x+1, y=pos.y+1, z=pos.z+1}
|
||||||
|
local east = {x=pos.x+1, y=pos.y+1, z=pos.z }
|
||||||
|
local south_east = {x=pos.x+1, y=pos.y+1, z=pos.z-1}
|
||||||
|
local south = {x=pos.x , y=pos.y+1, z=pos.z-1}
|
||||||
|
local south_west = {x=pos.x-1, y=pos.y+1, z=pos.z-1}
|
||||||
|
local west = {x=pos.x-1, y=pos.y+1, z=pos.z }
|
||||||
|
local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1}
|
||||||
|
|
||||||
|
local node_here = minetest.get_node(right_here)
|
||||||
|
local node_north = minetest.get_node(north)
|
||||||
|
local node_n_e = minetest.get_node(north_east)
|
||||||
|
local node_east = minetest.get_node(east)
|
||||||
|
local node_s_e = minetest.get_node(south_east)
|
||||||
|
local node_south = minetest.get_node(south)
|
||||||
|
local node_s_w = minetest.get_node(south_west)
|
||||||
|
local node_west = minetest.get_node(west)
|
||||||
|
local node_n_w = minetest.get_node(north_west)
|
||||||
|
-- small twigs
|
||||||
|
if twig_size <= 16 then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)})
|
||||||
|
end
|
||||||
|
-- big twigs
|
||||||
|
if Big_Twigs == true then
|
||||||
|
-- big twig 1
|
||||||
|
if twig_size == 17 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_5"})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_n_e.name].buildable_to then
|
||||||
|
minetest.add_node(north_east, {name="trunks:twig_7"})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_east.name].buildable_to then
|
||||||
|
minetest.add_node(east, {name="trunks:twig_8"})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif twig_size == 18 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_5", param2=1})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_s_e.name].buildable_to then
|
||||||
|
minetest.add_node(south_east, {name="trunks:twig_7", param2=1})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_south.name].buildable_to then
|
||||||
|
minetest.add_node(south, {name="trunks:twig_8", param2=1})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif twig_size == 19 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_5", param2=2})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_s_w.name].buildable_to then
|
||||||
|
minetest.add_node(south_west, {name="trunks:twig_7", param2=2})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_west.name].buildable_to then
|
||||||
|
minetest.add_node(west, {name="trunks:twig_8", param2=2})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif twig_size == 20 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_5", param2=3})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_n_w.name].buildable_to then
|
||||||
|
minetest.add_node(north_west, {name="trunks:twig_7", param2=3})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_north.name].buildable_to then
|
||||||
|
minetest.add_node(north, {name="trunks:twig_8", param2=3})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- big twig 2
|
||||||
|
elseif twig_size == 21 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_9"})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_north.name].buildable_to then
|
||||||
|
minetest.add_node(north, {name="trunks:twig_10"})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_n_e.name].buildable_to then
|
||||||
|
minetest.add_node(north_east, {name="trunks:twig_11"})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif twig_size == 22 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_9", param2=1})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_east.name].buildable_to then
|
||||||
|
minetest.add_node(east, {name="trunks:twig_10", param2=1})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_s_e.name].buildable_to then
|
||||||
|
minetest.add_node(south_east, {name="trunks:twig_11", param2=1})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif twig_size == 23 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_9", param2=2})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_south.name].buildable_to then
|
||||||
|
minetest.add_node(south, {name="trunks:twig_10", param2=2})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_s_w.name].buildable_to then
|
||||||
|
minetest.add_node(south_west, {name="trunks:twig_11", param2=2})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif twig_size == 24 then
|
||||||
|
if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to
|
||||||
|
or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to) then
|
||||||
|
|
||||||
|
if minetest.registered_nodes[node_here.name].buildable_to then
|
||||||
|
minetest.add_node(right_here, {name="trunks:twig_9", param2=3})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_west.name].buildable_to then
|
||||||
|
minetest.add_node(west, {name="trunks:twig_10", param2=3})
|
||||||
|
end
|
||||||
|
if minetest.registered_nodes[node_n_w.name].buildable_to then
|
||||||
|
minetest.add_node(north_west, {name="trunks:twig_11", param2=3})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Twigs_on_ground == true then
|
if Twigs_on_ground == true then
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
local title = "Trunks"
|
local title = "Trunks"
|
||||||
local version = "0.0.7"
|
local version = "0.0.9"
|
||||||
local mname = "trunks"
|
local mname = "trunks"
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
-- For compatibility with older stuff
|
-- For compatibility with older stuff
|
||||||
minetest.register_alias("trunks:twig", "trunks:twig_1")
|
minetest.register_alias("trunks:twig", "trunks:twig_1")
|
||||||
|
|
||||||
local flat_stick = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2}
|
local flat_stick = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2}
|
||||||
local NoDe = { {1}, {2}, {3}, {4} }
|
local NoDe = { {1}, {2}, {3}, {4}, {5}, --[[{6},]] {7}, {8}, {9}, {10}, {11} }
|
||||||
|
|
||||||
|
|
||||||
for i in pairs(NoDe) do
|
for i in pairs(NoDe) do
|
||||||
local NR = NoDe[i][1]
|
local NR = NoDe[i][1]
|
||||||
@ -15,7 +16,11 @@ for i in pairs(NoDe) do
|
|||||||
inventory_image = "trunks_twig_"..NR..".png",
|
inventory_image = "trunks_twig_"..NR..".png",
|
||||||
wield_image = "trunks_twig_"..NR..".png",
|
wield_image = "trunks_twig_"..NR..".png",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = { "trunks_twig_"..NR..".png" },
|
tiles = {
|
||||||
|
"trunks_twig_"..NR..".png",
|
||||||
|
"trunks_twig_"..NR..".png^[transformFY", -- mirror
|
||||||
|
"trunks_twig_6.png" -- empty
|
||||||
|
},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -34,7 +39,7 @@ for i in pairs(NoDe) do
|
|||||||
local pt = pointed_thing
|
local pt = pointed_thing
|
||||||
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
if minetest.get_node(pt.above).name=="air" then
|
if minetest.get_node(pt.above).name=="air" then
|
||||||
minetest.set_node(pt.above, {name="trunks:twig_"..math.random(1,3), param2=direction})
|
minetest.set_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})
|
||||||
if not minetest.setting_getbool("creative_mode") then
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 509 B |
BIN
trunks/textures/old & unused/comboSticks_2.png
Normal file
After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
BIN
trunks/textures/old & unused/trunks_twig_1n.png
Normal file
After Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
BIN
trunks/textures/old & unused/trunks_twig_2n.png
Normal file
After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
BIN
trunks/textures/old & unused/trunks_twig_3n.png
Normal file
After Width: | Height: | Size: 291 B |
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
BIN
trunks/textures/old & unused/trunks_twig_4n.png
Normal file
After Width: | Height: | Size: 312 B |
BIN
trunks/textures/old & unused/trunks_twig_5-8.png
Normal file
After Width: | Height: | Size: 267 B |
BIN
trunks/textures/old & unused/trunks_twig_9-12.png
Normal file
After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 244 B |
BIN
trunks/textures/trunks_twig_10.png
Normal file
After Width: | Height: | Size: 235 B |
BIN
trunks/textures/trunks_twig_11.png
Normal file
After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 240 B |
BIN
trunks/textures/trunks_twig_5.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
trunks/textures/trunks_twig_6.png
Normal file
After Width: | Height: | Size: 153 B |
BIN
trunks/textures/trunks_twig_7.png
Normal file
After Width: | Height: | Size: 187 B |
BIN
trunks/textures/trunks_twig_8.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
trunks/textures/trunks_twig_9.png
Normal file
After Width: | Height: | Size: 195 B |
BIN
trunks/textures/trunks_twigs.png
Normal file
After Width: | Height: | Size: 759 B |
BIN
trunks/textures/trunks_twigs_corner.png
Normal file
After Width: | Height: | Size: 730 B |
BIN
trunks/textures/trunks_twigs_top.png
Normal file
After Width: | Height: | Size: 615 B |
@ -3,48 +3,65 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Horizontal_Trunks = true
|
Horizontal_Trunks = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
|
|
||||||
Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %)
|
Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Big_Twigs = true -- twigs larger than one node
|
||||||
Twigs_on_ground = true
|
Twigs_on_ground = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Twigs_on_ground_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
Twigs_on_ground_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
Twigs_on_ground_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %)
|
Twigs_on_ground_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Twigs_on_water = true
|
Twigs_on_water = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Twigs_on_water_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
Twigs_on_water_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
|
|
||||||
Twigs_on_water_Rarity = 33 -- larger values make twigs more rare (100 means chance of 0 %)
|
Twigs_on_water_Rarity = 33 -- larger values make twigs more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Moss_on_ground = true
|
Moss_on_ground = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes
|
Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %)
|
Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Moss_on_trunk = true
|
Moss_on_trunk = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %)
|
Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
Auto_Roof_Corner = true -- behavior is similar (not the same!) to the one of minecraft stairs
|
Auto_Roof_Corner = true -- behavior is similar (not the same!) to the one of minecraft stairs
|